Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Cannot Reproduce
-
Affects Version/s: 2.0.9
-
Fix Version/s: None
-
Component/s: Dependencies
-
Labels:None
-
Environment:Maven version: 2.0.9
Java version: 1.5.0_13
OS name: "mac os x" version: "10.5.4" arch: "ppc" Family: "unix"
-
Complexity:Intermediate
Description
When an attempt is made to override the version of torque-templates used by the maven-torque-plugin as below, maven still tries to use the original version of the torque-templates jar. The overridden jar is ignored.
According to http://jira.codehaus.org/browse/MNG-2972, this behaviour used to be broken in maven v2.0.8 and earlier, and was apparently fixed. This doesn't seem to be the case though.
The configuration looks like this:
<plugin> <groupId>org.apache.torque</groupId> <artifactId>torque-maven-plugin</artifactId> <version>3.3</version> <dependencies> <dependency> <groupId>org.apache.derby</groupId> <artifactId>derby</artifactId> <version>10.4.1.3</version> </dependency> <dependency> <groupId>org.apache.torque</groupId> <artifactId>torque-templates</artifactId> <version>3.3.1</version> </dependency> </dependencies> </plugin>
The original torque-templates jar is v3.3. The overridden torque-templates jar is v3.3.1.
As the plugin gives no clues as to which version is being used, I deleted the original torque-templates v3.3 release from the local repository. What I expected to see was maven ignoring the v3.3 jar and using the v3.3.1 jar instead, but maven tries to re-download the v3.3 release and use it instead.
maven-torque-plugin depends on torque-gen, which in turn depends on torque-templates. It may be that direct plugin dependencies can be overridden, but transitive plugin dependencies cannot be overridden.
Further testing:
If an attempt is made to make a private release of torque-generator, which depends on the private release of torque-templates (which needs to be overridden), and if the maven-torque-plugin is told to override torque-generator, the override works.
From this, it looks like it is possible to override a direct plugin dependency, but it is not possible to override a transitive plugin dependency.