Thanks for that. Now got another project having the hello plugin in its
pom.xml, however, when running:
m2 hello:hello
in the other project, I get the following error:
Nonexistent component:
org.codehaus.plexus.component.factory.ComponentFactorymarmalade
This is my pom.xml for the plugin:
<project>
<modelVersion>4.0.0</modelVersion>
<!-- for now, this is the only groupId acceptable for maven plugins -->
<groupId>org.apache.maven.plugins</groupId>
<!-- uses a standard naming convention -->
<artifactId>maven-hello-plugin</artifactId>
<!-- uses this version, to make it usable without configuring this plugin
from
| the project POM.
-->
<version>1.0-SNAPSHOT</version>
<!-- Designate this project as building a maven plugin -->
<packaging>maven-plugin</packaging>
<name>Maven Hello World Plugin</name>
<!--
You might want to include additional information here
eg the developers, organisation, and dependencies
-->
<build>
<scriptSourceDirectory>src/main/scripts</scriptSourceDirectory>
<!-- Since the script source directory is only a marker for a resource,
you
| still have to declare that directory for resource inclusion when
you
| build.
-->
<resources>
<resource>
<directory>src/main/scripts</directory>
<includes><include>**/*.mmld</include></includes>
</resource>
</resources>
</build>
<dependencies>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
<version>2.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>marmalade</groupId>
<artifactId>marmalade-core</artifactId>
<version>1.0-alpha-4</version>
</dependency>
<dependency>
<groupId>marmalade</groupId>
<artifactId>marmalade-el-commons</artifactId>
<version>1.0-alpha-3</version>
</dependency>
<dependency>
<groupId>marmalade</groupId>
<artifactId>marmalade-tags-io</artifactId>
<version>1.0-alpha-3</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-script-marmalade</artifactId>
<version>2.0-SNAPSHOT</version>
</dependency>
</dependencies>
</project>
This is the script for the plugin:
<mojo xmlns="marmalade:mojo">
<metadata>
<goal>hello</goal>
<description>Say Hello to the World.</description>
<parameters>
<parameter>
<name>salutation</name>
<expression>#salutation</expression>
<default>Hello</default>
<description>The salutation to use in greeting the
world.</description>
</parameter>
</parameters>
</metadata>
<execute>
<c:out xmlns:c="marmalade:core">${salutation}, World.</c:out>
</execute>
</mojo>
This is how the plugin is declared in other project:
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-hello-plugin</artifactId>
<version>1.0-SNAPSHOT</version>
</plugin>
</plugins>
Any help that would be great. :)
Many thanks,
Mike
<br><br><br>>From: Edwin Punzalan
<[EMAIL PROTECTED]><br>>Reply-To: "Maven Users List"
<[email protected]><br>>To: Maven Users List
<[email protected]><br>>Subject: Re: [M2] Tutorial example not
working for me<br>>Date: Fri, 15 Jul 2005 17:59:13
+0800<br>><br>>Did you check the repository?<br>><br>>Anyway, to
use the plugin, you should have a separate project <br>>declaring the
plugin in its pom. After that, the project can now <br>>call
hello:hello.<br>><br>><br>><br>>Michael Owen
wrote:<br>><br>>><br>>>It doesn't give errors any more, and
creates the files in the <br>>>target directory, however, doesn't
install the plugin in the local <br>>>repository and the goals
"m2 hello:hello" or "m2 hello" don't
work.<br>>><br>>>Thanks for help btw.
:)<br>>><br>>>Mike<br>>><br>>><br><br><br>&gt;From:
Edwin Punzalan
<br>>>&lt;[EMAIL PROTECTED]&gt;<br>&gt;Reply-To:
&quot;Maven Users <br>>>List&quot;
&lt;[email protected]&gt;<br>&gt;To: Maven Users
<br>>>List
&lt;[email protected]&gt;<br>&gt;Subject: Re: [M2]
<br>>>Tutorial example not working for me<br>&gt;Date: Fri,
15 Jul 2005 <br>>>17:44:30
+0800<br>&gt;<br>&gt;have you tried removing the
<br>>>&lt;id&gt; tag from your
mojo?<br>&gt;<br>&gt;Michael Owen
<br>>>wrote:<br>&gt;<br>&gt;&gt;Hi,<br>&gt;&gt;<br>&gt;&gt;Firstly,
I'm <br>>>using Maven 2 alpha
3.<br>&gt;&gt;<br>&gt;&gt;When I try to make to
<br>>>make the Marmalade plugin at
<br>>><br>&gt;&gt;http://maven.apache.org/maven2/developers/developing-plugins-with-marmalade.html,
<br>>><br>&gt;&gt;I get the following
<br>>>error:<br>&gt;&gt;<br>&gt;&gt;java.lang.NullPointerException<br>&gt;&gt;
<br>>> at
<br>>><br>&gt;&gt;org.codehaus.marmalade.metamodel.AbstractMarmaladeTagLibrary.createTag(AbstractMarmaladeTagLibrary.java:59)<br>&gt;&gt;<br>&gt;&gt;...<br>&gt;&gt;...<br>&gt;&gt;<br>&gt;&gt;I
<br>>>use the same pox.xml and hello.mmld as in the tutorial, so I
<br>>><br>&gt;&gt;confused why it won't work. Any
<br>>>ideas?<br>&gt;&gt;<br>&gt;&gt;Thanks,<br>&gt;&gt;<br>&gt;&gt;Mike<br>&gt;&gt;<br>&gt;&gt;<br>&gt;&gt;<br>&gt;&gt;---------------------------------------------------------------------<br>&gt;&gt;To
<br>>>unsubscribe, e-mail:
<br>>>[EMAIL PROTECTED]<br>&gt;&gt;For
additional <br>>>commands, e-mail:
<br>>>[EMAIL PROTECTED]<br>&gt;&gt;<br>&gt;<br>&gt;---------------------------------------------------------------------<br>&gt;To
<br>>>unsubscribe, e-mail:
[EMAIL PROTECTED]<br>&gt;For
<br>>>additional commands, e-mail:
<br>>>[EMAIL PROTECTED]<br>&gt;<br><br>>><br>>><br>>><br>>>---------------------------------------------------------------------<br>>>To
unsubscribe, e-mail: [EMAIL PROTECTED]<br>>>For
additional commands, e-mail:
[EMAIL PROTECTED]<br>>><br>><br>>---------------------------------------------------------------------<br>>To
unsubscribe, e-mail: [EMAIL PROTECTED]<br>>For
additional commands, e-mail: [EMAIL PROTECTED]<br>><br>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]