Details
-
Type:
Bug
-
Status:
Open
-
Priority:
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:
- 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:
<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