没有这样的字段:maven for class:org.jfrog.gradle.plugin.artifactory.dsl.PublisherConfig

时间:2017-06-14 11:00:50

标签: android-studio gradle android-gradle build.gradle

我尝试使用android studio构建java库,并希望在我的本地神器中托管。 我中午遇到这个问题。尝试不同的代码,但没有改进。

buildscript {
repositories {
    jcenter()
}
repositories {
    maven {
        url 'http://localhost:8081/artifactory/libs-release-local'
        credentials {
            username = "${artifactory_user}"
            password = "${artifactory_password}"
        }
        name = "maven-main-cache"
    }
}
dependencies {
    classpath "org.jfrog.buildinfo:build-info-extractor-gradle:3.0.1"
}
}
project.getExtensions().getByName("ext")
apply plugin: 'scala'
apply plugin: 'maven-publish'
apply plugin: "com.jfrog.artifactory"

version = '1.0.0-SNAPSHOT'
group = 'com.buransky'

repositories {
    add buildscript.repositories.getByName("maven-main-cache")
}

dependencies {
    compile 'org.scala-lang:scala-library:2.11.2'
}

tasks.withType(ScalaCompile) {
    scalaCompileOptions.useAnt = false
}

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

    }
    defaults {
        publications ('mavenJava')
    }
}
}

publishing {
    publications {
        mavenJava(MavenPublication) {
            from components.java
        }
    }
}

在我的build.gradle代码块之上。 请帮忙。我没有在谷歌找到任何解决方案

1 个答案:

答案 0 :(得分:3)

here看起来好像是

artifactory {
    publish {
        repository {
            ivy {
                mavenCompatible = true
            }
        }
    }
} 

而不是

artifactory {
    publish {
        repository {
            maven = true
        }
    }
}