Bug 723276 - ClassNotFoundException while building with maven-ant-tasks tasks
Summary: ClassNotFoundException while building with maven-ant-tasks tasks
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: maven-ant-tasks
Version: rawhide
Hardware: noarch
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Orion Poplawski
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-07-19 15:03 UTC by Guido Grazioli
Modified: 2012-08-10 19:30 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-08-10 19:30:05 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
maven-ant-tasks configuration in /etc/ant.d (264 bytes, text/plain)
2011-07-20 06:49 UTC, Guido Grazioli
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 798263 0 unspecified CLOSED maven-ant-tasks is incompatible with Maven 3 2021-02-22 00:41:40 UTC
Red Hat Bugzilla 817533 0 medium CLOSED Review Request: aether-ant-tasks - Ant tasks using Aether to resolve, install and deploy artifacts 2021-02-22 00:41:40 UTC

Internal Links: 798263 817533

Description Guido Grazioli 2011-07-19 15:03:05 UTC
Description of problem:
Building with ant and maven-ant-tasks throws several ClassNotFoundExceptions

Version-Release number of selected component (if applicable):
maven-ant-tasks-2.1.1-8.fc16.noarch

How reproducible:
Run a build.xml which invokes a <artifact:> task
  
Actual results:
ClassNotFoundExceptions, ie:
BUILD FAILED
/home/guido/rpmbuild/BUILD/jinput/build.xml:251: The following error occurred while executing this line:
jar:file:/home/guido/rpmbuild/BUILD/jinput/lib/maven-ant-tasks-2.1.0.jar!/org/apache/maven/artifact/ant/antlib.xml:4: taskdef A class needed by class org.apache.maven.artifact.ant.DependenciesTask cannot be found: org/codehaus/classworlds/DuplicateRealmException


Expected results:
Build runs succesfully

Additional info:
I could go a bit ahead in the build, avoiding CNFEs, creating the files:
/etc/ant.d/maven-project (containing "maven2/maven-project")
/etc/ant.d/maven-error-diagnostics ("maven2/maven-error-diagnostics")
/etc/ant.d/plexus-classwords  (containing "plexus/classworlds")
/etc/ant.d/plexus-container-default  ("plexus/container-default")
/etc/ant.d/plexus-interpolation  ("plexus/interpolation")

but at some point i get:
BUILD FAILED
/home/guido/rpmbuild/BUILD/jinput/build.xml:261: Unable to find component: org.apache.maven.artifact.manager.WagonManager

maven-ant-tasks should also get runtime requires on the packages which provide those jars

Comment 1 Alexander Kurtakov 2011-07-19 15:21:14 UTC
It seems to misunderstand the idea of the ant.d files.
you need a /etc/ant.d/maven-ant-tasks containing all the needed jars e.g. "maven2/maven-project maven2/maven-error-diagnostics plexus/classworlds plexus/container-default plexus/interpolation classworlds and etc."

Comment 2 Guido Grazioli 2011-07-20 06:49:48 UTC
Created attachment 513936 [details]
maven-ant-tasks configuration in /etc/ant.d

What Alexander says make sense, i'm attaching the configuration i used to go past the ClassNotFoundException-s. Maven task invocation still fails tough, with error: "cannot find component org.apache.mavenartifact.manager.WagonManager".

I swear if it expects a local maven repo setup with the needed dependencies; it's definitely an overkill for a task that just copies a pomfile, so i am going to do that by hand in my new package; but you can still look there if you need a test case: bug 723427

Comment 3 Orion Poplawski 2011-07-22 15:23:47 UTC
So, can this be closed?

Comment 4 Guido Grazioli 2011-07-26 15:12:41 UTC
Well, no. I could find alternative ways to build a determined package, but still maven-ant-tasks suffers from the issues reported in this bug.

Comment 5 Mikolaj Izdebski 2012-08-10 13:53:24 UTC
maven-ant-tasks isn't supposed to be used with Maven 3. Maven 3 uses a different dependency resolution engine -- Aether. With Maven 3 you would probably want to use aether-ant-tasks instead. If I were ant maintainer I would close it as WONTFIX.

Comment 6 Orion Poplawski 2012-08-10 19:30:05 UTC
Will do.  Looks like I may have to retire this package completely and I'm not sure I can build it anymore.


Note You need to log in before you can comment on or make changes to this bug.