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

skp*_*aik 2 gradle android-studio build.gradle android-gradle-plugin

我尝试使用 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
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

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

lan*_*ava 5

这里看起来就像是

artifactory {
    publish {
        repository {
            ivy {
                mavenCompatible = true
            }
        }
    }
} 
Run Code Online (Sandbox Code Playgroud)

代替

artifactory {
    publish {
        repository {
            maven = true
        }
    }
} 
Run Code Online (Sandbox Code Playgroud)