2016-12-19 25 views
2

我有一個使用Jenkins構建的Android項目。 Jenkins在虛擬機上,因此無法訪問互聯網。 當我嘗試建立一樣,我收到以下錯誤:Jenkins:無法解析com.android.tools.build:gradle:2.2.2

> Could not resolve com.android.tools.build:gradle:2.2.2. 
    Required by: 
     :LocationSensing:unspecified 
     > Could not resolve com.android.tools.build:gradle:2.2.2. 
     > Could not get resource 'https://jcenter.bintray.com/com/android/tools/build/gradle/2.2.2/gradle-2.2.2.pom'. 
      > Could not GET 'https://jcenter.bintray.com/com/android/tools/build/gradle/2.2.2/gradle-2.2.2.pom'. 
       > This is usually a temporary error during hostname resolution and means that the local server did not receive a response from an authoritative server (jcenter.bintray.com) 

如何配置的gradle這個-2.2.2.pom文件脫機工作。我已經下載了這個文件,但不知道如何配置它以脫機工作。

回答

0

如果您在Gradle中使用新的插件DSL,您必須定義一個可由構建機訪問的pluginRepository。如果您想直接將本地可用的JAR文件指定爲依賴項,請不要使用新的插件DSL,而是使用舊式的方式將Gradle插件JAR添加到buildscript的類路徑中,然後手動應用插件。