Plugin not found for 'jetty' prefix in current project

The mvn Jetty plugin code has been added to my pom.xml project.

<plugin> <groupId>org.mortbay.jetty</groupId> <artifactId>maven-jetty-plugin</artifactId> <version>6.1.26</version> <configuration> <contextPath>/redkites</contextPath> </configuration> <executions> <execution> <id>start-jetty</id> <phase>deploy</phase> <goals> <goal>run</goal> </goals> <configuration> <scanIntervalSeconds>10</scanIntervalSeconds> <daemon>true</daemon> </configuration> </execution> </executions> </plugin> 

When I use the sudo mvn compile and sudo mvn clean install commands, I did not find errors and did not work successfully, but when I type the sudo mvn jetty:run command, I get an error message:

 [ERROR] No plugin found for prefix 'jetty' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (/root/.m2/repository), central (http://repo.maven.apache.org/maven2)] -> [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/NoPluginFoundForPrefixException 

Please suggest a way to solve it. Thanks you

+22
maven jetty maven-jetty-plugin
Jan 02 '15 at 5:50
source share
5 answers

You may need to add groupId to the default groupId list.

So edit your ${user.home}/.m2/settings.xml accordingly:

 <pluginGroups> <!-- your existing plugin groups if any --> ... <pluginGroup>org.mortbay.jetty</pluginGroup> </pluginGroups> 

Quoting the Shortening the Command Line section of the plugin development guide ,

... add your groupId plugin to the default group search list. To do this, you need to add the following $ {user.home} /. m2 / settings.xml file:

 <pluginGroups> <pluginGroup>sample.plugin</pluginGroup> </pluginGroups> 



Take a look here to find out that groupId checked by default:

By default, Maven will look for groupId org.apache.maven.plugins for prefix-to-artifactId for the plugins needed to complete this assembly.

...

Maven will always look for the next group. after searching for any groups of plugins specified in the user settings:

  • org.apache.maven.plugins
  • org.codehaus.mojo
+31
Jan 02 '15 at
source share

if you do not find the settings.xml file in your home directory

then add the default settings file .xml

 <settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd"> <localRepository>${user.home}/.m2/repository</localRepository> <interactiveMode>true</interactiveMode> <usePluginRegistry>false</usePluginRegistry> <offline>false</offline> <pluginGroups> <pluginGroup>org.mortbay.jetty</pluginGroup> </pluginGroups> </settings> 
+23
Aug 26 '15 at 10:59 on
source share

I ran the command in the directory in which the project was, but the team worked fine after switching to one directory at the top, that is, in one, in which all the project files were present.

+1
Jul 09 '17 at 12:15
source share

What worked for me in the multi-module Maven project in Eclipse:

1 Open the "Launch Configurations" dialog.

2. Look at the “Base Directory”: is there really a directory for your webapps submodule, or is it a directory for the s parent module ?

3 If this is the last one, click the "Workspace" button and select the directory of submodules (webapps).

0
Apr 22 '17 at 9:25
source share

It happened to me once, because instead

 jetty:start 

I (somehow) tried

 {application-name:start} 

And I lost a few hours before I could understand this stupid mistake.

-2
Apr 29 '16 at 6:09
source share



All Articles