How did you install your plugin? Did you build locally or downloaded from
remote repository?

Look at maven-metadata-local.xml or maven-metadata-<repo>.xml file under
M2_REPO/com/mycompany/maven/plugins directory, <repo> is the repository name
from where the plugin was installed.

You should see someting like

<?xml version="1.0" encoding="UTF-8"?><metadata>
  <plugins>
    <plugin>
      <name>your plugin name</name>
      <prefix>prefix</prefix>
      <artifactId>your plugin artifactid</artifactId>
    </plugin>
</metadata>

If you do not see anything means the plugin did not specify prefix properly.
Look at
http://books.sonatype.com/maven-book/reference/writing-plugins-sect-plugin-prefix.html
specifically example 17.6 which uses maven-plugin-plugin to declare prefix
notation.



苏林冲 wrote:
> 
> Hi, all
> I have set below in setting.xml
> <pluginGroups>
>     <pluginGroup>com.mycompany.maven.plugins</pluginGroup>
>  </pluginGroups>
> 
> when i run myplugin:exec , maven print these in the console
> 
> [INFO] Scanning for projects...
> [INFO] Searching repository for plugin with prefix: 'myplugin'.
> [INFO]
> ------------------------------------------------------------------------
> [ERROR] BUILD ERROR
> [INFO]
> ------------------------------------------------------------------------
> [INFO] The plugin 'org.apache.maven.plugins:maven-myplugin-plugin' does
> not
> exist or no valid version could be found
> [INFO]
> ------------------------------------------------------------------------
> [INFO] For more information, run Maven with the -e switch
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Total time: < 1 second
> [INFO] Finished at: Fri Nov 21 13:05:34 CST 2008
> [INFO] Final Memory: 1M/2M
> [INFO]
> ------------------------------------------------------------------------
> 
> why does maven define the groupId "org.apache.maven.plugins" rather than "
> com.mycompany.maven.plugins"?
> 
> And below is also the log infomation with -X
> 
> 
> + Error stacktraces are turned on.
> Maven version: 2.0.9
> Java version: 1.5.0_16
> OS name: "windows xp" version: "5.1" arch: "x86" Family: "windows"
> [DEBUG] Building Maven user-level plugin registry from: 'C:\Documents and
> Settings\sulinchong.pt\.m2\plugin-registry.xml'
> [DEBUG] Building Maven global-level plugin registry from: 'D:\Program
> Files\apache-maven-2.0.9\conf\plugin-registry.xml'
> [INFO] Scanning for projects...
> [INFO] Searching repository for plugin with prefix: 'myplugin'.
> [DEBUG] Loading plugin prefixes from group: com.taobao.maven.plugins
> -----> does
> it work?
> [DEBUG] Loading plugin prefixes from group: org.apache.maven.plugins
> [DEBUG] Loading plugin prefixes from group: org.codehaus.mojo
> [DEBUG] maven-myplugin-plugin: using locally installed snapshot
> [DEBUG] Artifact not found - using stub model: Unable to determine the
> latest version
> 
>   org.apache.maven.plugins:maven-myplugin-plugin:pom:LATEST
> 
> 
> [DEBUG] Using defaults for missing POM
> org.apache.maven.plugins:maven-myplugin-plugin:pom:LATEST
> [DEBUG] maven-myplugin-plugin: using locally installed snapshot
> [DEBUG] Artifact not found - using stub model: Unable to determine the
> release version
> 
>   org.apache.maven.plugins:maven-myplugin-plugin:pom:RELEASE
> 
> 
> [DEBUG] Using defaults for missing POM
> org.apache.maven.plugins:maven-myplugin-plugin:pom:RELEASE
> [INFO]
> ------------------------------------------------------------------------
> [ERROR] BUILD ERROR
> [INFO]
> ------------------------------------------------------------------------
> [INFO] The plugin 'org.apache.maven.plugins:maven-myplugin-plugin' does
> not
> exist or no valid version could be found
> [INFO]
> ------------------------------------------------------------------------
> [DEBUG] Trace
> org.apache.maven.lifecycle.LifecycleExecutionException: The plugin
> 'org.apache.maven.plugins:maven-myplugin-plugin' does not exist or no
> valid
> version could be found
>     at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.verifyPlugin(DefaultLifecycleExecutor.java:1303)
>     at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.getMojoDescriptor(DefaultLifecycleExecutor.java:1542)
>     at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.segmentTaskListByAggregationNeeds(DefaultLifecycleExecutor.java:405)
>     at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:137)
>     at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336)
>     at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129)
>     at org.apache.maven.cli.MavenCli.main(MavenCli.java:287)
>     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>     at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>     at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>     at java.lang.reflect.Method.invoke(Method.java:585)
>     at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
>     at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
>     at
> org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
>     at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
> Caused by: org.apache.maven.plugin.version.PluginVersionNotFoundException:
> The plugin 'org.apache.maven.plugins:maven-myplugin-plugin' does not exist
> or no valid version could be found
>     at
> org.apache.maven.plugin.version.DefaultPluginVersionManager.resolvePluginVersion(DefaultPluginVersionManager.java:229)
>     at
> org.apache.maven.plugin.version.DefaultPluginVersionManager.resolvePluginVersion(DefaultPluginVersionManager.java:91)
>     at
> org.apache.maven.plugin.DefaultPluginManager.verifyPlugin(DefaultPluginManager.java:171)
>     at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.verifyPlugin(DefaultLifecycleExecutor.java:1274)
>     ... 14 more
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Total time: < 1 second
> [INFO] Finished at: Fri Nov 21 13:08:21 CST 2008
> [INFO] Final Memory: 1M/2M
> [INFO]
> 
> And , i'm sure that i have deploy myplugin like this "
> com.mycompany.maven.plugins:maven-myplugin-plugin:1.0".
> -- 
> 漠洋(苏琳冲)
> SuLinchong
> Phone   13656669328
> Qq        387973308
> Msn      sulinch...@hotmail.com
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Does-the-%3CpluginGroup%3E-in-the-setting.xml-work--tp20615404p21612726.html
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org

Reply via email to