[ http://jira.codehaus.org/browse/MANTRUN-59?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_103449 ]
Kapil Anand edited comment on MANTRUN-59 at 7/27/07 10:48 AM: -------------------------------------------------------------- This could be categorized as a critical bug, considering that most of the mojo plugins available do not use the latest version of tools. So if someone needs to use the latest version of a tool, antrun is the only option which becomes restricted to ant's inbuilt tasks without this fix. classpath ref is not working with taskdef although it prints fine with echo, however I was able to make the following work with typedef: <path id="maven-ant-tasks.classpath" path="${settings.localRepository}/org/apache/maven/maven-artifact-ant/${maven-artifact-ant.version}/maven-ant-tasks-${maven-artifact-ant.version}.jar"/> <typedef resource="org/apache/maven/artifact/ant/antlib.xml" classpathref="maven-ant-tasks.classpath" /> That is I was able to call "pom", "install" and "deploy" tasks. maven-artifact-antlib was added as a dependency of the antrun plugin was: This could be categorized as a critical bug, considering that most of the mojo plugins available do not use the latest version of tools. So if someone needs to use the latest version of a tool, antrun is the only option which becomes restricted to ant's inbuilt tasks without this fix. classpath ref is not working with taskdef although it prints fine with echo, however I was able to make the following work: <path id="maven-ant-tasks.classpath" path="${settings.localRepository}/org/apache/maven/maven-artifact-ant/${maven-artifact-ant.version}/maven-ant-tasks-${maven-artifact-ant.version}.jar"/> <typedef resource="org/apache/maven/artifact/ant/antlib.xml" classpathref="maven-ant-tasks.classpath" /> That is I was able to call "pom", "install" and "deploy" tasks. maven-artifact-antlib was added as a dependency of the antrun plugin > Taskdef/Typedef and Plugin dependencies > --------------------------------------- > > Key: MANTRUN-59 > URL: http://jira.codehaus.org/browse/MANTRUN-59 > Project: Maven 2.x Antrun Plugin > Issue Type: Bug > Affects Versions: 1.1 > Reporter: ttest > > I'm trying to run an ant task during a Maven run. The classes for that Ant > task are included in my Maven runtime dependencies(maven.runtime.classpath). > Here the relevant snippet from my POM: > <tasks> > <path id="my.maven.runtime.classpath"> > <path refid="maven.runtime.classpath"/> > </path> > > <taskdef name="mostGenerator" > classname="com.bmw.most.generator.AntTask" > classpathref="maven.runtime.classpath"/> > > <mostGenerator configurationFile="mostGenerator.configuration" > targetDirectory="target/generated-sources/most"/> > </tasks> > This works if I don't provide depedencies in the POM for my plugin. But if I > do provide depedencies it doesn't work. I consider this to be a bug since > that should have no effect on the behaviour of "maven.runtime.classpath". My > first guess is that this is a classloading issue. Probably by providing > dependencies the classloaders get messed up and that causes the taskdef to > not load the classes from maven.runtime.classpath because echoing the value > of maven.runtime.classpath still gives the right classpath. > I have tried all variants of dereferencing maven.runtime.classpath. Didn't > work. > Also which is very interesting if I hardcode the classpath in the taskdef to > absolute pathnames it also does not work. -- 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