Hard to tell from this code. Check the plugin.xml file which is being generated. Also mvn help:describe (which uses the plugin.xml descriptor IIRC).
Also, my guess is that you don't actually want to include this line: * @execute phase="generate-sources" But I doubt that's the source of the error below. Justin On Mon, Oct 4, 2010 at 5:50 PM, Leon Rosenberg <[email protected]> wrote: > Hello, > > I'm currently writing my first plugin and am struggling with very basics. > From the guide > (http://maven.apache.org/guides/plugin/guide-java-plugin-development.html) > I understood that if I > specify a goal in a javadoc annotation I will able to call it later > directly, but I fail to achieve it. In my plugin I'm annotating the > code with generate: > > > /** > * Generates ano-doc classes. > * > * @goal generate > * @phase generate-sources > * @execute phase="generate-sources" > * > */ > public class GeneratorMojo extends AbstractMojo{ > > public void execute() throws MojoExecutionException, > MojoFailureException { > getLog().info("YOOOO HEI!!!!"); > > } > > } > > After the packaging, and installing, and running from the directory I > want to use it: > anot...@colin:~/projects/aos/ano-site$ mvn ano-doc:generate > [INFO] Scanning for projects... > [INFO] > ------------------------------------------------------------------------ > [ERROR] BUILD FAILURE > [INFO] > ------------------------------------------------------------------------ > [INFO] Required goal not found: ano-doc:generate in > net.anotheria:maven-ano-doc-plugin:1.0-SNAPSHOT > [INFO] > ------------------------------------------------------------------------ > [INFO] For more information, run Maven with the -e switch > [INFO] > ------------------------------------------------------------------------ > [INFO] Total time: < 1 second > [INFO] Finished at: Mon Oct 04 23:48:07 CEST 2010 > [INFO] Final Memory: 8M/81M > > > My plugin pom looks like this: > <project> > <modelVersion>4.0.0</modelVersion> > <groupId>net.anotheria</groupId> > <artifactId>maven-ano-doc-plugin</artifactId> > <packaging>maven-plugin</packaging> > <version>1.0-SNAPSHOT</version> > <name>AnoDoc Generator for Maven</name> > > <distributionManagement> > <!--omited--> > </distributionManagement> > > <dependencies> > <dependency> > <groupId>org.apache.maven</groupId> > <artifactId>maven-plugin-api</artifactId> > <version>2.0</version> > </dependency> > </dependencies> > </project> > > my pom in which I intend to use the new project : > <build> > <plugins> > <plugin> > <groupId>net.anotheria</groupId> > <artifactId>maven-ano-doc-plugin</artifactId> > <version>1.0-SNAPSHOT</version> > <executions> > <execution> > <phase>generate-sources</phase> > <goals> > <goal>generate</goal> > </goals> > </execution> > </executions> > </plugin> > </plugins> > </build> > > > any help would be greatly appreciated > regards > Leon > > --------------------------------------------------------------------- > 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]
