Publish a zip and pom from a non-java gradle project

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Publish a zip and pom from a non-java gradle project

roomsg
Working with Jenkins + gradle + artifactory + the artifactory_gradle plugin.
Have gradle create a zip file and get that uploaded to artifactory works fine.
What does not work is to upload an associated pom file, even though the "publish Maven descriptors" option is checked in jenkins.

Cause (ref log):
"Cannot publish pom for project ':' since it does not contain the Maven plugin install task and task ':artifactoryPublish' does not specify a custom pom path."

I have the maven plugin added in my gradle build, however the install task does not "show up" in a plain (non-java) gradle project.

I tried to apply the java plugin as well, that generates a pom, yet a pom that is associated with an extra (empty) jar that got published as well.

Is there any other way of getting zip + pom into artifactory from gradle/jenkins ?


Reply | Threaded
Open this post in threaded view
|

Re: Publish a zip and pom from a non-java gradle project

tayloryork
I found an answer to this!

Because the target is complaining that there is no install or pom, create them both.

task install (type: Upload) {
    repositories.mavenInstaller {
        pom.version = project.version
        pom.artifactId = project.name
        pom.groupId = project.group
        pom.packaging = "zip"
    }
    configuration = project.configurations.getByName(Dependency.ARCHIVES_CONFIGURATION)
}