isobretatel
isobretatel

Reputation: 3930

Gradle: How do I copy servlet JARS to a folder in WAR file?

My build.gradle excludes jsp-api.jar, servlet-api.jar from WEB-INF/lib in WAR file:

ext{
    servlet = [
        'javax.servlet.jsp:jsp-api:2.2',
        'javax.servlet:servlet-api:2.3'
    ]
}

war {
    dependencies {
        providedCompile servlet
    }
}

I need those JARS in a separate 'libs' folder in the WAR file. How do I do that?

Upvotes: 0

Views: 555

Answers (1)

Vampire
Vampire

Reputation: 38649

Something like

war { from(configurations.providedCompile) { into 'libs' } }

should do.

Btw. the dependencies block inside the war block is misplaced.
It works as Gradle is very generous, but it should really be outside.

Upvotes: 1

Related Questions