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 Antrun Plugin
  • MANTRUN-61

Classloader issue with ant optional tasks in a hierarchical structure

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Duplicate
  • Affects Version/s: 1.1
  • Fix Version/s: None
  • Labels:
    None
  • Environment:
    Windows XP Pro

Description

I have a classloading issue with ant optional tasks which I've imported via ant-nodeps-1.6.5.jar.

I have a multi-module maven project with three levels of heirarchy.

1
a
i
ii
b
i
ii
2
...
...

I'm using the maven-antrun-plugin in module 1.a.i in the following manner.

<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>execution1</id>
<phase>generate-sources</phase>
<configuration>
<tasks>
<replaceregexp flags="g"
file="${file}"
match="${match}"
replace="${replace}"/>
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>ant</groupId>
<artifactId>ant-nodeps</artifactId>
<version>${ant-nodeps.ver}</version>
</dependency>
<dependency>
<groupId>jakarta-regexp</groupId>
<artifactId>jakarta-regexp</artifactId>
<version>${jakarta-regexp.ver}</version>
</dependency>
<dependency>
<groupId>ant</groupId>
<artifactId>ant-jakarta-regexp</artifactId>
<version>${ant-jakarta-regexp.ver}</version>
</dependency>
</dependencies>
</plugin>

If I cd to the the 1.a.i directory, and execute mvn generate-sources, all is fine. But if I execute the same command from either 1 or 1.a, I get the following error:

Embedded error: Could not create task or type of type: replaceregexp.

Ant could not find the task or a class this task relies upon.

This is common and has a number of causes; the usual
solutions are to read the manual pages then download and
install needed JAR files, or fix the build file:

  • You have misspelt 'replaceregexp'.
    ...blah blah blah

Now this is because it can't find the classes in the ant-nodeps, jakarta-regexp and ant-jakarta-regexp jars even though they are explicitly declared in the dependencies for the plugin.

I messed around with the <classloader>root</classloader> variable by specifying it in the pom but that didn't go anywhere. I've also tried to declare the dependencies as part of the pom rather than the plugin but with no success.

I'm following the instructions here (Using optional ant tasks).

http://maven.apache.org/plugins/maven-antrun-plugin/classpaths.html

Issue Links

duplicates

Bug - A problem which impairs or prevents the functions of the product. MNG-1323 Plugin extensions (dependencies) not resolved in reactor build

  • Major - Major loss of function.
  • Closed - The issue is considered finished, the resolution is correct. Issues which are not closed can be reopened.

Activity

  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Kenney Westerhof added a comment - 13/Oct/06 10:00 AM

Duplicate of MNG-1323

Show
Kenney Westerhof added a comment - 13/Oct/06 10:00 AM Duplicate of MNG-1323

People

  • Assignee:
    Unassigned
    Reporter:
    Zarar Siddiqi
Vote (0)
Watch (0)

Dates

  • Created:
    12/Oct/06 12:41 PM
    Updated:
    13/Oct/06 10:00 AM
    Resolved:
    13/Oct/06 10:00 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.