Skip to content

Instantly share code, notes, and snippets.

@danhyun
Created October 24, 2014 18:28
Show Gist options
  • Save danhyun/fdf8de1be822ec6b30e6 to your computer and use it in GitHub Desktop.
Save danhyun/fdf8de1be822ec6b30e6 to your computer and use it in GitHub Desktop.
apply plugin: 'war'
apply from: 'https://raw.github.com/akhikhl/gretty/master/pluginScripts/gretty.plugin'
gretty {
servletContainer = 'tomcat7'
enableNaming = true
jvmArgs '-Xmx2048M', '-XX:+CMSClassUnloadingEnabled'
afterEvaluate {
clean.dependsOn cleanPrepareArchiveWebApp
clean.dependsOn cleanPrepareInplaceWebApp
clean.dependsOn cleanPrepareInplaceWebAppClasses
clean.dependsOn cleanPrepareInplaceWebAppFolder
}
}
repositories {
mavenLocal()
mavenCentral()
}
dependencies {
compile 'mysql:mysql-connector-java:5.1.33'
compile 'postgresql:postgresql:8.3-603.jdbc4'
compile files("${tomcatHome}/lib/ojdbc5_g.jar")
compile 'org.apache.tomcat:tomcat-dbcp:7.0.55'
}
clean.dependsOn cleanWar
@danhyun
Copy link
Author

danhyun commented Oct 24, 2014

Getting a whole lot of this:

2014-10-24 14:26:41.339 WARN  - Failed to register in JMX: javax.naming.NamingException: C
ould not create resource factory instance [Root exception is java.lang.ClassNotFoundExcept
ion: org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory]

@akhikhl
Copy link

akhikhl commented Oct 24, 2014

First step: change "compile" to "gretty". Files belonging to "compile" configuration are part of webapp. Files belonging to "gretty" configuration are part of server and they are loaded earlier than webapp.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment