You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Henrik Brautaset Aronsen (JIRA)" <ji...@codehaus.org> on 2009/02/12 09:38:19 UTC
[jira] Created: (MNG-4032) Test jar dependency not available for
for main classes in multi module builds
Test jar dependency not available for for main classes in multi module builds
-----------------------------------------------------------------------------
Key: MNG-4032
URL: http://jira.codehaus.org/browse/MNG-4032
Project: Maven 2
Issue Type: Bug
Components: Bootstrap & Build, Class Loading, Dependencies, Inheritance and Interpolation
Affects Versions: 2.1.0-M1, 2.0.9
Environment: MacOSX, Linux
Reporter: Henrik Brautaset Aronsen
Attachments: tests-dependency.zip
I have a module layout like this:
{noformat}
root -+- first
+- second
{noformat}
I have the test-jar plugin enabled, thus a *-tests.jar is built for each module. In the second module, I have defined a dependency to first's tests jar:
{noformat}
<dependency>
<groupId>me</groupId>
<artifactId>first</artifactId>
<classifier>tests</classifier>
<version>1.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
{noformat}
And here's the problem: A class in the second main folder imports a class from the first test folder. If I build the second module separately it builds like it should. But if I build both modules from the root module I get a compilation failure:
{noformat}
/.../root/second/src/main/java/me/SecondMain.java:[3,10] cannot find symbol
symbol : class FirstTest
location: package me
{noformat}
A class in second's test folder also includes me.FirstTest, and it always compiles. The scope somehow seems to be overridden when doing multi module builds.
--
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
[jira] Updated: (MNG-4032) Test jar dependency not available for
for main classes in multi module builds
Posted by "Brett Porter (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MNG-4032?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Brett Porter updated MNG-4032:
------------------------------
Fix Version/s: (was: 2.1.0)
> Test jar dependency not available for for main classes in multi module builds
> -----------------------------------------------------------------------------
>
> Key: MNG-4032
> URL: http://jira.codehaus.org/browse/MNG-4032
> Project: Maven 2
> Issue Type: Bug
> Components: Bootstrap & Build, Class Loading, Dependencies, Inheritance and Interpolation
> Affects Versions: 2.0.9, 2.1.0-M1
> Environment: MacOSX, Linux
> Reporter: Henrik Brautaset Aronsen
> Assignee: John Casey
> Attachments: tests-dependency.zip
>
>
> I have a module layout like this:
> {noformat}
> root -+- first
> +- second
> {noformat}
> I have the test-jar plugin enabled, thus a *-tests.jar is built for each module. In the second module, I have defined a dependency to first's tests jar:
> {noformat}
> <dependency>
> <groupId>me</groupId>
> <artifactId>first</artifactId>
> <classifier>tests</classifier>
> <version>1.0-SNAPSHOT</version>
> <scope>compile</scope>
> </dependency>
> {noformat}
> And here's the problem: A class in the second main folder imports a class from the first test folder. If I build the second module separately it builds like it should. But if I build both modules from the root module I get a compilation failure:
> {noformat}
> /.../root/second/src/main/java/me/SecondMain.java:[3,10] cannot find symbol
> symbol : class FirstTest
> location: package me
> {noformat}
> A class in second's test folder also includes me.FirstTest, and it always compiles. The scope somehow seems to be overridden when doing multi module builds.
--
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
[jira] Closed: (MNG-4032) Test jar dependency not available for for
main classes in multi module builds
Posted by "John Casey (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MNG-4032?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
John Casey closed MNG-4032.
---------------------------
Assignee: John Casey
Resolution: Duplicate
Fix Version/s: 2.1.0
See integration test for MNG-2720. It actually reproduces this exact use case.
http://svn.apache.org/repos/asf/maven/core-integration-testing/trunk/core-it-suite/src/test/resources/mng-2720
> Test jar dependency not available for for main classes in multi module builds
> -----------------------------------------------------------------------------
>
> Key: MNG-4032
> URL: http://jira.codehaus.org/browse/MNG-4032
> Project: Maven 2
> Issue Type: Bug
> Components: Bootstrap & Build, Class Loading, Dependencies, Inheritance and Interpolation
> Affects Versions: 2.0.9, 2.1.0-M1
> Environment: MacOSX, Linux
> Reporter: Henrik Brautaset Aronsen
> Assignee: John Casey
> Fix For: 2.1.0
>
> Attachments: tests-dependency.zip
>
>
> I have a module layout like this:
> {noformat}
> root -+- first
> +- second
> {noformat}
> I have the test-jar plugin enabled, thus a *-tests.jar is built for each module. In the second module, I have defined a dependency to first's tests jar:
> {noformat}
> <dependency>
> <groupId>me</groupId>
> <artifactId>first</artifactId>
> <classifier>tests</classifier>
> <version>1.0-SNAPSHOT</version>
> <scope>compile</scope>
> </dependency>
> {noformat}
> And here's the problem: A class in the second main folder imports a class from the first test folder. If I build the second module separately it builds like it should. But if I build both modules from the root module I get a compilation failure:
> {noformat}
> /.../root/second/src/main/java/me/SecondMain.java:[3,10] cannot find symbol
> symbol : class FirstTest
> location: package me
> {noformat}
> A class in second's test folder also includes me.FirstTest, and it always compiles. The scope somehow seems to be overridden when doing multi module builds.
--
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
[jira] Commented: (MNG-4032) Test jar dependency not available for
for main classes in multi module builds
Posted by "Henrik Brautaset Aronsen (JIRA)" <ji...@codehaus.org>.
[ http://jira.codehaus.org/browse/MNG-4032?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=165339#action_165339 ]
Henrik Brautaset Aronsen commented on MNG-4032:
-----------------------------------------------
Thanks for the updates. As mentioned in the linked issues, this issue is fixable by replacing <classifier>tests</classifier> with <type>test-jar</type>. Just in case anyone else who has this problem sees this issue...
> Test jar dependency not available for for main classes in multi module builds
> -----------------------------------------------------------------------------
>
> Key: MNG-4032
> URL: http://jira.codehaus.org/browse/MNG-4032
> Project: Maven 2
> Issue Type: Bug
> Components: Bootstrap & Build, Class Loading, Dependencies, Inheritance and Interpolation
> Affects Versions: 2.0.9, 2.1.0-M1
> Environment: MacOSX, Linux
> Reporter: Henrik Brautaset Aronsen
> Assignee: John Casey
> Fix For: 2.1.0
>
> Attachments: tests-dependency.zip
>
>
> I have a module layout like this:
> {noformat}
> root -+- first
> +- second
> {noformat}
> I have the test-jar plugin enabled, thus a *-tests.jar is built for each module. In the second module, I have defined a dependency to first's tests jar:
> {noformat}
> <dependency>
> <groupId>me</groupId>
> <artifactId>first</artifactId>
> <classifier>tests</classifier>
> <version>1.0-SNAPSHOT</version>
> <scope>compile</scope>
> </dependency>
> {noformat}
> And here's the problem: A class in the second main folder imports a class from the first test folder. If I build the second module separately it builds like it should. But if I build both modules from the root module I get a compilation failure:
> {noformat}
> /.../root/second/src/main/java/me/SecondMain.java:[3,10] cannot find symbol
> symbol : class FirstTest
> location: package me
> {noformat}
> A class in second's test folder also includes me.FirstTest, and it always compiles. The scope somehow seems to be overridden when doing multi module builds.
--
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