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

[jira] Created: (MDEP-186) Build classpath for dependency between modules in multiproject

Build classpath for dependency between modules in multiproject
--------------------------------------------------------------

                 Key: MDEP-186
                 URL: http://jira.codehaus.org/browse/MDEP-186
             Project: Maven 2.x Dependency Plugin
          Issue Type: Bug
          Components: build-classpath
    Affects Versions: 2.0
         Environment: * Windows XP SP3
* JDK 1.5.0_16-b02
* Maven 2.0.9
            Reporter: Petr Prochazka
            Assignee: Brian Fox
         Attachments: db-mapper-logs.zip, db-mapper.zip

I can create classpath to file in mutli project in this use case:
# Replace local repo path with prefix
## If artifacts is in my defined company group id, replace path with /KIV prefix
## Others artefacts, replace path with /EXT prefix

I using this settings of plugin:
{noformat}
      <plugin>
        <artifactId>maven-dependency-plugin</artifactId>
        <version>2.0</version>
        <executions>
          <execution>
            <id>gk-depends</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>build-classpath</goal>
            </goals>
            <configuration>
              <outputFile>${project.build.directory}/classpath/classpath-zcu.txt</outputFile>
              <localRepoProperty>/KIV</localRepoProperty>
              <includeGroupIds>cz.zcu.kiv</includeGroupIds>
            </configuration>
          </execution>
          <execution>
            <id>ext-depends</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>build-classpath</goal>
            </goals>
            <configuration>
              <outputFile>${project.build.directory}/classpath/classpath-ext.txt</outputFile>
              <localRepoProperty>/EXT</localRepoProperty>
              <excludeGroupIds>cz.zcu.kiv,junit</excludeGroupIds>
            </configuration>
          </execution>
        </executions>
        <configuration>
          <pathSeparator>:</pathSeparator>
          <outputFilterFile>true</outputFilterFile>
          <fileSeparator>/</fileSeparator>
          <regenerateFile>true</regenerateFile>
        </configuration>
      </plugin>
{noformat}
Problem is if i call goal {{package}} or {{install}}, then final path to dependency artifact is not refer to my local repository (property M2_REPO), but to artifact build localy in project directory.
For ex. have this dependency tree and module db-mapper has dependency to others modules (db-mapper-core, webkiv-db, etc.), which is in same group ID:
{noformat}
[INFO] ------------------------------------------------------------------------
[INFO] Building DB Mapper Distribution
[INFO]    task-segment: [dependency:tree]
[INFO] ------------------------------------------------------------------------
[INFO] [dependency:tree]
[INFO] cz.zcu.kiv:db-mapper:jar:0.7.3-SNAPSHOT
[INFO] +- cz.zcu.kiv:db-mapper-core:jar:0.7.3-SNAPSHOT:compile
[INFO] |  +- commons-cli:commons-cli:jar:1.1:compile
[INFO] |  +- org.springframework:spring-context:jar:2.5.5:compile
[INFO] |  |  +- aopalliance:aopalliance:jar:1.0:compile
[INFO] |  |  \- org.springframework:spring-core:jar:2.5.5:compile
[INFO] |  +- org.springframework:spring-beans:jar:2.5.5:compile
[INFO] |  +- javax.xml.bind:jaxb-api:jar:2.1:compile
[INFO] |  |  +- javax.xml.stream:stax-api:jar:1.0-2:compile
[INFO] |  |  \- javax.activation:activation:jar:1.1:compile
[INFO] |  +- javax.xml:jsr173:jar:1.0:compile
[INFO] |  +- javax.xml:jaxb-impl:jar:2.1:compile
[INFO] |  \- commons-lang:commons-lang:jar:2.4:compile
[INFO] +- cz.zcu.kiv:web-kiv-old:jar:1.0-SNAPSHOT:compile
[INFO] |  +- org.springframework:spring-jdbc:jar:2.5.5:compile
[INFO] |  |  \- org.springframework:spring-tx:jar:2.5.5:compile
[INFO] |  \- mysql:mysql-connector-java:jar:5.1.6:compile
[INFO] +- cz.zcu.kiv:webkiv-db:jar:2.14-SNAPSHOT:compile
[INFO] +- cz.zcu.kiv:webkiv-db-processing:jar:0.7.3-SNAPSHOT:compile
[INFO] +- commons-logging:commons-logging:jar:1.1.1:compile
[INFO] \- log4j:log4j:jar:1.2.15:runtime
{noformat}
and fragment of result of classpath is following:
{noformat}
[INFO] [antrun:run {execution: default}]
[INFO] Executing tasks
     [echo] D:/Projects-test/db-mapper/db-mapper-core/target/db-mapper-core-0.7.3-SNAPSHOT.jar:
D:/Projects-test/db-mapper/web-kiv-old/target/web-kiv-old-1.0-SNAPSHOT.jar:
...
/EXT/aopalliance/aopalliance/1.0/aopalliance-1.0.jar:
/EXT/commons-cli/commons-cli/1.1/commons-cli-1.1.jar:
...
{noformat}
Classpath refer to project build directory, but not to local repository :-(
Have I settings anything wrong or is it bug?

I attach simple test case with multiproject and logs in different goals (generate-sources, compile, package, generate)

Regards

Petr Prochazka

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