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'
}