A dependency on a test-jar should bring in the main artifact as a dependency
----------------------------------------------------------------------------
Key: MNG-3044
URL: http://jira.codehaus.org/browse/MNG-3044
Project: Maven 2
Issue Type: Bug
Reporter: Kenney Westerhof
Note that this issue is NOT a duplicate of MNG-1378 ea.
Since test-classes (src/test/java) have src/main/java in the classpath while
compiling, and often use code from it,
the main classes should be included in the classpath if there's a dependency on
the test jar.
Consider:
Project A has src/main/java/Main.java and src/test/java/Test.java, where
Test.java uses Main.java.
Project A is packaged as a normal jar and has an attached test-jar.
Project B depends on A's test-jar, because it wants to use Test.java
(Test.class).
This fails because of a NoClassDefFound on Main.class: B's compiletime
classpath contains B's sources and the test-jar. It should also contain
A's main artifact.
Test-jars have a compile-time (and runtime) dependency on the main classes;
maven should bring in the main artifact aswell.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira