Gradle Version: 3.5
I am trying to publish my custom RPM artifact, but the documentation is really unclear about how this should be done.
This is an excerpt from our publishing gradle script:
project(':path:to:rpm:project') {
apply plugin: "java"
apply plugin: "maven-publish"
publishing {
repositories {
maven {
credentials {
username 'aaa'
password 'sss'
}
url "https://url/to/repository"
}
}
publications {
pub(MavenPublication) {
artifact 'our-software-rpm' {
}
}
}
}
task rpmArtifact(dependsOn: 'installerMakeRpm') {
ext.rpmfile = file("$project.buildDir/tmp/rpmbuild/RPMS/x86_64/our-software.x86_64.rpm")
}
artifacts {
archives(rpmArtifact.rpmfile) {
name 'our-software-rpm'
type 'rpm'
builtBy rpmArtifact
}
}
assemble.dependsOn rpmArtifact
}
I am unsure how I should reference the custom RPM artifact in the publications closure. Using the artifact name ('our-software-rpm') does not work, using the name of the task (rpmArtifact) does not work either. So what should I do?
Also, the project applies the java plugin to get an ArtifactHandler that actually can accept file artifacts - the DefaultArtifactHandler does not work for that. Is there a better option, because the project really is not a java project and I would prefer not to apply a plugin I don't really need.