Maven 2 & 3

Ant 1.7.0 Task not found after upgrading from Maven 2.0.8 to 2.0.9

Details

  • Complexity:
    Intermediate
  • Testcase included:
    yes
  • Number of attachments :
    3

Description

Apache Commons has a maven ant plugin (called commons-build-plugin[1]) which has a dependency on Ant 1.7.0 and uses the loadresource task (which was added to Ant in version 1.7.0). The plugin works fine for maven 2.0.8, but after upgrading to 2.0.9 fails with the message "Could not create task or type of type: loadresource." (see attached output).

This has been raised on the maven dev list in the following thread:
http://markmail.org/message/tv37c37fjyzx6l6k

I am attaching a simple pom.xml that reproduces this problem with the following command:
mvn commons:jira-page

(N.B. create either a "xdocs" or "src/xdoc" directory in the project)

[1] http://svn.apache.org/viewvc/commons/proper/commons-build-plugin/tags/commons-build-plugin-1.0/

  1. mvn-2.0.8-output.txt
    30/Jun/08 7:19 AM
    8 kB
    Niall Pemberton
  2. mvn-2.0.9-output.txt
    30/Jun/08 7:19 AM
    15 kB
    Niall Pemberton
  3. pom.xml
    30/Jun/08 7:19 AM
    1 kB
    Niall Pemberton

Activity

Hide
John Casey added a comment -

Pushing to 2.0.11 so we can have a smaller set of high-value issues to target for the next release (2.0.10).

Show
John Casey added a comment - Pushing to 2.0.11 so we can have a smaller set of high-value issues to target for the next release (2.0.10).
Hide
Brian Fox added a comment -

John, this looks like a possible regression introduced in 2.0.9, as such, we should take another look for 2.0.10

Show
Brian Fox added a comment - John, this looks like a possible regression introduced in 2.0.9, as such, we should take another look for 2.0.10
Hide
Niall Pemberton added a comment -

Dennis Lundberg just made a change to the plugin's pom[1] for another issue[2] and this seems to have resolved the problem with maven 2.0.9. I guess adding the <exclusion> for ant's old groupid sorted it out, although I still don't know why it worked without the exclusion for maven 2.0.8

I leave it up to you to decide whether theres any issue left here to resolve - if not, then my apologies.

[1] http://svn.apache.org/viewvc?view=rev&revision=676039
[2] https://issues.apache.org/jira/browse/COMMONSSITE-35

Show
Niall Pemberton added a comment - Dennis Lundberg just made a change to the plugin's pom[1] for another issue[2] and this seems to have resolved the problem with maven 2.0.9. I guess adding the <exclusion> for ant's old groupid sorted it out, although I still don't know why it worked without the exclusion for maven 2.0.8 I leave it up to you to decide whether theres any issue left here to resolve - if not, then my apologies. [1] http://svn.apache.org/viewvc?view=rev&revision=676039 [2] https://issues.apache.org/jira/browse/COMMONSSITE-35
Hide
Dennis Lundberg added a comment -

For the record, running the commons-plugin failed for me on Windows using Maven 2.0.8. I got the same error message then, that Niall got when he ran with Maven 2.0.9. This was before I added the exclusions, but after I upgraded to Ant 1.7.1.

Show
Dennis Lundberg added a comment - For the record, running the commons-plugin failed for me on Windows using Maven 2.0.8. I got the same error message then, that Niall got when he ran with Maven 2.0.9. This was before I added the exclusions, but after I upgraded to Ant 1.7.1.
Hide
John Casey added a comment -

it looks like it's grabbing the ant 1.6.5 dependency - a 3rd-level transitive dependency from maven-script-ant - instead of the direct dep on ant 1.7.0, apparently because maven-script-ant is listed first. I'll have to check on the nearest-wins conflict resolution mechanism to make sure it's working

Show
John Casey added a comment - it looks like it's grabbing the ant 1.6.5 dependency - a 3rd-level transitive dependency from maven-script-ant - instead of the direct dep on ant 1.7.0, apparently because maven-script-ant is listed first. I'll have to check on the nearest-wins conflict resolution mechanism to make sure it's working
Hide
John Casey added a comment -

whoops, you're right, the conflict resolution isn't happening because of the groupId change...we may need to look into a relocation for ant or something...

Show
John Casey added a comment - whoops, you're right, the conflict resolution isn't happening because of the groupId change...we may need to look into a relocation for ant or something...
Hide
John Casey added a comment -

I've added org.apache.ant dependencies to maven-script-ant (since plexus-ant-factory seems like it's moved on to maven-2.1 compatibility), and excluded the 'ant' groupId from plexus-ant-factory.

To fix the commons-build-plugin executions, you'll need to wait until maven 2.0.10 comes out, then upgrade the dependency on maven-script-ant to 2.0.10, and re-release the plugin. At this point, you should still be able to use the plugin from other versions of maven, I'm about 95% sure.

Either you can update your own pom to use this dependency/exclude pattern, or you can update to a new dependency version on maven-script-ant...in either case, you will need to re-release the plugin. This is because there is no logical bridge in place for maven to match 'ant' == 'org.apache.ant'.

Show
John Casey added a comment - I've added org.apache.ant dependencies to maven-script-ant (since plexus-ant-factory seems like it's moved on to maven-2.1 compatibility), and excluded the 'ant' groupId from plexus-ant-factory. To fix the commons-build-plugin executions, you'll need to wait until maven 2.0.10 comes out, then upgrade the dependency on maven-script-ant to 2.0.10, and re-release the plugin. At this point, you should still be able to use the plugin from other versions of maven, I'm about 95% sure. Either you can update your own pom to use this dependency/exclude pattern, or you can update to a new dependency version on maven-script-ant...in either case, you will need to re-release the plugin. This is because there is no logical bridge in place for maven to match 'ant' == 'org.apache.ant'.
Hide
Niall Pemberton added a comment - - edited

Thanks, we just released a new version (1.1) of the plugin using the dependency/exclude pattern:

http://repo1.maven.org/maven2/org/apache/commons/commons-build-plugin/1.1/

Show
Niall Pemberton added a comment - - edited Thanks, we just released a new version (1.1) of the plugin using the dependency/exclude pattern: http://repo1.maven.org/maven2/org/apache/commons/commons-build-plugin/1.1/
Hide
John Casey added a comment -

plugin in question has been released with its own exclusions for old ant artifacts.

Show
John Casey added a comment - plugin in question has been released with its own exclusions for old ant artifacts.
Hide
John Casey added a comment -

Adding fix-for for both 2.0.10 and 2.1.0-M1, since 2.1.0-M1 will actually be released first and may not incorporate all of the eventual issue fixes released in 2.0.10.

Show
John Casey added a comment - Adding fix-for for both 2.0.10 and 2.1.0-M1, since 2.1.0-M1 will actually be released first and may not incorporate all of the eventual issue fixes released in 2.0.10.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: