Description of problem:
Building with ant and maven-ant-tasks throws several ClassNotFoundExceptions
Version-Release number of selected component (if applicable):
Run a build.xml which invokes a <artifact:> task
/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
Build runs succesfully
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/plexus-classwords (containing "plexus/classworlds")
but at some point i get:
/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
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."
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
So, can this be closed?
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.
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.
Will do. Looks like I may have to retire this package completely and I'm not sure I can build it anymore.