War file creation pulls in javadoc and sources

(Josh) #1

Hi all,

I already asked this question on Stackoverflow. I thought I have a working solution but it appears it’s just a workaround. I need to find the root of it.

My problem is following:

I have an ivy repo with the following pattern

repositories {
    ivy {
        layout "pattern", {
            artifact '[organisation]/[module]/[revision]/[type]s/[artifact]-[revision].[ext]'
            ivy '[organisation]/[module]/[revision]/[type]s/[artifact]-[revision].[ext]'

When I build jars everything works as expected. Now I’m in a situation where I need to build a war file with the war plugin.

When the war builds it also includes javadoc and sources in the WEB-INF/lib folder. My guess is that it pulls everything which is in the publication section of the ivy descriptor file of a dependency. All I want is the jar file. Nothing else.

Does anybody know what might happen here?

(Josh) #2

Is there a way to exclude the ivy’s “[type]” of the above repository configuration? If yes that would solve my problem I guess.

configuration.myConfig { Configuration config -> 
    config.exclude ...

I can only exclude group and module.

(Josh) #3

Nobody has an idea? In cases where the ivy repository is may incorrect with the ivy.xml’s you don’t have a chance to avoid pulling in the javadoc and sources.
My Problem is that I have an ivy repository (Artifactory) as our current build environment is ivy/ant. We want to switch to gradle but if it’s not possible to prevent that javadoc and source jars are pulled in… Not sure if to continue with gradle. Any help would be good :slight_smile: