gradle为maven创建依赖关系,构建失败

时间:2018-10-25 20:44:16

标签: java maven gradle maven-plugin

我想创建一个示例依赖项,从gradle项目到项目再到maven

apply plugin: "maven-publish"
apply plugin: "java"

repositories {
    mavenLocal()
}

sourceSets {
    main {
        java {
            srcDirs 'java'
        }

        resources {
            srcDirs 'build'
        }
    }
}

task sourcesJar(type: Jar) {
    from 'build/libs'
    classifier = 'sources'
}

publishing {

    publications {
        maven(MavenPublication) {
            groupId = 'or.gradle.sample'
            artifactId = 'sort-array'
            version = '1.1'

            artifact sourcesJar
        }
    }
    repositories {
        mavenLocal()
    }
}

但是当我键入:

gradle publishToMavenLocal

我有日志:

... Publishing to repository null .... 

和构建失败

0 个答案:

没有答案