# How to change webAppDir to point to "WebContent" instead of src/main/webapp

**URL:** <https://discuss.gradle.org/t/how-to-change-webappdir-to-point-to-webcontent-instead-of-src-main-webapp/3674>\
**Category:** Old Forum Archive\
**Created:** [August 19, 2013, 9:24am UTC](https://discuss.gradle.org/t/how-to-change-webappdir-to-point-to-webcontent-instead-of-src-main-webapp/3674 "2013-08-19T09:24:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shashi\_Bhushan](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/shashi_bhushan/32/749_2.png) [@Shashi\_Bhushan](https://discuss.gradle.org/u/Shashi_Bhushan)\
**Post date:** [August 19, 2013, 9:24am UTC](https://discuss.gradle.org/t/how-to-change-webappdir-to-point-to-webcontent-instead-of-src-main-webapp/3674/1 "2013-08-19T09:24:00Z")

</div>

[How to change webAppDir to point to /web instead of src/main/webapp](http://forums.gradle.org/gradle/topics/how_to_change_webappdir_to_point_to_web_instead_of_src_main_webapp)

I am trying to change the webAppDir to WebContent (Dynamic Web Application Structure in eclipse).

I am using gradle 1.7. When i am trying to do the same thing as mention in Forum, it gives me error :

```gradle
Creating properties on demand (a.k.a. dynamic properties) has been deprecated
and is scheduled to be removed in Gradle 2.0.
 Please read http://gradle.org/docs/current/dsl/org.gradle.api.plugins.ExtraPropertiesExtension.html
for information on the replacement for dynamic properties.
  Deprecated dynamic property: "webAppDirName" on "root project 'xxxxxxxxxx", value: "WebContent".

```

The output WAR contains two folder “WEB-INF” and “META-INF”

```gradle
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 to name of project */
 jettyRunWar.contextPath = ''

```

Please help.

Another question:

WEB-INF folder is also under WebContent. Whether the Copy of WebContent replace the classes folder.

---

<div class="post-metadata">

**Author:** ![ShashiBhushan](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/shashibhushan/32/1349_2.png) [@ShashiBhushan](https://discuss.gradle.org/u/ShashiBhushan)\
**Post date:** [August 21, 2013, 8:11am UTC](https://discuss.gradle.org/t/how-to-change-webappdir-to-point-to-webcontent-instead-of-src-main-webapp/3674/2 "2013-08-21T08:11:00Z")

</div>

Finally Resolved.

Answer is

’ project.webAppDirName = ‘WebContent’’

Build.gradle file :

```gradle
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 to name of project */
 jettyRunWar.contextPath = ''

```
