1. 程式人生 > >maven:No plugin found for prefix 'jetty' in the current project and in the plugin groups

maven:No plugin found for prefix 'jetty' in the current project and in the plugin groups

翻譯如下:

在當前的專案裡或外掛組裡沒有以“jetty”開頭名字的外掛。

怎麼辦?3種方案哪種都行。推薦第二種

1.在外掛組裡新增jetty的外掛

在maven的settings.xml裡新增以下配置

 <!-- pluginGroups
   | This is a list of additional group identifiers that will be searched when resolving plugins by their prefix, i.e.
   | when invoking a command line like "mvn prefix:goal". Maven will automatically add the group identifiers
   | "org.apache.maven.plugins" and "org.codehaus.mojo" if these are not already contained in the list.
   |-->
  <pluginGroups>
    <!-- pluginGroup
     | Specifies a further group identifier to use for plugin lookup. -->
    <pluginGroup>org.mortbay.jetty</pluginGroup>
   
  </pluginGroups>

   這個就是全域性的

2.在當前專案組裡新增jetty的外掛。pom.xml裡

 <build>
    
	<plugins>
		<plugin>
			<groupId>org.mortbay.jetty</groupId>
			<artifactId>maven-jetty-plugin</artifactId>
			<version>6.1.26</version>
		</plugin>
	</plugins>
  </build>

這個是專案級別的

3.在命令裡使用

mvn org.mortbay.jetty:maven-jetty-plugin:run   

  這個是一次性的。

jetty是啟動了,但是如何關閉呢?簡單的是Ctrl+C