Setting up your Maven settings.xml to release a Jenkins plugin

Featured image for sharing metadata for article

I'm technically a maintainer for the Jenkins Job DSL Plugin. I say technically because I've not been able to spend as much time on it since picking up maintenance, especially as no longer doing much Jenkins or JVM development. But today I picked up doing a release, and as it's the first time since the excellent refreshed the plugin, migrating it from Gradle to Maven, I'd ended up needing to do a little setup first.

While trying to release, I saw an error like:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:3.1.1:deploy (default-deploy) on project job-dsl-parent: Failed to deploy artifacts: Could not transfer artifact org.jenkins-ci.plugins:job-dsl-parent:pom:... from/to maven.jenkins-ci.org (https://repo.jenkins-ci.org/snapshots/): authentication failed for https://repo.jenkins-ci.org/snapshots/org/jenkins-ci/plugins/job-dsl-parent/1.86-SNAPSHOT/job-dsl-parent-....pom, status: 401 Unauthorized -> [Help 1]

This was because my Maven settings.xml wasn't configured to push to the Jenkins Maven repository, which required the following in ~/.m2/settings.xml:

<settings>
  <servers>
    <server>
      <id>maven.jenkins-ci.org</id>
      <username>{TODO}</username>
      <password>{TODO}</password>
    </server>
  </servers>
</settings>

These are the credentials you use to log into Jenkins' JIRA or Jenkins.

Written by Jamie Tanna's profile image Jamie Tanna on , and last updated on .

Content for this article is shared under the terms of the Creative Commons Attribution Non Commercial Share Alike 4.0 International, and code is shared under the Apache License 2.0.

#blogumentation #jenkins #maven.

This blog post is 100% human-written, and has nothing derived from LLMs (be it code, editorial support or prose).

This post was filed under articles.

Interactions with this post

Interactions with this post

Below you can find the interactions that this page has had using WebMention.

Have you written a response to this post? Let me know the URL:

Do you not have a website set up with WebMention capabilities? You can use Comment Parade.