2014-03-30 26 views
0

最近幾天我試圖設置一個Maven開發環境。我們將TeamCity用於CI,SonarQube用於分析,SonaType Nexus用於存儲庫管理。Maven部署用戶可以部署但不能讀取存儲庫

TeamCity和SonarQube的工作就像一個魅力 - 然而,連接點給我們帶來了很多麻煩。

這種設置沒什麼特別的,現在我已經做了好幾次了。但是這一次,我得到了一個非常奇怪的錯誤:TeamCity能夠將聯繫人部署到聯繫人,但是在從聯繫人中讀取依賴關係時會出現org.apache.maven.wagon.authorization.AuthorizationException: Not authorized , ReasonPhrase:Unauthorized.錯誤。

我甚至試圖將TeamCity使用的用戶從deployment改爲admin,同樣的問題。 chown也返回了正確的值(由「buildagent」用戶擁有)。

我嚴重不知道什麼可能導致這個問題,我已經嘗試重新安裝承上啓下的3倍,甚至還添加了admin角色的「部署」用戶 - 沒有任何變化。

的 「buildagent」 用戶使用具有以下內容(密碼標有XXX)的settings.xml中:

<servers> 
    <!-- This is the username password used to access the nexus repository --> 
    <server> 
     <id>central</id> 
     <username>deployment</username> 
     <password>XXX</password> 
    </server> 
    <server> 
     <id>rn-releases</id> 
     <username>deployment</username> 
     <password>XXX</password> 
    </server> 
    <server> 
     <id>rn-snapshots</id> 
     <username>deployment</username> 
     <password>XXX</password> 
    </server> 
</servers> 

<mirrors> 
    <mirror> 
     <!--This sends everything else to /public --> 
     <id>nexus</id> 
     <mirrorOf>central</mirrorOf> 
     <url>http://build.example.com:8301/content/groups/public</url> 
    </mirror> 
</mirrors> 

<profiles> 
    <profile> 
     <id>nexus</id> 
     <!--Enable snapshots for the built in central repo to direct --> 
     <!--all requests to nexus via the mirror --> 
     <repositories> 
      <repository> 
       <id>central</id> 
       <url>http://central</url> 
       <releases><enabled>true</enabled></releases> 
       <snapshots><enabled>true</enabled></snapshots> 
      </repository> 
     </repositories> 
     <pluginRepositories> 
      <pluginRepository> 
       <id>central</id> 
       <url>http://central</url> 
       <releases><enabled>true</enabled></releases> 
       <snapshots><enabled>true</enabled></snapshots> 
      </pluginRepository> 
     </pluginRepositories> 
    </profile> 
</profiles> 

<activeProfiles> 
    <activeProfile>nexus</activeProfile> 
</activeProfiles> 

爲了您的信息:創建日誌從TeamCity的狀態設置也正確讀取,所以這也不是原因。

我真的想要儘快解決這個問題,因爲我們有開發人員等待他們的項目繼續進行(並且如果它不安全,我們不想給出url,我們在CI上運行私人項目)。

在此先感謝!

編輯: 所以我現在甚至嘗試安裝artifactory - 我仍然有同樣的問題。它似乎是與A:Maven或B:TeamCity的東西。

回答

1

鏡子的Nexus擁有ID nexus,但沒有<server> -entry與此ID。如果使用正確的憑證將它添加到settings.xml中,它應該再次運行。

+0

你在哪裏搜索答案?如果在Apache Maven網站上有什麼可以改進的地方,請告訴我。 –