简体   繁体   English

build.gradle文件有构建问题,未解决“没有此类属性错误”

[英]build.gradle file having problems building, unresolved 'No such property error'

This is the content of my build.gradle file of api module. 这是我的api模块的build.gradle文件的内容。 It is shooting out the below mentioned error. 它正在消除以下提到的错误。

version "1.1.0"

apply plugin: 'java'
apply plugin: 'maven'


// Android support
sourceCompatibility = JavaVersion.VERSION_1_7

dependencies {
    testCompile 'junit:junit:4.11'
    testCompile 'org.mockito:mockito-core:2.0.3-beta'
}

uploadArchives {
    repositories.mavenDeployer {
        repository(url: "http://orchard.internal.mohc.net:8081/artifactory/libs-${version.endsWith("SNAPSHOT") ? "snapshot" : "release"}-local") {
            authentication(userName: artifactoryUsername, password: artifactoryPassword)
        }
    }
}

error: Error:(18, 0) No such property: artifactoryUsername for class: org.gradle.api.publication.maven.internal.deployer.DefaultGroovyMavenDeployer 错误:错误:(18,0)没有这样的属性:articleory类的用户名:org.gradle.api.publication.maven.internal.deployer.DefaultGroovyMavenDeployer

points to line 18. Does anyone knows whats going on? 指向第18行。有人知道发生了什么吗?

As you see in your error message, Gradle is trying to find the property artifactoryUsername, which is actually a value for the property. 正如您在错误消息中看到的那样,Gradle试图查找属性artifactoryUsername,该属性实际上是该属性的值。 Use double quotes for username and password. 用户名和密码使用双引号。

uploadArchives {
repositories.mavenDeployer {
    repository(url: "http://orchard.internal.mohc.net:8081/artifactory/libs-${version.endsWith("SNAPSHOT") ? "snapshot" : "release"}-local") {
        authentication(userName: "artifactoryUsername", password: "artifactoryPassword")
        }
    }
}

You can see example here . 您可以在此处查看示例。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM