Maven goal raises "Required goal not found" -
i trying generate maven plugin described in the maven documentation.
so created new plugin project eclipse, using mvn archetype:
<project xmlns="http://maven.apache.org/pom/4.0.0" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://maven.apache.org/pom/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelversion>4.0.0</modelversion> <groupid>com.test</groupid> <artifactid>hotdeploy</artifactid> <version>0.0.1-snapshot</version> <packaging>maven-plugin</packaging> <description>maven plugin hotdeploy portlets server</description> <dependencies> <dependency> <groupid>org.apache.maven</groupid> <artifactid>maven-plugin-api</artifactid> <version>2.2.1</version> </dependency> </dependencies> </project>
i used created java class file:
package com.test.mavenplugins; import org.apache.maven.plugin.abstractmojo; import org.apache.maven.plugin.mojoexecutionexception; /** * hot deploy components local server. * @goal hotdeploy */ public class hotdeploymojo extends abstractmojo { public void execute() throws mojoexecutionexception { getlog().info("hello, world."); } }
and ran mvn install
without errors. included plugin in project:
<build> <plugins> <plugin> <groupid>com.test</groupid> <artifactid>hotdeploy</artifactid> <version>0.0.1-snapshot</version> </plugin> </plugins> </build>
but when call mvn com.test:hotdeploy:hotdeploy
, following error:
[info] ------------------------------------------------------------------------ [error] build failure [info] ------------------------------------------------------------------------ [info] required goal not found: com.test:hotdeploy:hotdeploy in com.test:hotdeploy:0.0.1-snapshot [info] ------------------------------------------------------------------------
can me resolve error?
works when passing version:
$ mvn com.test:hotdeploy:0.0.1-snapshot:hotdeploy [info] scanning projects... [info] [info] ------------------------------------------------------------------------ [info] building hotdeploy 0.0.1-snapshot [info] ------------------------------------------------------------------------ [info] [info] --- hotdeploy:0.0.1-snapshot:hotdeploy (default-cli) @ hotdeploy --- [info] hello, world. [info] ------------------------------------------------------------------------ ...
btw, i'd suggest follow maven-$name-plugin
or $name-maven-plugin
naming convention artifactid.
just in case, might want read:
Comments
Post a Comment