dion 2003/10/21 22:50:13
Modified: xdocs/reference/developers developer-guide.xml
Log:
Move how to create your first plugin to xdocs from wiki
Revision Changes Path
1.4 +142 -0 maven/xdocs/reference/developers/developer-guide.xml
Index: developer-guide.xml
===================================================================
RCS file: /home/cvs/maven/xdocs/reference/developers/developer-guide.xml,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- developer-guide.xml 14 Oct 2003 23:58:52 -0000 1.3
+++ developer-guide.xml 22 Oct 2003 05:50:13 -0000 1.4
@@ -31,6 +31,148 @@
necessarily assembled in any paricular order, but of importance
for anyone writing a plugin.
</p>
+
+ <subsection name="How to create your first plugin">
+ <ol>
+ <li>
+ Create a directory for the plugin
+ <p>
+ Create a local directory for the plugin source code:
+ </p>
+ <source>~/myprojects/maven-plugins/hello</source>
+
+ <p>In this directory create the following directory structure:</p>
+ <source>
+./src/java
+./src/plugin-resources
+./xdocs/
+ </source>
+ </li>
+
+ <li>
+ Create the project.xml file
+ <p>
+ You might use this as a template for you project.xml:
+ </p>
+ <source>
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<project>
+ <pomVersion>3</pomVersion>
+ <id>maven-hello-plugin</id>
+ <name>Maven hello world plugin</name>
+ <currentVersion>1.0.0</currentVersion>
+ <organization>
+ <name>My org name</name>
+ </organization>
+ <inceptionYear>2003</inceptionYear>
+ <shortDescription>Short description of the
plugin</shortDescription>
+ <developers>
+ <developer>
+ <name>Trygve Laugstøl</name>
+ <id>trygvis</id>
+ <email>[EMAIL PROTECTED]</email>
+ <organization>My organization</organization>
+ <roles>
+ <role>Developer</role>
+ </roles>
+ </developer>
+ </developers>
+
+ <dependencies>
+<!--
+ <dependency>
+ <id>commons-logging</id>
+ <version>1.0.3</version>
+ </dependency>
+-->
+ </dependencies>
+
+ <build>
+ <!-- Useful if your plugin uses some beans -->
+ <sourceDirectory>src/java/main</sourceDirectory>
+
<unitTestSourceDirectory>src/java/test</unitTestSourceDirectory>
+
+ <unitTest>
+ <includes>
+ <include>**/*Test.java</include>
+ </includes>
+ </unitTest>
+
+ <resources>
+ <resource>
+ <directory>${basedir}/src/plugin-resources</directory>
+ <targetPath>plugin-resources</targetPath>
+ </resource>
+ <resource>
+ <directory>${basedir}</directory>
+ <includes>
+ <include>plugin.jelly</include>
+ <include>plugin.properties</include>
+ <include>project.properties</include>
+ <include>project.xml</include>
+ </includes>
+ </resource>
+ </resources>
+ </build>
+</project>
+ </source>
+ </li>
+
+ <li>
+ Create the plugin.jelly file
+ <p>
+ This file is the main file in the plugin. It contains the goals that
make up the plugin.
+ </p>
+ <source>
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<project>
+ <goal name="hello">
+ <echo>Hello Maven Plug-in!</echo>
+ </goal>
+</project>
+ </source>
+ </li>
+
+ <li>
+ Other useful files
+ <p>There are a couple of other useful files that you might want to know
of:</p>
+ <dl>
+ <dt>project.properties</dt>
+ <dd>the same as always, it's for customizing the build process of the
plugin itself.</dd>
+ <dt>plugin.properties</dt>
+ <dd>
+ This is simply the default values of the properties that the plugin
exposes for
+ the user to customize
+ </dd>
+ </dl>
+ </li>
+
+ <li>
+ Install the plugin
+ <p>
+ While developing a plugin you probably don't wont the plugin to be
accessable for everyone
+ using the same maven installation as you.
+ </p>
+ <p>
+ You can execute <source>maven plugin:deploy</source> to install the
plugin unpacked in your local
+ plugin directory (~/.maven/plugins).
+ </p>
+ <p>
+ When you have a good version you can do <source>maven
plugin:install</source> to install it to $MAVEN_HOME.
+ </p>
+ </li>
+
+ <li>
+ Invoke the plugin
+ <p>Start maven using</p>
+ <source>maven hello</source>
+ <p>And there's your first plug-in!</p>
+ </li>
+ </ol>
+ </subsection>
+
<subsection name="Reporting Protocol">
<p>
If you are writing a plugin which generates output that you
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]