【问题标题】:No such field: maven for class: org.jfrog.gradle.plugin.artifactory.dsl.PublisherConfig没有这样的字段:类的Maven:org.jfrog.gradle.plugin.artifactory.dsl.PublisherConfig
【发布时间】:2017-06-14 11:00:49
【问题描述】:

我尝试使用 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 代码块之上。 请帮忙。我在谷歌没有找到任何解决方案

【问题讨论】:

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


    【解决方案1】:

    here 好像是

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

    代替

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-09-18
      • 2014-06-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-03-29
      • 1970-01-01
      相关资源
      最近更新 更多