我在项目pom.xml中添加了jetty mvn插件代码.
<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>
Run Code Online (Sandbox Code Playgroud)
当我使用命令sudo mvn compile和sudo mvn clean install,我没有发现任何错误和成功建立,但是当我键入命令sudo mvn jetty:run,我得到一个错误:
[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 …Run Code Online (Sandbox Code Playgroud) 在Eclipse中,我导入了一个使用maven jetty插件的基于maven的项目.如果我从命令行运行mvn jetty:run,一切正常.如果我在Eclipse中添加运行配置并尝试运行它,我会收到错误消息:
[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 (/home/eugene/.m2/repository), central (http://repo1.maven.org/maven2)] -> [Help 1]
在Eclipe运行配置中,我使用:
${project_loc}jetty:run我读了[ Help1 ]页.我在maven配置文件中没有pluginGroup设置,但我有pom.xml中提到的jetty插件,所以我想一切都应该没问题(特别是因为一切都在命令行中运行).在执行jetty运行配置之前,我尝试在Eclipse中"Run as> Maven clean",但它没有帮助.项目编译并传递所有测试,只有jetty:run在Eclipse中不起作用.
请帮帮忙,我是Eclipse&Maven的新手.提前致谢.