2013-07-21 112 views
0

剛開始使用artifactory,以管理我使用的所有庫。所以我必須有artifactory插件。我用截屏教程在http://www.jfrog.com/confluence/display/RTF/Gradle+Artifactory+Plugin並添加buildScript如下下載插件..Gradle:非法重複錯誤

buildscript { 

repositories { 

    maven { url 'http://localhost:8081/artifactory/plugins-release' 

     credentials { 
      username = "${artifactory_user}" 
      password = "${artifactory_password}" 
     } 
    } 
} 

    dependencies { 

     classpath (
      group: 'org.jfrog.buildinfo', name: 
           'build-info-extractor-gradle', version: '2.1.0' 
     ) 
    } 

}

然後在我gradleUserHomeDir gradle.properties文件,我有如下,密碼被加密由artifactory。

artifactory_user=admin 
artifactory_password={DESede}ifW8DYgu849GR8EnzUMOlj/L8cwy6FQfRZgHHTyj9L0= 
artifactory_contextUrl=http://localhost:8081/artifactory 

然後我跑了gradle任務。該插件被下載是的,但出了問題。這是輸出

TaskContainer.add()方法已被棄用,並計劃在Gradle 2.0中刪除。請改用create()方法。

失敗:生成失敗,出現異常。

  • 其中: 構建文件 'S:\ SRC \ JEE-工作區\ movieplex7 \的build.gradle' 行:47

  • 出了什麼問題: 的問題發生評估根項目 'movieplex7' 。

    非法重複 {} DESede ifW8DYgu849GR8EnzUMOlj/L8cwy6FQfRZgHHTyj9L0 =

這裏是的build.gradle

buildscript { 

repositories { 

    maven { url 'http://localhost:8081/artifactory/plugins-release' 

     credentials { 
      username = "${artifactory_user}" 
      password = "${artifactory_password}" 
     } 
    } 
} 

    dependencies { 

     classpath (
      group: 'org.jfrog.buildinfo', 
          name: 'build-info-extractor-gradle', version: '2.1.0' 
     ) 
    } 
} 

apply plugin: 'war' 
apply plugin: 'maven' 
apply plugin: 'eclipse-wtp' 
apply plugin: 'artifactory' 


project.description = 'Java EE 7 Hands-on Lab' 
version= '1.0' 
group = 'org.glassfish.movieplex7' 

artifactory { 

contextUrl = "${artifactory_contextUrl}" 
publish { 
    repository { 
     repoKey = 'libs-release-local' 
     username = "${artifactory_user}" 
     password = "${artifactory_password}" 
     maven = true 
    } 
} 

resolve { 

    repository { 
     repoKey = 'libs-release' username = "${artifactory_user}" 
        password = "${artifactory_password}" maven = true 
    } 
} 


} 

dependencies { 

providedCompile 'javax:javaee-api:7.0' 
//providedCompile 'org.glassfish.main.extras:glassfish-embedded-web:4.0' 

}

回答

0

當我把每次工作突然財產在自己的行這樣的

`repoKey = '庫釋放'

用戶名= 「$ {} artifactory_user」

密碼= 「$ {} artifactory_password」

行家= TRUE;

+0

我不沒有看到差異。無論如何,您可以簡單地使用'artifactory_user'來代替''{artifactory_user}「'。其他屬性也一樣。 –