Quantcast
Channel: Gradle Forums - Latest posts
Viewing all articles
Browse latest Browse all 20436

The transitive jars lost in .war file when it's in 'provideRuntime' configuration!

$
0
0

The very first line you quoted from the link spends the rest of the paragraph answering your question. In that example, spring-core is commons-httpclient and spring-jcl is commons-codec.

Let’s say you add commons-httpclient:commons-httpclient:3.0 to any of the provided configurations. This dependency has a dependency on commons-codec . Because this is a “provided” configuration, this means that neither of these dependencies will be added to your WAR, even if the commons-codec library is an explicit dependency of your compile configuration. If you don’t want this transitive behavior, simply declare your provided dependencies like commons-httpclient:commons-httpclient:3.0@jar.

In other words, your dependency declaration would look like this:

dependencies { 
    implementation 'org.springframework:spring-jcl:5.1.6.RELEASE'
    providedRuntime 'org.springframework:spring-core:5.1.6.RELEASE@jar'
}

Viewing all articles
Browse latest Browse all 20436

Latest Images

Trending Articles



Latest Images