Maven使用tomcat8-maven-plugin插件


版權聲明:本文為博主原創文章,未經博主允許不得轉載。 https://blog.csdn.net/u011781521/article/details/75194071

在網上搜索一堆文章沒找到解決方法,只找到了tomcat7-maven-plugin的plugin,如下:

 

 

<plugin>
  <groupId>org.apache.tomcat.maven</groupId>
  <artifactId>tomcat7-maven-plugin</artifactId>
  <version>2.2</version>
</plugin>

並沒有找到tomcat8-maven-plugin的plugin,在Maven的中央倉庫中根本就沒有這個插件:

 

https://repository.apache.org/content/repositories/snapshots/org/apache/tomcat/maven/

 


 

在mvnrepository倉庫中找到了一個

 


 

 

 

把上面的依賴加入到POM.XML中要么就是提示找不到該依賴,要么就是下載不下來.找了半天找到了一個解決方法,就是使用Maven中的<pluginRepositories> ,<pluginRepositories>是用來配置插件地址的,因為maven的所有功能都是使用插件來實現功能的,因此需要從特定的地址下載插件包。

 

在POM.XML中加入以下內容

 

  <pluginRepositories>   
	  <pluginRepository>   
		<id>alfresco-public</id>    
		<url>https://artifacts.alfresco.com/nexus/content/groups/public</url>   
	  </pluginRepository>    
	  <pluginRepository>   
		<id>alfresco-public-snapshots</id>    
		<url>https://artifacts.alfresco.com/nexus/content/groups/public-snapshots</url>    
		<snapshots>   
		  <enabled>true</enabled>    
		  <updatePolicy>daily</updatePolicy>   
		</snapshots>   
	  </pluginRepository>    
	  <pluginRepository>   
		<id>beardedgeeks-releases</id>    
		<url>http://beardedgeeks.googlecode.com/svn/repository/releases</url>   
	  </pluginRepository>   
  </pluginRepositories> 

加入tomcat8-maven-plugin依賴

 

        <plugin>
          <groupId>org.apache.tomcat.maven</groupId>
          <artifactId>tomcat8-maven-plugin</artifactId>
          <version>3.0-r1655215</version>
        </plugin>

然后就能使用 tomcat8-maven-plugin插件了。

 

 

然后在網上還找到了幾個有這個插件的倉庫:

 

http://mvnrepository.com/artifact/org.apache.tomcat.maven/tomcat8-maven-plugin/3.0-r1655215

https://svn.apache.org/repos/asf/tomcat/maven-plugin/branches/tc8.x/

https://github.com/apache/tomcat-maven-plugin


 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM