How to change webAppDir to point to /web instead of src/main/webapp

Hi guys, I am trying to point the directory of the War plugin webAppDir to a custom, but the plugin define this propery as read-only, whenever I try to change it it complaints about it.

Any though on how to have my source dir in one place and my web app dir in another?

to set this folder, you can use the “webAppDirName” property.

cheers, René

I did it like this


webAppDirName=file(‘web’) }

But gradle complaints that this is deprecated why?

  • the webAppDirName is a string property * the webAppDirName property is part of the warPluginConvention, so it is accessed directly on the project object where the ‘war’ plugin is applied
apply plugin: 'war'
webAppDirName = 'web'

getting this exception

Creating properties on demand (a.k.a. dynamic properties) has been deprecated and is scheduled to be removed in Gradle 2.0. Please read for information on the replacement for dynamic properties.
Deprecated dynamic property: "webAppDirName" on "root project 'xxxxxxxxxx", value: "WebContent".

How to resolve this issue… This is my first meet with Gradle… Please help