I'm writing a REST API and I'm trying to generate and publish a client jar automatically. I've got the jar generating fine, and even publishing to my company's Artifactory server.. but the pom file won't publish with it.
The code for the client jar is being generated by Swagger Codegen. I've got the code generation process integrated into a Bamboo job and am trying to get it to publish the jar from there.
We're using Bamboo 5.0.1 build 3716. I'm using the Maven 3.x
task with the goal clean package
to generate the jar. After that I'm using the Artifactory Generic Deploy
task to upload the jar to our Artifactory server. I've tried also publishing the pom.xml file itself and that doesn't seem to resolve the issue. The other projects in our Artifactory seem to have a .pom
file instead of a pom.xml. I've tried renaming the pom.xml file client-{version}.pom
but when the Artifactory Generic Deploy task attempts to publish this it's getting the error HTTP response code: 409. HTTP response message: Conflict
.
I noticed that there's an Artifactory Maven 3
task so I tried switching to that but I'm getting ClassNotFoundException: org.sonatype.aether.RepositoryListener
whenever I try to run that. It seems that this is an issue with that task since the exception is following Error injecting: org.jfrog.build.extractor.maven.BuildInfoRecorderLifecycleParticipant
.
Why am I getting a Conflict error when I try to publish the .pom file? Am I going about this the wrong way? Would really appreciate being pointed in the right direction.
Upgrading the Bamboo Artifactory plugin resolved this issue. We were using 1.6.0 previously and are now using 1.7.2. We were on Bamboo 5.0.1 and had to upgrade to 5.4.3 to upgrade the plugin.
Using the Artifactory Maven 3
task was the solution to the POM not publishing. To make the pom publish ensure that the final goal is install
. If you have an inclusion pattern make sure it can include the pom. If there's nothing you're trying to exclude from being published I suggest just not using an include pattern.