jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • Maven 2.x Dependency Plugin
  • MDEP-186

Build classpath for dependency between modules in multiproject

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Open Open
  • Priority: Major Major
  • Resolution: Unresolved
  • Affects Version/s: 2.0
  • Fix Version/s: None
  • Component/s: build-classpath
  • Labels:
    None
  • Environment:
    * Windows XP SP3
    * JDK 1.5.0_16-b02
    * Maven 2.0.9

Description

I can create classpath to file in mutli project in this use case:

  1. Replace local repo path with prefix
    1. If artifacts is in my defined company group id, replace path with /KIV prefix
    2. Others artefacts, replace path with /EXT prefix

I using this settings of plugin:

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

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:

[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

and fragment of result of classpath is following:

[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:
...

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

  • Options
    • Sort By Name
    • Sort By Date
    • Ascending
    • Descending
    • Download All

Attachments

  1. Hide
    Zip Archive
    db-mapper.zip
    05/Nov/08 3:42 AM
    5 kB
    Petr Prochazka
    1. XML File
      db-mapper/db-mapper/pom.xml 1 kB
    2. XML File
      db-mapper/db-mapper-core/pom.xml 2 kB
    3. XML File
      db-mapper/pom.xml 5 kB
    4. XML File
      db-mapper/web-kiv-old/pom.xml 1 kB
    5. XML File
      db-mapper/webkiv-db/pom.xml 1 kB
    6. XML File
      db-mapper/webkiv-db-processing/pom.xml 1 kB
    Download Zip
    Show
    Zip Archive
    db-mapper.zip
    05/Nov/08 3:42 AM
    5 kB
    Petr Prochazka
  2. Hide
    Zip Archive
    db-mapper-logs.zip
    05/Nov/08 3:42 AM
    5 kB
    Petr Prochazka
    1. Text File
      mvn_compile.log 10 kB
    2. Text File
      mvn_generate-sources.log 10 kB
    3. Text File
      mvn_install.log 13 kB
    4. Text File
      mvn_package.log 12 kB
    Download Zip
    Show
    Zip Archive
    db-mapper-logs.zip
    05/Nov/08 3:42 AM
    5 kB
    Petr Prochazka

Activity

  • All
  • Comments
  • Work Log
  • History
  • Activity
There are no comments yet on this issue.

People

  • Assignee:
    Brian Fox
    Reporter:
    Petr Prochazka
Vote (0)
Watch (0)

Dates

  • Created:
    05/Nov/08 3:42 AM
    Updated:
    05/Nov/08 3:42 AM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.