web applications - how to set webAppDirName in gradle -


how change webappdir point /web instead of src/main/webapp

i trying change webappdir webcontent (dynamic web application structure in eclipse).

i using gradle 1.7. when trying same thing mention in forum, gives me error :

creating properties on demand (a.k.a. dynamic properties) has been deprecated , scheduled removed in gradle 2.0.  please read http://gradle.org/docs/current/dsl/org.gradle.api.plugins.extrapropertiesextension.html information on replacement dynamic properties.  deprecated dynamic property: "webappdirname" on "root project 'xxxxxxxxxx", value: "webcontent". 

the output war contains 2 folder "web-inf" , "meta-inf"

update

build.gradle

    webappdirname='webcontent'  apply plugin: 'war' apply plugin: 'jetty' apply plugin: 'eclipse-wtp'  sourcesets {     main {         java {             srcdir 'src'         }         resources {             srcdir 'src'         }      } } configurations { morelibs }  repositories {     flatdir { dirs "webcontent/web-inf/lib" }     mavencentral() }  dependencies {     compile filetree(dir: "webcontent/web-inf/lib", include: '*.jar')     providedcompile 'javax.servlet:javax.servlet-api:3.0.1'     runtime 'javax.servlet:jstl:1.2' }   /* change context path (base url). otherwise defaults name of project */ jettyrunwar.contextpath = '' 

please help.

another question:

web-inf folder under webcontent. whether copy of webcontent replace classes folder.

finally resolved.

answer project.webappdirname = 'webcontent'

build.gradle file :

apply plugin: 'war' apply plugin: 'jetty' apply plugin: 'eclipse-wtp'    project.webappdirname = 'webcontent'  sourcesets {     main {         java { srcdir 'src' }         resources { srcdir 'src' }     } } configurations { morelibs }  repositories {     mavencentral() }  dependencies {     compile filetree(dir: "webcontent/web-inf/lib", include: '*.jar')     providedcompile 'javax.servlet:javax.servlet-api:3.0.1'     runtime 'javax.servlet:jstl:1.2' }  war {     exclude 'web-inf/lib/**'     exclude 'web-inf/classes/**' } /* change context path (base url). otherwise defaults name of project */ jettyrunwar.contextpath = '' 

Comments

Popular posts from this blog

assembly - 8086 TASM: Illegal Indexing Mode -

Java, LWJGL, OpenGL 1.1, decoding BufferedImage to Bytebuffer and binding to OpenGL across classes -

javascript - addthis share facebook and google+ url -