maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lin Zhu <lin.x....@verizonbusiness.com>
Subject Re: ClassCastException using maven-script-ant and maven-ant-tasks
Date Sat, 01 Mar 2008 15:13:11 GMT
I'm using 2.0.8. Anything wrong with it?

Thanks,

-lin

On Fri, 2008-02-29 at 17:41 -0500, Martin Gainty wrote:
> check your pom.xml for version you are using for Maven Ant Mojo Support
> 
>   <modelVersion>4.0.0</modelVersion>
>   <artifactId>maven-script-ant</artifactId>
>   <name>Maven Ant Mojo Support</name>
> 
> Martin-
> 
> ----- Original Message -----
> From: "Lin Zhu" <lin.x.zhu@verizonbusiness.com>
> To: "Maven Users List" <users@maven.apache.org>
> Sent: Friday, February 29, 2008 4:29 PM
> Subject: ClassCastException using maven-script-ant and maven-ant-tasks
> 
> 
> Hi,
> 
> Following the example at
> http://maven.apache.org/guides/plugin/guide-ant-plugin-development.html
> on how to write maven plugin using ant.  I successfully created a hello
> plugin. But now I'd like to add dependency management in my ant
> build.xml by including maven-ant-tasks as a dependency in my pom:
> 
> <project>
>     <modelVersion>4.0.0</modelVersion>
>     <groupId>org.myproject.plugins</groupId>
>     <artifactId>hello-plugin</artifactId>
>     <packaging>maven-plugin</packaging>
>     <version>1.0-SNAPSHOT</version>
>     <dependencies>
>         <dependency>
>             <groupId>org.apache.maven</groupId>
>             <artifactId>maven-script-ant</artifactId>
>             <version>2.0.8</version>
>         </dependency>
>         <dependency>
>             <groupId>org.apache.maven</groupId>
>             <artifactId>maven-ant-tasks</artifactId>
>             <version>2.0.8</version>
>         </dependency>
>     </dependencies>
>     <build>
>         <plugins>
>             <plugin>
>                 <artifactId>maven-plugin-plugin</artifactId>
>                 <dependencies>
>                     <dependency>
>                         <groupId>org.apache.maven</groupId>
>                         <artifactId>maven-plugin-tools-ant</artifactId>
>                         <version>2.0.8</version>
>                     </dependency>
>                 </dependencies>
>             </plugin>
>         </plugins>
>     </build>
> </project>
> 
> The plugin builds fine. But when trying to run it, it's throwing a
> ClassCastException. Is anyone using both maven-script-ant and
> maven-ant-tasks together successfully? Here's the stacktrace:
> 
> java.lang.ClassCastException:
> org.apache.maven.script.ant.AntMojoComponentFactory
> at
> org.codehaus.plexus.component.factory.DefaultComponentFactoryManager.findCom
> ponentFactory(DefaultComponentFactoryManager.java:68)
> at
> org.codehaus.plexus.DefaultPlexusContainer.createComponentInstance(DefaultPl
> exusContainer.java:1457)
> at
> org.codehaus.plexus.component.manager.AbstractComponentManager.createCompone
> ntInstance(AbstractComponentManager.java:93)
> at
> org.codehaus.plexus.component.manager.PerLookupComponentManager.getComponent
> (PerLookupComponentManager.java:48)
> at
> org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.jav
> a:331)
> at
> org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.jav
> a:440)
> at
> org.apache.maven.plugin.DefaultPluginManager.getConfiguredMojo(DefaultPlugin
> Manager.java:566)
> at
> org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManage
> r.java:425)
> at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLife
> cycleExecutor.java:539)
> at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(De
> faultLifecycleExecutor.java:493)
> at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifec
> ycleExecutor.java:463)
> at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFail
> ures(DefaultLifecycleExecutor.java:311)
> at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(Defa
> ultLifecycleExecutor.java:278)
> at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycle
> Executor.java:143)
> at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:333)
> at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:126)
> at org.apache.maven.cli.MavenCli.main(MavenCli.java:282)
> 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:585)
> 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)
> 
> -
> Lin Zhu
> lin.x.zhu@verizonbusiness.com
> Verizon Business Information Technology
> Office: 617-535-0332
> Vnet:   9140332
> 
> Verizon Business – global capability. personal accountability.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Mime
View raw message