RachelD
RachelD

Reputation: 4089

Change gradle-tomcat-plugin root web application directory

I'm using the gradle-tomcat-plugin to run tomcat on a simple web application. What Im trying to do is to change the root web application directory from src/main/webapp/ to WebContent/

tomcat {
    httpPort = 8080
    httpsPort = 8081
    enableSSL = false

    jasper {
        uriroot = file('WebContent')
    }
}

This is not working at all when I run gradle tomcatRun and it still maps to src/main/webapp/.

Any suggestions?

Upvotes: 2

Views: 647

Answers (1)

Benjamin Muschko
Benjamin Muschko

Reputation: 33436

Configuring the web application directory in Gradle is independent of the configuration properties exposed by the Tomcat plugin. The plugin that sets the default web app directory to src/main/webapp is the War plugin. To change this default directory assign a new value to the property webAppDirName, as shown in the following example:

webAppDirName = 'WebContent'

Upvotes: 1

Related Questions