2011-02-25 25 views
15

我在Eclipse中使用Maven(M2蝕)MVN:安裝將我的關係遠程倉庫罐子

當我MVN執行:安裝,我想我的罐子(神器)被安裝在關係倉庫是位於服務器上(現在安裝的jar放在本地系統信息庫中)。我該怎麼做?

enter image description here

我甚至改變了這對我的本地庫地址

回答

22

通常情況下,你會使用mvn deploy部署到非本地倉庫。

當然,您需要在maven settings.xml或項目POM中配置repo。

因爲我們總是使用相同的內部回購協議,所以我在Maven settings.xml中更準確地說是「profiles」部分。

這裏是我的參考配置:

<profiles> 
    <profile> 
     <id>artifactory</id> 
     <repositories> 
     <repository> 
      <id>central</id> 
      <name>libs-releases</name> 
      <url>http://repo.example.com/libs-releases</url> 
      <snapshots> 
      <enabled>false</enabled> 
      </snapshots> 
     </repository> 
     <repository> 
      <id>snapshots</id> 
      <name>libs-snapshots</name> 
      <url>http://repo.example.com/libs-snapshots</url> 
      <snapshots /> 
     </repository> 
     </repositories> 
     <pluginRepositories> 
     <pluginRepository> 
      <id>central</id> 
      <name>plugins-releases</name> 
      <url>http://repo.example.com/plugins-releases</url> 
      <snapshots><enabled>false</enabled></snapshots> 
     </pluginRepository> 
     </pluginRepositories> 
    </profile> 
    </profiles> 
    <activeProfiles> 
    <activeProfile>artifactory</activeProfile> 
    </activeProfiles>