GitBucket
4.21.2
Toggle navigation
Snippets
Sign in
Files
Branches
1
Releases
Issues
Pull requests
Labels
Priorities
Milestones
Wiki
Forks
mark.george
/
jetty
Browse code
Switch to tasks.register
master
1 parent
32341c2
commit
acd8e1c729ff2ce01ae28c8c4a0f74a331c0d977
Mark George
authored
on 14 Dec 2021
Patch
Showing
1 changed file
build.gradle
Ignore Space
Show notes
View
build.gradle
import org.h2.tools.Console; buildscript { repositories { mavenCentral() } dependencies { classpath group: "com.h2database", name: "h2", version: "1.4.200" } } plugins { id "war" id "application" } repositories { mavenCentral() } dependencies { providedCompile group: "javax.servlet", name: "javax.servlet-api", version: "4.0.1" // jetty 10 supports servlet 4 def jettyVer = "10.+" implementation group: "org.eclipse.jetty", name: "jetty-webapp", version: jettyVer implementation group: "org.eclipse.jetty", name: "jetty-annotations", version: jettyVer implementation group: "org.eclipse.jetty", name: "apache-jsp", version: jettyVer implementation group: "org.eclipse.jetty", name: "jetty-slf4j-impl", version: jettyVer implementation group: "com.h2database", name: "h2", version: "1.4.200" implementation group: "ch.qos.logback", name: "logback-classic", version: "1.2.5" } war { // add db to WAR from 'db' } run { dependsOn war } tasks.register("db") { doLast { new org.h2.tools.Console().runTool("-user", "sa", "-url", "jdbc:h2:${projectDir}/db/db/users;AUTO_SERVER=TRUE;IFEXISTS=TRUE"); } } mainClassName = "Start"
import org.h2.tools.Console; buildscript { repositories { mavenCentral() } dependencies { classpath group: "com.h2database", name: "h2", version: "1.4.200" } } plugins { id "war" id "application" } repositories { mavenCentral() } dependencies { providedCompile group: "javax.servlet", name: "javax.servlet-api", version: "4.0.1" // jetty 10 supports servlet 4 def jettyVer = "10.+" implementation group: "org.eclipse.jetty", name: "jetty-webapp", version: jettyVer implementation group: "org.eclipse.jetty", name: "jetty-annotations", version: jettyVer implementation group: "org.eclipse.jetty", name: "apache-jsp", version: jettyVer implementation group: "org.eclipse.jetty", name: "jetty-slf4j-impl", version: jettyVer implementation group: "com.h2database", name: "h2", version: "1.4.200" implementation group: "ch.qos.logback", name: "logback-classic", version: "1.2.5" } war { // add db to WAR from 'db' } run { dependsOn war } task db { doLast { new org.h2.tools.Console().runTool("-user", "sa", "-url", "jdbc:h2:${projectDir}/db/db/users;AUTO_SERVER=TRUE;IFEXISTS=TRUE"); } } mainClassName = "Start"
Show line notes below