2015-07-04 121 views
1

我有一種依賴,看起來像這樣:搖籃正確解決依賴的artifactId

dependencies { 
    apt 'io.sweers.barber:barber-compiler:1.3.0' 
    compile 'io.sweers.barber:barber-api:1.3.0' 
} 

這種依賴性不會同時存在於jcenter和mavenCentral,但每當gradle這個解決它,它使用了不正確的artifactId(去掉了「理髮師-「 字首)。

Error:Could not find io.sweers.barber:api:1.3.0. 
Searched in the following locations: 
    https://jcenter.bintray.com/io/sweers/barber/api/1.3.0/api-1.3.0.pom 
    https://jcenter.bintray.com/io/sweers/barber/api/1.3.0/api-1.3.0.jar 
    https://maven.fabric.io/public/io/sweers/barber/api/1.3.0/api-1.3.0.pom 
    https://maven.fabric.io/public/io/sweers/barber/api/1.3.0/api-1.3.0.jar 
    file:/Users/hsweers/dev/android/android-sdk/extras/android/m2repository/io/sweers/barber/api/1.3.0/api-1.3.0.pom 
    file:/Users/hsweers/dev/android/android-sdk/extras/android/m2repository/io/sweers/barber/api/1.3.0/api-1.3.0.jar 
    file:/Users/hsweers/dev/android/android-sdk/extras/google/m2repository/io/sweers/barber/api/1.3.0/api-1.3.0.pom 
    file:/Users/hsweers/dev/android/android-sdk/extras/google/m2repository/io/sweers/barber/api/1.3.0/api-1.3.0.jar 
Required by: 
    MyAppProject.app:unspecified > io.sweers.barber:barber-compiler:1.3.0 

如果相關性會正確解析到https://jcenter.bintray.com/io/sweers/barber/barber-api/1.3.0/barber-api-1.3.0.pom

如果有幫助,圖書館可以在這裏找到:https://github.com/hzsweers/barber

+0

如果我從'dependencies'中刪除'apt'io.sweers.barber:barber-compiler:1.3.0'',Gradle似乎找到了依賴關係,或者至少處理了'build.gradle'文件沒有問題。隨着那條線在那裏,它打破了你在你的問題中顯示的錯誤。不知道這意味着什麼,但也許這對你來說是一個有用的線索。 – CommonsWare

+0

是的,我認爲我已經縮小了一點,這是圖書館發行本身的一個問題。它用編譯器模塊中生成的POM替換爲具有mavencentral所需信息的自定義POM。事情是,由此產生的POM指定了錯誤的artifactId。去挖更多 –

回答

0

原來,問題是某處在我的圖書館,並導致了所產生的POM編譯器模塊使用api模塊名稱而不是它的artifactId。現在修補它