Tôi đã thêm mã plugin mvn jetty vào dự án pom.xml của mình.Không tìm thấy plugin nào cho tiền tố 'cầu cảng' trong dự án hiện tại
<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>
Khi tôi sử dụng lệnh sudo mvn compile
và sudo mvn clean install
, tôi không tìm thấy bất kỳ lỗi & xây dựng thành công, nhưng khi tôi gõ lệnh sudo mvn jetty:run
, tôi nhận được một lỗi:
[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
Xin gợi ý một cách để giải quyết nó. Cảm ơn bạn
Thử chạy tất cả lệnh 'mvn' mà không cần sudo. –
Bản sao có thể có của [Thiếu Maven Plugin Jetty] (http://stackoverflow.com/questions/10426557/missing-maven-plugin-jetty) – cellepo