You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by depstei2 <de...@umd.edu> on 2009/09/23 23:22:29 UTC

Developing Ant Plugins problems

Hi, I'm trying to use this guide
http://maven.apache.org/guides/plugin/guide-ant-plugin-development.html

and I am running into some issues.

1 - I can't get the maven classpath passed into ant.  I've seen several
unanswered questions about this very issue.  I saw something about switching
to 2.1 of the maven-script-ant to fix this, but when I try that I get:

java.lang.LinkageError: loader constraint violation: loader (instance of
org/codehaus/classworlds/RealmClassLoader) previously initiated loading for
a different type with name
"org/codehaus/plexus/component/repository/ComponentDescriptor"

2 - I cant seem to find any documentation about the mojos.xml file
format/schema.  Does this exist anywhere?

3 - The maven plugin-plugin has been updated to 2.5 although the example in
the documentation has 2.3.  When I update to 2.5 I get:

"The API of the mojo scanner is not compatible with this plugin version.
Please check the plugin dependencies configured in the POM and ensure the
versions match."

I'm not sure what that message means, or how to go about fixing it.

Hopefully someone out there has the answers, I would very much like to use
this plugin.
-- 
View this message in context: http://www.nabble.com/Developing-Ant-Plugins-problems-tp25531301p25531301.html
Sent from the Maven - Users mailing list archive at Nabble.com.


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


Re: Developing Ant Plugins problems

Posted by depstei2 <de...@umd.edu>.
Thanks for your reply, that lets me use the 2.0.10 maven-script-ant, but I am
still unable to use the maven maven.compile.classpath in my ant scripts. 
How should this be done? 

I tried referencing it outright in my ant script, as well as configuring it
as a parameter and setting the default value to ${maven.compile.classpath}
in the mojo
-- 
View this message in context: http://www.nabble.com/Developing-Ant-Plugins-problems-tp25531301p25590678.html
Sent from the Maven - Users mailing list archive at Nabble.com.


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


Re: Developing Ant Plugins problems

Posted by Dennis Lundberg <de...@apache.org>.
depstei2 wrote:
> Hi, I'm trying to use this guide
> http://maven.apache.org/guides/plugin/guide-ant-plugin-development.html
> 
> and I am running into some issues.
> 
> 1 - I can't get the maven classpath passed into ant.  I've seen several
> unanswered questions about this very issue.  I saw something about switching
> to 2.1 of the maven-script-ant to fix this, but when I try that I get:
> 
> java.lang.LinkageError: loader constraint violation: loader (instance of
> org/codehaus/classworlds/RealmClassLoader) previously initiated loading for
> a different type with name
> "org/codehaus/plexus/component/repository/ComponentDescriptor"
> 
> 2 - I cant seem to find any documentation about the mojos.xml file
> format/schema.  Does this exist anywhere?
> 
> 3 - The maven plugin-plugin has been updated to 2.5 although the example in
> the documentation has 2.3.  When I update to 2.5 I get:
> 
> "The API of the mojo scanner is not compatible with this plugin version.
> Please check the plugin dependencies configured in the POM and ensure the
> versions match."
> 
> I'm not sure what that message means, or how to go about fixing it.

I ran into this last week, and found a fix for it. I'll try to update
the guide to use a more recent version of maven-plugin-plugin.

For the time being here's a snippet from my POM:

...
  <prerequisites>
    <maven>2.0.10</maven>
  </prerequisites>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-plugin-plugin</artifactId>
          <version>2.5</version>
        </plugin>
      </plugins>
    </pluginManagement>

    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-plugin-plugin</artifactId>
        <!-- Add the Ant plugin tools -->
        <dependencies>
          <dependency>
            <groupId>org.apache.maven.plugin-tools</groupId>
            <artifactId>maven-plugin-tools-ant</artifactId>
            <version>2.5</version>
          </dependency>
        </dependencies>
      </plugin>
    </plugins>
  </build>

  <dependencies>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-script-ant</artifactId>
      <version>2.0.10</version>
    </dependency>
  </dependencies>

...

> 
> Hopefully someone out there has the answers, I would very much like to use
> this plugin.


-- 
Dennis Lundberg

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


Re: Developing Ant Plugins problems

Posted by depstei2 <de...@umd.edu>.
One last problem, the system property java.class.path is set to
\myMaven\boot\classworlds-1.1.jar, this is causing class not found
exceptions in my ant script when using the java task:
<target name="external-run">		
<java classname="org.apache.tools.ant.Main" fork="true" dir="${basedir}">
			<classpath path="${java.class.path}" />

I would like for this to be set to the maven plugin classpath without
changing my build.xml, is that possible?
How come the classpath is not getting picked up correctly from classworlds?
-- 
View this message in context: http://www.nabble.com/Developing-Ant-Plugins-problems-tp25531301p25777506.html
Sent from the Maven - Users mailing list archive at Nabble.com.


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