maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Arturas Gusevas (JIRA)" <j...@codehaus.org>
Subject [jira] Commented: (MANTTASKS-203) java.lang.ClassCastException: org.codehaus.plexus.DefaultPlexusContainer cannot be cast to org.codehaus.plexus.PlexusContainer
Date Sat, 18 Dec 2010 12:20:58 GMT

    [ http://jira.codehaus.org/browse/MANTTASKS-203?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=248964#action_248964
] 

Arturas Gusevas commented on MANTTASKS-203:
-------------------------------------------

I had the same issue. The problem occurs, when mvn-init target will be called twice. You can
solve it using the "unless" attribute. For example:

{code:xml}
<target name="mvn-init" unless="mvn-init.called">
    <path id="maven-ant-tasks.classpath" path="maven-ant-tasks-2.1.1.jar"/>
    <typedef resource="org/apache/maven/artifact/ant/antlib.xml" uri="antlib:org.apache.maven.artifact.ant"
classpathref="maven-ant-tasks.classpath"/>
    <artifact:dependencies pathId="application.jars" filesetId="dependency.fileset" versionsId="dependency.versions">
        <dependency groupId="javax.servlet" artifactId="servlet-api" version="2.4" scope="provided"/>
    </artifact:dependencies>
    
    <property name="mvn-init.called" value="true" />
</target>

<target name="test" depends="mvn-init"></target>
<target name="test2" depends="mvn-init"></target>
{code}

> java.lang.ClassCastException: org.codehaus.plexus.DefaultPlexusContainer cannot be cast
to org.codehaus.plexus.PlexusContainer
> ------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: MANTTASKS-203
>                 URL: http://jira.codehaus.org/browse/MANTTASKS-203
>             Project: Maven 2.x Ant Tasks
>          Issue Type: Bug
>          Components: dependencies task
>    Affects Versions: 2.1.0, 2.1.1
>         Environment: Apache Ant version 1.8.1
> Linux
> java version "1.6.0_21"
> Java(TM) SE Runtime Environment (build 1.6.0_21-b06)
> Java HotSpot(TM) 64-Bit Server VM (build 17.0-b16, mixed mode)
>            Reporter: Thomas Scheffler
>            Priority: Critical
>         Attachments: build.xml
>
>
> Running "ant test test2" for the submitted test results in a ClassCastException:
> java.lang.ClassCastException: org.codehaus.plexus.DefaultPlexusContainer cannot be cast
to org.codehaus.plexus.PlexusContainer
>         at org.apache.maven.artifact.ant.AbstractArtifactTask.getContainer(AbstractArtifactTask.java:481)
>         at org.apache.maven.artifact.ant.AbstractArtifactTask.lookup(AbstractArtifactTask.java:456)
>         at org.apache.maven.artifact.ant.AbstractArtifactTask.initSettings(AbstractArtifactTask.java:289)
>         at org.apache.maven.artifact.ant.AbstractArtifactTask.execute(AbstractArtifactTask.java:717)
>         at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
>         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.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
>         at org.apache.tools.ant.Task.perform(Task.java:348)
>         at org.apache.tools.ant.Target.execute(Target.java:390)
>         at org.apache.tools.ant.Target.performTasks(Target.java:411)
>         at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1397)
>         at org.apache.tools.ant.Project.executeTarget(Project.java:1366)
>         at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
>         at org.apache.tools.ant.Project.executeTargets(Project.java:1249)
>         at org.apache.tools.ant.Main.runBuild(Main.java:801)
>         at org.apache.tools.ant.Main.startAnt(Main.java:218)
>         at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
>         at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message