Siegfried,

I am far from being a Maven expert, but AFAIK, "Mojo" is a play on the words "Maven" "Pojo".
You write a Java class that implements the Mojo api. You basically
implement the execute() method to do the work of your plugin. Put in the pom.xml of the project <packaging>maven-plugin</packaging>,
follow the instructions about the markup directives to put in your
class, run the mvn plugin:install goal and you should be off to a good start.
For enumerating dependencies, you can use the 
org.apache.maven.project.MavenProject
object. You set it as a parameter on your plugin like this:

  /**
    * The maven project.
    *
    * @parameter expression="${project}"
    * @required
    * @readonly
    */
   private MavenProject project;

I found it very useful to download the Maven source at look at the source
of some plugins to see how they work. There are instructions on the Maven
site for downloading the source. Then look in maven-plugins subdirectory
to find the source of the plugins.

cheers
Jan


Siegfried Heintze wrote:
Ahhh --- OK, this is progress. I've been searching the archives for
"execution" to learn how to create a custom goal to execute my program and I
have not had any luck.
What is "mojo"?

I guess if I want to write a little for loop to enumerate the dependencies
in my POM there is probably a way to do that in
org.apache.maven.plugin.Mojo. But where is the javadoc for
org.apache.maven.plugin.Mojo? I don't see any links and I am scrolling the
entirety of
http://maven.apache.org/maven2/developers/mojo-api-specification.html!
Surely this project has javadocs!

And I suppose that after I figure out how to enumerate POM dependencies then
I use the ant javadocs to call ant and execute my program?

Thanks,
Siegfried

-----Original Message-----
From: news [mailto:[EMAIL PROTECTED] On Behalf Of Jan Bartel
Sent: Thursday, November 03, 2005 8:30 AM
To: [email protected]
Subject: Re: Documentation for writing Pluggins for M2?

Siegfried,

Here's a link to writing a plugin in Java:

http://maven.apache.org/maven2/guides/plugin/guide-java-plugin-development.h
tml

And here's a link to the API:

http://maven.apache.org/maven2/developers/mojo-api-specification.html

regards,
Jan

Siegfried Heintze wrote:

Is there any documentation for writing pluggins for M2? Could someone

kindly

point me to it?
Thanks,
Siegfried



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to