2015-01-16 183 views
0

我無法得到Maven的下載神器的Maven忽略了倉庫

<dependency> 
     <groupId>org.jboss.test-jsf</groupId> 
     <artifactId>jsf-mock</artifactId> 
     <version>1.1.9</version> 
     <scope>test</scope> 
    </dependency> 

這種依賴是不是在Maven的中央。我已經將適當的存儲庫添加到了我的設置中。

<profiles> 
    <profile> 
     <id>barbucha</id> 
    </profile> 
    <repositories> 
     <repository> 
      <id>jboss</id> 
      <releases> 
       <enabled>true</enabled> 
      </releases> 
      <snapshots> 
       <enabled>true</enabled> 
      </snapshots> 
      <url>http://repository.jboss.org/nexus/content/groups/public/</url> 
     </repository> 
    </repositories> 
    <pluginRepositories> 
     <pluginRepository> 
      <id>jboss-plug</id> 
      <releases> 
       <enabled>true</enabled> 
      </releases> 
      <snapshots> 
       <enabled>true</enabled> 
      </snapshots> 
      <url>http://repository.jboss.org/nexus/content/groups/public/</url> 
     </pluginRepository> 
    </pluginRepositories> 
</profiles> 

然後我使用barbucha配置文件構建東西。但是Maven根本不使用JBoss倉庫。它試圖從Central中獲取缺失的依賴關係。它試圖下載兩倍的依賴,然後失敗:

[INFO] Downloading: http://repo.maven.apache.org/maven2/org/jboss/test-jsf/jsf-mock/1.1.9/jsf-mock-1.1.9.pom 
[WARNING] The POM for org.jboss.test-jsf:jsf-mock:jar:1.1.9 is missing, no dependency information available 
[INFO] Downloading: http://repo.maven.apache.org/maven2/org/jboss/test-jsf/jsf-mock/1.1.9/jsf-mock-1.1.9.jar 
[INFO] ------------------------------------------------------------------------ 
[INFO] BUILD FAILURE 
[INFO] ------------------------------------------------------------------------ 
[ERROR] Failed to execute goal on project: Could not resolve dependencies for project: Could not find artifact org.jboss.test-jsf:jsf-mock:jar:1.1.9 in central (http://repo.maven.apache.org/maven2) -> [Help 1] 

的行爲是非常奇怪的,對我黯然的關鍵。我搜索了很長時間,但沒有發現,可能導致問題的原因。唯一的原因可能是配置文件,如果沒有激活。但那不是我的情況。

回答

2

哦,它是如此簡單 - 我的設置是隻畸形:

<profiles> 
    <profile> 
     <id>barbucha</id> 
    </profile> <<< this must be at the end (at <!-- #1 --->) 
    <repositories> 
    ... <!-- this part must be inside of profile --> 
    </pluginRepositories> 
    <!-- #1 ---> 
</profiles> 

我道歉。 (希望對某人有幫助。)