You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by ccruiz <cr...@linkvest.com> on 2006/05/15 11:25:07 UTC
Create Maven plugin
I am new to maven and I am currently creating a plugin for building a
particular type of project using Maven 2.x. To acheive this I develop a
plugin based in an Ant mojo.
I would like to have access, in my Ant mojo script, to a XSL file
(transform.xsl) stored into the plugin (at the root repository).
To achieve this i added a ressource to the plugin's pom.xml :
...
</dependency>
</dependencies>
<build>
<resources>
<resource>
<directory>.</directory>
<includes>
<include>transform.xsl</include>
</includes>
</resource>
</resources>
<plugins>
<plugin>
...
Then i created a test.build.xml file that looks like this :
<project>
<target name="create_export">
<xslt processor="trax" style="transform.xsl" in="in.xml"
out="out.xml"/> </target>
</project>
And finally, i create a test.mojos.xml that looks like this :
<pluginMetadata>
<mojos>
<mojo>
<goal>create_export</goal>
<call>create_export</call>
<requiresProject>true</requiresProject>
<description>Generate an export jar of the project.</description>
<parameters>
<parameter>
<name>scriptsDir</name>
<property>scriptsDir</property>
<required>true</required>
<defaultValue>./scripts</defaultValue>
<expression>${scriptsDir}</expression>
<type>java.lang.String</type>
<description>The scripts directory.</description>
</parameter>
</parameters>
</mojo>
</mojos>
</pluginMetadata>
In this implementation, when i execute my plugin against a project, my
plugin search the transform.xsl file in the project root repository instead
of the plugin root repository like i want.
Could someone telle me why it doesn't work and how i cant access to the XSL
file, please ?
Thanks in advance!
--
View this message in context: http://www.nabble.com/Create-Maven-plugin-t1619811.html#a4389172
Sent from the Maven - Dev forum at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org