I'm using this plugin:
apply plugin: 'maven'
How can I specify an artifactId that is NOT the project/folder name?
I already use this:
jar {
archiveName = "myproject.jar"
}
But this is not what the plugin uses.
I'm using this plugin:
apply plugin: 'maven'
How can I specify an artifactId that is NOT the project/folder name?
I already use this:
jar {
archiveName = "myproject.jar"
}
But this is not what the plugin uses.
Do you have an uploadArchives section in your build.gradle? You can do this to customize the published artifact:
uploadArchives {
repositories {
mavenDeployer {
repository(url: "file://localhost/tmp/myRepo/")
pom.version = '1.0Maven'
pom.artifactId = 'myMavenName'
}
}
}
See maven plugin documentation for reference
From the Users Guide:
31.6.4. Maven POM generation
When deploying an artifact to a Maven repository, Gradle automatically generates a POM for it. The groupId, artifactId, version and packaging elements used for the POM default to the values shown in the table below. The dependency elements are created from the project's dependency declarations.
Table 31.5. Default Values for Maven POM generation Maven Element Default Value groupId project.group artifactId uploadTask.repositories.mavenDeployer.pom.artifactId (if set) or archiveTask.baseName. version project.version packaging archiveTask.extension
Here, uploadTask and archiveTask refer to the tasks used for uploading and generating the archive, respectively (for example uploadArchives and jar). archiveTask.baseName defaults to project.archivesBaseName which in turn defaults to project.name.