You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Ceki Gulcu (JIRA)" <ji...@codehaus.org> on 2008/10/27 21:08:51 UTC

[jira] Commented: (MNG-2045) Maven can't compile against sibling test-jar dependency in multiproject (Test Attached)

    [ http://jira.codehaus.org/browse/MNG-2045?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=152064#action_152064 ] 

Ceki Gulcu commented on MNG-2045:
---------------------------------

I am seeing the same behavior with maven 2.0.9 when trying to build logback. See 
  http://svn.qos.ch/viewvc/logback/trunk/ if you would like to check out the project.

In this particular case, logback-classic depends on logback-core as follows:

    <dependency>
      <groupId>ch.qos.logback</groupId>
      <artifactId>logback-core</artifactId>
      <scope>compile</scope>
    </dependency>

    <dependency>
      <groupId>ch.qos.logback</groupId>
      <artifactId>logback-core</artifactId>
      <classifier>tests</classifier>
      <scope>test</scope>
    </dependency>

For a pristine installation, 'mvn package' fails with 

===================
Missing:
----------
1) ch.qos.logback:logback-core:jar:tests:0.9.10

  Try downloading the file manually from the project website.
   [snip] 

  Path to dependency:
        1) ch.qos.logback:logback-classic:jar:0.9.10
        2) ch.qos.logback:logback-core:jar:tests:0.9.10

===================

whereas 'mvn install' works fine.

The SLF4J project which I maintain suffers from the same problem. See http://svn.slf4j.org/repos/slf4j/trunk/ is you wish to check out SLF4J.


> Maven can't compile against sibling test-jar dependency in multiproject (Test Attached)
> ---------------------------------------------------------------------------------------
>
>                 Key: MNG-2045
>                 URL: http://jira.codehaus.org/browse/MNG-2045
>             Project: Maven 2
>          Issue Type: Bug
>    Affects Versions: 2.0.2
>         Environment: WinXP
>            Reporter: Brian Fox
>            Assignee: Brian Fox
>             Fix For: 2.0.8
>
>         Attachments: it1021.tar.gz, mng-2045-ittest.zip, MNG-2045-maven-project-r577340.patch1, MNG-2045-maven-project-r577340.patch2, sample.zip
>
>
> I have 2 projects under a parent like so:
> --Parent
>         --- sample-jar
>         --- sample-jar-user
> sample-jar builds and installs a test-jar along with the normal jar. sample-jar-user depends on the test-jar at compile time. When I build from the parent folder, the build fails because it can't find the class. When I go to sample-jar-user and build, it works fine.
> In the attached test case, to reproduce:
> from the root folder, run mvn clean install - See it fail.
> cd sample-jar-user; mvn clean install - see it succeed.
> I remember reading somewhere that in multiprojects, maven attempts to locate the sibling classes in the source tree instead of using the jars from the repository. I'm guessing the problem is here that it's not looking in ../sample-jar/target/test-classes for this code, but really one should expect this to come from the repository.

-- 
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