How do you set the maven artifact ID of a gradle project?

后端 未结 7 722
甜味超标
甜味超标 2021-01-30 03:48

From the gradle maven-publish plugin\'s documentation, it\'s clear that you set the groupId and version of the project directly in build.gradle

7条回答
  •  旧时难觅i
    2021-01-30 04:09

    From 36.2.3. Identity values in the generated POM

    publishing {
        publications {
            maven(MavenPublication) {
                groupId 'org.gradle.sample'
                artifactId 'project1-sample'
                version '1.1'
    
                from components.java
            }
        }
    }
    

    The artifact ID defaults to the project name configured in settings.gradle, which in turn defaults to the project directory's name.

    You'll need the appropriate plugin.

    plugins {
        id 'maven-publish'
    }
    

提交回复
热议问题