You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Jamie Whitehouse <jw...@informiam.com> on 2007/08/01 19:18:58 UTC

[MNG-3043] Allow 'mvn test' to work with test-jar dependencies in a reactor

I think this bug is related to an issue I'm currently having but I'd like to
confirm.

>From the Getting
Started<http://maven.apache.org/guides/getting-started/index.html>page
there's mention that when performing a multi-module build that "it is
not required that you run install to successfully perform these steps - you
can run package on its own and the artifacts in the reactor will be used
from the target directories instead of the local repository."

This doesn't seem to be true for dependencies on attached
tests<http://maven.apache.org/guides/mini/guide-attached-tests.html>
.

An example using the following multi-module structure:
|+POM.XML   <-- multi-module and parent pom (root)
|
|--A
|  |+POM.XML   <-- attaches tests for other projects to use
|
|--B
|  |+POM.XML
|
|--C   <-- depends on test classes from A
   |+POM.XML

Results from running at the root:
mvn clean package - project c fails stating "Failed to resolve artifact."
org.example:a:test-jar:tests:1.0.0-SNAPSHOT
mvn clean install - build successful, presumably since the test artifact was
installed prior to module 'c' being built

I know ideally the test infrastructure would be it's own project/module, but
at the moment this isn't feasible (and I assume the build would work fine
under this model).

Is there a work around for this?  Is this a manifestation of issue
MNG-3043<http://jira.codehaus.org/browse/MNG-3043>
?

Thanks,
Jamie.

Re: [MNG-3043] Allow 'mvn test' to work with test-jar dependencies in a reactor

Posted by Piotr Tabor <pt...@newitech.com>.
Hi Jamie,

Please, look at this issue: http://jira.codehaus.org/browse/MJAR-75 
(Jason  - please, look at this issue / patch)

I think that If it is applied and you  do the tests after "package" 
phase (run mvn package to fire the tests),
the test's will use the "new" jar.

Thanks,
Piotr Tabor




Jamie Whitehouse pisze:
> I think this bug is related to an issue I'm currently having but I'd like to
> confirm.
>
> From the Getting
> Started<http://maven.apache.org/guides/getting-started/index.html>page
> there's mention that when performing a multi-module build that "it is
> not required that you run install to successfully perform these steps - you
> can run package on its own and the artifacts in the reactor will be used
> from the target directories instead of the local repository."
>
> This doesn't seem to be true for dependencies on attached
> tests<http://maven.apache.org/guides/mini/guide-attached-tests.html>
> .
>
> An example using the following multi-module structure:
> |+POM.XML   <-- multi-module and parent pom (root)
> |
> |--A
> |  |+POM.XML   <-- attaches tests for other projects to use
> |
> |--B
> |  |+POM.XML
> |
> |--C   <-- depends on test classes from A
>    |+POM.XML
>
> Results from running at the root:
> mvn clean package - project c fails stating "Failed to resolve artifact."
> org.example:a:test-jar:tests:1.0.0-SNAPSHOT
> mvn clean install - build successful, presumably since the test artifact was
> installed prior to module 'c' being built
>
> I know ideally the test infrastructure would be it's own project/module, but
> at the moment this isn't feasible (and I assume the build would work fine
> under this model).
>
> Is there a work around for this?  Is this a manifestation of issue
> MNG-3043<http://jira.codehaus.org/browse/MNG-3043>
> ?
>
> Thanks,
> Jamie.
>
>   


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org