2012-09-28 114 views
3

我正在嘗試構建一個插件+功能,它依賴於com.android.ide.eclipse.adt包。對於我添加ADT庫到主pom.xmlTycho找不到Android開發工具包

<repository> 
    <id>adt</id> 
    <layout>p2</layout> 
    <url>http://dl-ssl.google.com/android/eclipse</url> 
</repository> 

現在構建失敗,此錯誤:

[INFO] Adding repository http://dl-ssl.google.com/android/eclipse 
[INFO] Fetching site.xml (0B of 1,8kB at 0B/s) from http://dl-ssl.google.com/android/eclipse/ 
[INFO] 1 operation remaining. 
[INFO] Fetching site.xml (1,8kB of 1,8kB at 0B/s) from http://dl-ssl.google.com/android/eclipse/ 
[INFO] Adding repository http://dl-ssl.google.com/android/eclipse 
[INFO] Resolving dependencies of MavenProject: me.fixpoint.eared:me.fixpoint.eared.plugin:0.0.4-SNAPSHOT @ D:\Projects\eared\plugin\pom.xml 
[INFO] Cannot complete the request. Generating details. 
[INFO] Cannot complete the request. Generating details. 
[INFO] {osgi.ws=win32, osgi.os=win32, osgi.arch=x86_64, org.eclipse.update.install.features=true} 
[ERROR] Cannot resolve project dependencies: 
[ERROR] Software being installed: me.fixpoint.eared 0.4.0 
[ERROR] Missing requirement: me.fixpoint.eared 0.4.0 requires 'bundle com.android.ide.eclipse.adt 0.0.0' but it could not be found 
[ERROR] 
[ERROR] Internal error: java.lang.RuntimeException: "No solution found because the problem is unsatisfiable.": ["Unable to satisfy dependency from me.fixpoint.eared 0.4.0 to bundle com.android.ide.eclipse.adt 0.0.0.", "No solution found because the problem is unsatisfiable."] -> [Help 1] 
org.apache.maven.InternalErrorException: Internal error: java.lang.RuntimeException: "No solution found because the problem is unsatisfiable.": ["Unable to satisfy dependency from me.fixpoint.eared 0.4.0 to bundle com.android.ide.eclipse.adt 0.0.0.", "No solution found because the problem is unsatisfiable."] 

我試着從以下這個線程建議:https://groups.google.com/group/adt-dev/tree/browse_frm/month/2012-07/39c71d32169b9569?rnum=51&_done=/group/adt-dev/browse_frm/month/2012-07?&pli=1和創建P2更新網址爲http://dl.dropbox.com/u/1236385/adt,但錯誤是一樣的:

[INFO] Adding repository http://dl.dropbox.com/u/1236385/adt 
[INFO] Fetching content.jar (0B of 18,09kB at 0B/s) from http://dl.dropbox.com/u/1236385/adt/ 
[INFO] 1 operation remaining. 
[INFO] Fetching content.jar (3,97kB of 18,09kB at 0B/s) from http://dl.dropbox.com/u/1236385/adt/ 
[INFO] Adding repository http://dl.dropbox.com/u/1236385/adt 
[INFO] Fetching artifacts.jar (0B of 783B at 0B/s) from http://dl.dropbox.com/u/1236385/adt/ 
[INFO] 1 operation remaining. 
[INFO] Fetching artifacts.jar (783B of 783B at 0B/s) from http://dl.dropbox.com/u/1236385/adt/ 
[INFO] Resolving dependencies of MavenProject: me.fixpoint.eared:me.fixpoint.eared.plugin:0.0.4-SNAPSHOT @ D:\Projects\eared\plugin\pom.xml 
[INFO] Cannot complete the request. Generating details. 
[INFO] Cannot complete the request. Generating details. 
[INFO] {osgi.ws=win32, osgi.os=win32, osgi.arch=x86_64, org.eclipse.update.install.features=true} 
[ERROR] Cannot resolve project dependencies: 
[ERROR] Software being installed: me.fixpoint.eared 0.4.0 
[ERROR] Missing requirement: me.fixpoint.eared 0.4.0 requires 'bundle com.android.ide.eclipse.adt 0.0.0' but it could not be found 
[ERROR] 
[ERROR] Internal error: java.lang.RuntimeException: "No solution found because the problem is unsatisfiable.": ["Unable to satisfy dependency from me.fixpoint.eared 0.4.0 to bundle com.android.ide.eclipse.adt 0.0.0.", "No solution found because the problem is unsatisfiable."] -> [Help 1] 
org.apache.maven.InternalErrorException: Internal error: java.lang.RuntimeException: "No solution found because the problem is unsatisfiable.": ["Unable to satisfy dependency from me.fixpoint.eared 0.4.0 to bundle com.android.ide.eclipse.adt 0.0.0.", "No solution found because the problem is unsatisfiable."] 

爲什麼不能找到com.android.ide.eclipse.adt

以防萬一,here's link to the master POM

回答

3

舊式更新站點只有關於工件依賴關係的不完整元數據。然而,Tycho需要依賴關係解析機制的完整依賴元數據,因此不能使用舊式更新站點。收件箱網站可能處於現代p2存儲庫格式,但它包含相同的不完整元數據。 (在第2講中,這些元數據不完整的條目稱爲「部分IU」)。在Tycho 0.18.0之前,這些部分IU被無聲地丟棄,導致了所述的解決問題。這在Tycho 0.18.0中得到了改進:自該版本以來,Tycho失敗,並顯示一條錯誤消息,指向包含不完整元數據的存儲庫。

要解決您的問題,最好要求項目提供一個合適的p2存儲庫。 p2提供不同的publisher applications來做到這一點。理論上,您也可以自己調用發佈程序應用程序,但這應該只是臨時解決方法。

+0

並提示p2版本庫的未來問題:[Igor的p2瀏覽器](https://github.com/ifedorenko/p2-browser)是分析它們的好工具。 – oberlies