Maven 2.x Ant Tasks

Maven ant tasks artifact has maven inside the jar and so can't be used from inside the maven (maven-antrun-plugin) - classes do conflict

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 2.0.7
  • Fix Version/s: 2.0.10
  • Component/s: None
  • Labels:
    None
  • Environment:
    Linux
  • Number of attachments :
    0

Description

I've previously used maven-artifact-ant that is not updated since 2.0.4. Now I need a new (2.0.6) feature - to attach additional source and javadoc jar's from install task.
I've tried to use maven-ant-tasks 2.0.7 but failed.
It gives me
java.lang.ClassCastException: org.codehaus.plexus.component.configurator.BasicComponentConfigurator cannot be cast to org.codehaus.plexus.component.configurator.ComponentConfigurator
at org.codehaus.plexus.personality.plexus.lifecycle.phase.AutoConfigurePhase.execute(AutoConfigurePhase.java:34)
at org.codehaus.plexus.lifecycle.AbstractLifecycleHandler.start(AbstractLifecycleHandler.java:101)
at org.codehaus.plexus.component.manager.AbstractComponentManager.startComponentLifecycle(AbstractComponentManager.java:105)
at org.codehaus.plexus.component.manager.AbstractComponentManager.createComponentInstance(AbstractComponentManager.java:95)
at org.codehaus.plexus.component.manager.PerLookupComponentManager.getComponent(PerLookupComponentManager.java:48)
at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:331)
at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:440)
at org.apache.maven.plugin.DefaultPluginManager.getConfiguredMojo(DefaultPluginManager.java:562)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:421)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:539)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:480)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:459)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:311)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:278)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:143)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:334)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:125)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:280)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)

Looking at the jar, I can see that it contains (unlike to maven-artifact-ant) a lot of code not related to ant tasks itself inside it. I suppose this classes clashes with the "parent" maven classes.
I suppose this to be a bug, because even if you wish to depend on maven code, you must provide it with dependency mechanism in maven artifact (so that it could be disabled) and not with including additional classes into the jar.

Activity

Hide
Paul Gier added a comment -

This appears to be fixed by removing the relocation configuration of the shade plugin and leaving the maven components with their original package names r770840.

I will wait for any responses on the dev list before closing the issue, to make sure this doesn't break something else.

Show
Paul Gier added a comment - This appears to be fixed by removing the relocation configuration of the shade plugin and leaving the maven components with their original package names r770840. I will wait for any responses on the dev list before closing the issue, to make sure this doesn't break something else.
Hide
Paul Gier added a comment -

As suggested on the dev list, I changed the relocationPattern to avoid conflicts with other packages brought in by maven.
Fixed in r772326

Show
Paul Gier added a comment - As suggested on the dev list, I changed the relocationPattern to avoid conflicts with other packages brought in by maven. Fixed in r772326

People

Vote (5)
Watch (6)

Dates

  • Created:
    Updated:
    Resolved: