Hi,

I have two modules (A and B) in a multi-module project, B depending on
A. The tests in B want to use the test classes defined in A, so did
what is described here:
http://maven.apache.org/guides/mini/guide-attached-tests.html . This
way the test classes from project A get deployed to our company Nexus,
along with all the rest of the artifacts. This is done by Hudson in
the night.

My problem is with site generation. I have a separate nightly build
that builds the site, and it fails with an error that it is not able
to find the A-tests.jar dependency. In the site build I have tests
disabled (-Dmaven.test.skip).

[INFO] snapshot com.example:A:1.0-SNAPSHOT: checking for updates from central
Downloading: 
http://nexus/nexus/content/groups/public/com/example/A/1.0-SNAPSHOT/A-1.0-SNAPSHOT-tests.jar
[INFO] Unable to find resource
'com.example:A:test-jar:tests:1.0-SNAPSHOT' in repository central
(http://central)
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Failed to resolve artifact.

Missing:
----------
1) com.example:A:test-jar:tests:1.0-SNAPSHOT

  Try downloading the file manually from the project website.

  Then, install it using the command:
      mvn install:install-file -DgroupId=com.example -DartifactId=A
-Dversion=1.0-SNAPSHOT -Dclassifier=tests -Dpackaging=test-jar
-Dfile=/path/to/file

  Alternatively, if you host your own repository you can deploy the file there:
      mvn deploy:deploy-file -DgroupId=com.example -DartifactId=A
-Dversion=1.0-SNAPSHOT -Dclassifier=tests -Dpackaging=test-jar
-Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]

  Path to dependency:
        1) com.example:B:jar:1.0-SNAPSHOT
        2) com.example:A:test-jar:tests:1.0-SNAPSHOT

----------
1 required artifact is missing.

for artifact:
  com.example:B:jar:1.0-SNAPSHOT

from the specified remote repositories:
  nexus (http://nexus/nexus/content/groups/public)

In Nexus I have the following file:
http://nexus/nexus/content/repositories/snapshots/com/example/A/1.0-SNAPSHOT/A-1.0-20100614.220522-105-tests.jar

The problem I think comes from the fact that my site build has the
tests switched off, so the test classes are not compiled in the
reactor. Yet Maven wants to download the test dependencies.

I wonder why it tries that, since it won't need them, and also why it
fails to do it. Is this a known issue? Is there a workaround for it?

BTW, I'm using Maven 2.2.1.

-- 
Regards,
Lóránt

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to