Re: Maven Ant Demo
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, 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
Re: Maven Ant Demo
Hi Those docs are not up-to-date. I have a small Maven plugin written in Ant that works. I'll try to update the docs shortly using that as an example. On 2010-12-16 18:28, 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, i
Re: Maven Ant Demo
> Sorry about the confusion. By the way, does the phrase “This plugin > has 0 goal:” give a hint to the problem? Perhaps I don’t understand > the difference between goal prefixes and goals. I've built Java and Groovy plugins for Maven before but never an Ant plugin. So its possible that I simply haven't seen this issue. Maybe post your Ant build XML files on pastebin.org or something and send a link back to the ml so someone could look at it? I agree the "has 0 goal" seems to be your problem. The prefix simply allows you to say "mvn hello:hello" rather than typing the full "mvn org.myproject.plugins:hello-plugin:hello" line. Wayne - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
RE: Maven Ant Demo
That appears to be an artifact of some other experiments that I did. I deleted the contents of my .m2\repository\org\myproject\plugins file and ran again. It gets this error: C:\tmp\maven-user\maven-script-ant>mvn org.myproject.plugins:hello-plugin:hello [INFO] Scanning for projects... Downloading: http://repo1.maven.org/maven2/org/myproject/plugins/hello-plugin/maven-metadata.xml [INFO] [INFO] BUILD FAILURE [INFO] [INFO] Total time: 0.907s [INFO] Finished at: Thu Dec 16 13:25:21 EST 2010 [INFO] Final Memory: 1M/3M [INFO] [ERROR] Could not find goal 'hello' in plugin org.myproject.plugins:hello-plugin:1.0-SNAPSHOT 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 This is what I now get from the describe call: C:\tmp\maven-user\maven-script-ant>mvn help:describe -Dplugin=hello [INFO] Scanning for projects... Downloading: http://repo1.maven.org/maven2/org/myproject/plugins/maven-metadata.xml [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:1.0-SNAPSHOT Name: Hello Plugin Description: (no description available) Group Id: org.myproject.plugins Artifact Id: hello-plugin Version: 1.0-SNAPSHOT Goal Prefix: hello This plugin has 0 goal: For more information, run 'mvn help:describe [...] -Ddetail' [INFO] [INFO] BUILD SUCCESS [INFO] [INFO] Total time: 1.578s [INFO] Finished at: Thu Dec 16 13:30:16 EST 2010 [INFO] Final Memory: 3M/6M [INFO] Sorry about the confusion. By the way, does the phrase “This plugin has 0 goal:” give a hint to the problem? Perhaps I don’t understand the difference between goal prefixes and goals. Thanks, Dan -Original Message- From: Wayne Fay [mailto:wayne...@gmail.com] Sent: Thursday, December 16, 2010 12:56 PM To: Maven Users List Subject: Re: Maven Ant Demo > [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 > > > [ERROR] Could not find goal 'hello' in plugin > org.myproject.plugins:hello-plugin:2.0 among available goals -> [Help 1] It appears that you've got something wrong in your versions somewhere. You're building version 1.0-SNAPSHOT but then trying to use version 2.0. Wayne - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Maven Ant Demo
> [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 > > > [ERROR] Could not find goal 'hello' in plugin > org.myproject.plugins:hello-plugin:2.0 among available goals -> [Help 1] It appears that you've got something wrong in your versions somewhere. You're building version 1.0-SNAPSHOT but then trying to use version 2.0. Wayne - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org