在当前项目中找不到前缀"jetty"的插件 [英] No plugin found for prefix 'jetty' in the current project
问题描述
我在项目pom.xml中添加了码头mvn插件代码.
I have added jetty mvn plugin code in my project pom.xml.
<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>
当我使用命令sudo mvn compile
和sudo mvn clean install
时,我没有发现任何错误&构建成功,但是当我键入命令sudo mvn jetty:run
时,出现错误:
When I use commands sudo mvn compile
and sudo mvn clean install
, I didn't find any errors & build successfully, but when I type the command sudo mvn jetty:run
, I'm getting an error:
[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
请提出解决方法.谢谢
推荐答案
默认情况下,您可能需要将org.eclipse.jetty
添加到groupId
的列表中.
You may need to add org.eclipse.jetty
to the list of groupId
s looked up by default.
因此,请相应地编辑${user.home}/.m2/settings.xml
:
<pluginGroups>
<!-- your existing plugin groups if any -->
...
<pluginGroup>org.eclipse.jetty</pluginGroup>
</pluginGroups>
引用插件开发指南,
...将您插件的groupId添加到搜索的groupId列表中 默认.为此,您需要将以下内容添加到您的 $ {user.home}/.m2/settings.xml文件:
... add your plugin's groupId to the list of groupIds searched by default. To do this, you need to add the following to your ${user.home}/.m2/settings.xml file:
<pluginGroups>
<pluginGroup>sample.plugin</pluginGroup>
</pluginGroups>
在此处中查找有关更多内容的信息默认查询groupId
:
Look here for more about what groupId
s are looked up default:
默认情况下,Maven将在groupId org.apache.maven.plugins 中搜索 它需要执行的插件的prefix-artifactId映射 给定的版本.
By default, Maven will search the groupId org.apache.maven.plugins for prefix-to-artifactId mappings for the plugins it needs to perform a given build.
...
Maven将始终搜索以下groupId的 之后搜索用户设置中指定的所有插件组:
Maven will always search the following groupId's after searching any plugin groups specified in the user's settings:
- org.apache.maven.plugins
- org.codehaus.mojo
这篇关于在当前项目中找不到前缀"jetty"的插件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!