You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Beirtí Ó'Nunáin (JIRA)" <ji...@apache.org> on 2018/01/10 10:54:00 UTC
[jira] [Created] (MDEP-595) Maven 3.5.2 introduces intermittent
test-jar dependency failures in multi-module builds
Beirtí Ó'Nunáin created MDEP-595:
------------------------------------
Summary: 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
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
(v6.4.14#64029)