Julien Berthoud
Julien Berthoud

Reputation: 769

maven-war-plugin: jar deployed twice in nexus when attachClasses set to true

I have a very similar problem as exposed in maven jar deployed twice in a war module with attachClasses set to true, except that my setting is different and that what seems to have helped, doesn't work for me this time.

Here my setting:

             <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <version>3.3.1</version>
                <configuration>
                    <archive>
                        <manifest>
                            <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                            <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
                        </manifest>
                       <manifestEntries><Build-Time>${maven.build.timestamp}</Build-Time></manifestEntries>-->
                    </archive>
                    <attachClasses>true</attachClasses>
                </configuration>
            </plugin>

All works fine except that when Jenkins tries to deploy on Nexus, it tries to deploy the file classes.jar twice which leads to a failure.

Has someone a clue?

Upvotes: 0

Views: 158

Answers (1)

J Fabian Meier
J Fabian Meier

Reputation: 35893

The architecture of the multi module project is suboptimal.

Extract the classes that both A and B need into a new module C and let A and B depend on C. Avoid to use side artifacts as dependencies.

Upvotes: 1

Related Questions