天天看點

如何向maven私服上傳檔案

  1. 首先在待上傳的項目的pom.xml檔案中加入以下代碼
<distributionManagement>
   	<repository>
   		<id>releases</id>
 		<url>http://localhost:8081/nexus/content/repositories/releases/</url>
   	</repository> 
   	<snapshotRepository>
   		<id>snapshots</id>
 		<url>http://localhost:8081/nexus/content/repositories/snapshots/</url>
   	</snapshotRepository> 
  </distributionManagement>
           
  1. 找到maven的setting.xml配置檔案
    如何向maven私服上傳檔案
    打開之後加入以下代碼
<server>
	      <id>releases</id>
	      <username>admin</username>
	      <password>admin123</password>
	   </server>
	   <server>
	      <id>snapshots</id>
	      <username>admin</username>
	      <password>admin123</password>
	   </server>

           
  1. 在相應的項目中執行deploy指令