Gradle:非法重复错误

时间:2013-07-21 14:39:59

标签: plugins gradle repository

刚开始使用artifactory来管理我使用的所有库..因此我必须拥有artifactory插件。我在http://www.jfrog.com/confluence/display/RTF/Gradle+Artifactory+Plugin使用了截屏教程,并按如下方式添加了buildScript以下载插件..

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-Workspace \ 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'

}

1 个答案:

答案 0 :(得分:0)

当我把每个属性都放在自己的行中时,它会突然发挥作用

`repoKey ='libs-release'

username =“$ {artifactory_user}”

password =“$ {artifactory_password}”

maven = true`