I try to use the maven-publish plugin to publish jars to a nexus repository in a multi module project.
The problem is, that the latest artifactId in the jar publications will be set for all subprojects.
How can I create a configuration which only maps to one single jar?
subprojects {
apply plugin: ‘java’
task implJar(type: Jar, dependsOn: classes ) {
baseName project.name
classifier = project.name
from sourceSets.main.output
version scmVersion.version
}
publishing {
publications {
// TODO do this for every module → it will only be done once
jar(MavenPublication) {
artifactId project.name // Problem: This will only be set and reset for every project. That’s why this overwrites the configurations made before
groupId “com.portal”
artifact implJar
}
}
}