[
https://issues.apache.org/jira/browse/MDEP-595?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16416087#comment-16416087
]
Beirtí Ó'Nunáin commented on MDEP-595:
--------------------------------------
I can't say for certain where the problem lies. My assumption was that the
reactor build order during multithreaded builds would be controlled by the
dependency plugin. I've ended up refactoring my project so that the test
code is in a separate module for each affected project to work around the
issue.
On Tue, 27 Mar 2018, 17:36 Karl Heinz Marbaise (JIRA), <[email protected]>
> Maven 3.5.2 introduces intermittent test-jar dependency failures in
> multi-module builds
> ---------------------------------------------------------------------------------------
>
> Key: MDEP-595
> URL: https://issues.apache.org/jira/browse/MDEP-595
> Project: Maven Dependency Plugin
> Issue Type: Bug
> Components: resolve
> Environment: Windows 7 / Server 2012
> Maven 3.5.2
> JDK 1.8
> maven-jar-plugin 2.6
> maven-dependency-plugin 2.10 & 3.0.2
> Reporter: Beirtí Ó'Nunáin
> Priority: Major
>
> This issue never presented in 6 months of running a multi-module build on
> Maven 3.2.5. It began to present in Maven 3.5.2.
> As it's intermittent, will obviously be difficult to reproduce, but here is a
> knocked-down version of our project:
> * parent-aggregator
> ** project_a
> ** project_b
> *** builds jar and test-jar
> Project B has following pom snippet:
> {code:java}
> <plugin>
> <groupId>org.apache.maven.plugins</groupId>
> <artifactId>maven-jar-plugin</artifactId>
> <executions>
> <execution>
> <goals>
> <goal>test-jar</goal>
> </goals>
> </execution>
> </executions>
> </plugin>
> {code}
> Project A has a <type>test-jar</type> on Project B. The dependency
> declaration is as follows
> {code:java}
> <dependency>
> <groupId>mygroup</groupId>
> <artifactId>projectB</artifactId>
> <version>${project.version}</version>
> <type>test-jar</type>
> <scope>test</scope
> </dependency>
> {code}
> Using Maven 3.2.5, the dependency had been declared using
> <classifier>tests</classifier> and this worked fine. Following a
> recommendation on this page:
> https://stackoverflow.com/questions/1725476/maven-test-dependency-in-multi-module-project
> which refers to the previous editions of the guide suggesting classifier, I
> switched to '<type>' but still have the same intermittent issue.
> This page suggests that using 'test-jar' is supported but not ideal:
> https://maven.apache.org/plugins/maven-jar-plugin/examples/create-test-jar.html
> Should we expect multi-module builds to work with test-jar dependencies or
> should we be using a separate 'tests' module instead?
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)