Ahh, now I get it. You are running Maven 3.
I hadn't tested Ant based plugins in Maven 3 until now, and apparently it doesn't work as it did in Maven 2. On Thu, Dec 16, 2010 at 6:28 PM, <dan.old...@emc.com> wrote: > I'm just learning Maven and trying this demo: > http://maven.apache.org/guides/plugin/guide-ant-plugin-development.html. > I built the files as described. The install step works. The run step > gets this error: Could not find goal 'hello' in plugin > org.myproject.plugins:hello-plugin:2.0 among available goals. > > > > C:\tmp\maven-user\maven-script-ant>mvn install > > [INFO] Scanning for projects... > > [INFO] > > [INFO] > ------------------------------------------------------------------------ > > [INFO] Building Hello Plugin 1.0-SNAPSHOT > > [INFO] > ------------------------------------------------------------------------ > > [INFO] > > [INFO] --- maven-plugin-plugin:2.3:descriptor (default-descriptor) @ > hello-plugin --- > > [WARNING] Goal prefix is: hello; Maven currently expects it to be hello > > [INFO] Using 3 extractors. > > [INFO] Applying extractor for language: java > > [INFO] Extractor for language: java found 0 mojo descriptors. > > [INFO] Applying extractor for language: bsh > > [INFO] Extractor for language: bsh found 0 mojo descriptors. > > [INFO] Applying extractor for language: ant > > [INFO] Extractor for language: ant found 0 mojo descriptors. > > [INFO] > > [INFO] --- maven-resources-plugin:2.4.3:resources (default-resources) @ > hello-plugin --- > > [WARNING] Using platform encoding (Cp1252 actually) to copy filtered > resources, i.e. build is platform dependent! > > [INFO] skip non existing resourceDirectory > C:\tmp\maven-user\maven-script-ant\src\main\resources > > [INFO] > > [INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ > hello-plugin --- > > [INFO] No sources to compile > > [INFO] > > [INFO] --- maven-resources-plugin:2.4.3:testResources > (default-testResources) @ hello-plugin --- > > [WARNING] Using platform encoding (Cp1252 actually) to copy filtered > resources, i.e. build is platform dependent! > > [INFO] skip non existing resourceDirectory > C:\tmp\maven-user\maven-script-ant\src\test\resources > > [INFO] > > [INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile) > @ hello-plugin --- > > [INFO] No sources to compile > > [INFO] > > [INFO] --- maven-surefire-plugin:2.5:test (default-test) @ hello-plugin > --- > > [INFO] No tests to run. > > [INFO] > > [INFO] --- maven-jar-plugin:2.3.1:jar (default-jar) @ hello-plugin --- > > [INFO] Building jar: > C:\tmp\maven-user\maven-script-ant\target\hello-plugin-1.0-SNAPSHOT.jar > > [INFO] > > [INFO] --- maven-plugin-plugin:2.3:addPluginArtifactMetadata > (default-addPluginArtifactMetadata) @ hello-plugin --- > > [INFO] > > [INFO] --- maven-install-plugin:2.3.1:install (default-install) @ > hello-plugin --- > > [INFO] Installing > C:\tmp\maven-user\maven-script-ant\target\hello-plugin-1.0-SNAPSHOT.jar > to C:\Documents and Settings\oldmad\.m2\repository\org\mypro > > ject\plugins\hello-plugin\1.0-SNAPSHOT\hello-plugin-1.0-SNAPSHOT.jar > > [INFO] Installing C:\tmp\maven-user\maven-script-ant\pom.xml to > C:\Documents and > Settings\oldmad\.m2\repository\org\myproject\plugins\hello-plugin\1.0 > > -SNAPSHOT\hello-plugin-1.0-SNAPSHOT.pom > > [INFO] > ------------------------------------------------------------------------ > > [INFO] BUILD SUCCESS > > [INFO] > ------------------------------------------------------------------------ > > [INFO] Total time: 9.860s > > [INFO] Finished at: Thu Dec 16 12:17:42 EST 2010 > > [INFO] Final Memory: 4M/7M > > [INFO] > ------------------------------------------------------------------------ > > > > C:\tmp\maven-user\maven-script-ant>mvn > org.myproject.plugins:hello-plugin:hello > > [INFO] Scanning for projects... > > [INFO] > ------------------------------------------------------------------------ > > [INFO] BUILD FAILURE > > [INFO] > ------------------------------------------------------------------------ > > [INFO] Total time: 0.250s > > [INFO] Finished at: Thu Dec 16 12:18:05 EST 2010 > > [INFO] Final Memory: 1M/3M > > [INFO] > ------------------------------------------------------------------------ > > [ERROR] Could not find goal 'hello' in plugin > org.myproject.plugins:hello-plugin:2.0 among available goals -> [Help 1] > > [ERROR] > > [ERROR] To see the full stack trace of the errors, re-run Maven with the > -e switch. > > [ERROR] Re-run Maven using the -X switch to enable full debug logging. > > [ERROR] > > [ERROR] For more information about the errors and possible solutions, > please read the following articles: > > [ERROR] [Help 1] > http://cwiki.apache.org/confluence/display/MAVEN/MojoNotFoundException > > C:\tmp\maven-user\maven-script-ant>mvn help:describe -Dplugin=hello > > > > The help link is not helpful. > > > > If I ask the help system to describe the hello plugin, it says that it > is there, but if I use the fully qualified name it goes back to the > error. > > > > C:\tmp\maven-user\maven-script-ant>mvn help:describe -Dplugin=hello > > [INFO] Scanning for projects... > > [INFO] > > [INFO] > ------------------------------------------------------------------------ > > [INFO] Building Hello Plugin 1.0-SNAPSHOT > > [INFO] > ------------------------------------------------------------------------ > > [INFO] > > [INFO] --- maven-help-plugin:2.1.1:describe (default-cli) @ hello-plugin > --- > > [INFO] org.myproject.plugins:hello-plugin:2.0 > > > > Name: Hello Plugin > > Description: (no description available) > > Group Id: org.myproject.plugins > > Artifact Id: hello-plugin > > Version: 2.0 > > Goal Prefix: hello > > > > This plugin has 0 goal: > > > > For more information, run 'mvn help:describe [...] -Ddetail' > > > > [INFO] > ------------------------------------------------------------------------ > > [INFO] BUILD SUCCESS > > [INFO] > ------------------------------------------------------------------------ > > [INFO] Total time: 2.344s > > [INFO] Finished at: Thu Dec 16 12:18:29 EST 2010 > > [INFO] Final Memory: 3M/6M > > [INFO] > ------------------------------------------------------------------------ > > > > C:\tmp\maven-user\maven-script-ant>mvn help:describe > -Dplugin=org.myproject.plugins:hello-plugin:hello > > [INFO] Scanning for projects... > > [INFO] > > [INFO] > ------------------------------------------------------------------------ > > [INFO] Building Hello Plugin 1.0-SNAPSHOT > > [INFO] > ------------------------------------------------------------------------ > > [INFO] > > [INFO] --- maven-help-plugin:2.1.1:describe (default-cli) @ hello-plugin > --- > > [INFO] > ------------------------------------------------------------------------ > > [INFO] BUILD FAILURE > > [INFO] > ------------------------------------------------------------------------ > > [INFO] Total time: 1.047s > > [INFO] Finished at: Thu Dec 16 12:22:00 EST 2010 > > [INFO] Final Memory: 3M/6M > > [INFO] > ------------------------------------------------------------------------ > > [ERROR] Failed to execute goal > org.apache.maven.plugins:maven-help-plugin:2.1.1:describe (default-cli) > on project hello-plugin: Plugin does not exist: > > Plugin could not be found, please check its coordinates for typos and > ensure the required plugin repositories are defined in the POM > > [ERROR] org.myproject.plugins:hello-plugin:maven-plugin:hello > > [ERROR] > > [ERROR] from the specified remote repositories: > > [ERROR] central (http://repo1.maven.org/maven2, releases=true, > snapshots=false) > > [ERROR] -> [Help 1] > > [ERROR] > > [ERROR] To see the full stack trace of the errors, re-run Maven with the > -e switch. > > [ERROR] Re-run Maven using the -X switch to enable full debug logging. > > [ERROR] > > [ERROR] For more information about the errors and possible solutions, > please read the following articles: > > [ERROR] [Help 1] > http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException > > > > Any ideas? > > > > Thanks, > > Dan > > > > -- Dennis Lundberg