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

标签 android-studio gradle android-gradle-plugin 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 代码块上方。 请帮忙。我在google中没有找到任何解决方案

最佳答案

寻找here看起来是这样的

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

而不是

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

关于android-studio - 没有这样的字段 : maven for class: org. jfrog.gradle.plugin.artifactory.dsl.PublisherConfig,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44542907/

相关文章:

android - 我如何创建 android 应用程序以与 wordpress 集成?

java - 如何始终检查Android中的状况?

gradle - 将嵌套的额外属性从.gradle迁移到.gradle.kts(DSL)

android - Android 项目的 Gradle assembleDebug 失败并出现 aapt 错误

android - 如何修复 "Content is not allowed in prolog"构建错误?

android-studio - 在安装新应用之前,自动卸载旧应用

android - Material 对话框库 :Failed to find: com. android.support :appcompat-v7:21. 0.3

Android Studio 渲染问题

java - 将 Gradle 源文件夹标记为 IntelliJ 中的测试源

Android Studio - 找不到 native 方法 - 在构建中包含 .so 文件