What is the appropriate settings.xml to use these days?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

What is the appropriate settings.xml to use these days?

Mez Pahlan
Hi everyone

I'm getting the following error whilst trying to build a PR branch from a contributor. They've bumped the parent POM version and minimum supported Jenkins version and those changes look fine. However I can't download the new artefacts from this PR which then causes some knock on issues in my IDE.

Could not transfer artifact org.jenkins-ci.main:jenkins-bom:pom:2.222.3 from/to repo.jenkins-ci.org (https://repo.jenkins-ci.org/public/): ~/.m2/repository/org/jenkins-ci/main/jenkins-bom/2.222.3/jenkins-bom-2.222.3.pom.part.lock (No such file or directory)

I started to look at my Maven settings.xml just in case and realised I added that about two years ago and it may be out of date. So to rule that out can anyone share a link of what the settings.xml should contain. I realise it is highly personal to the developer but I only use Maven for Jenkins development if that helps? At the moment I've got:
  • <pluginGroups>
    • <pluginGroup>org.jenkins-ci.tools</pluginGroup>
  • <profiles>
    • Defining the repositories and pluginRepositories
    • Both pointing to https://repo.jenkins-ci.org
  • <mirrors>
    • A mirror for m.g.o-public ????
    • Pointing to https://repo.jenkins-ci.org
  • <servers>
    • My secrets for plugin publishing
Does that seem sensible? If so I can troubleshoot elsewhere. Thanks.

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/ef07ef09-6ddc-42b8-a0e0-007553376ce0n%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: What is the appropriate settings.xml to use these days?

Mez Pahlan
Haha! It's always the way that you post a question and then figure out the answer straight afterwards!

To update this the error was a genuine permissions issue. I told a small lie above I did once dabble in using Docker and Jenkins on this machine and that messed up the permissions in the .m2 directory and set some folders as being owned by root. I deleted .m2 and started again and I was able to sync dependencies once more.

However I am still curious as to what I should be putting in my settings.xml as the last time I touched it was when I first started Jenkins plugin development and that was years ago.

On Monday, 12 October 2020 at 12:05:57 UTC+1 Mez Pahlan wrote:
Hi everyone

I'm getting the following error whilst trying to build a PR branch from a contributor. They've bumped the parent POM version and minimum supported Jenkins version and those changes look fine. However I can't download the new artefacts from this PR which then causes some knock on issues in my IDE.

Could not transfer artifact org.jenkins-ci.main:jenkins-bom:pom:2.222.3 from/to repo.jenkins-ci.org (https://repo.jenkins-ci.org/public/): ~/.m2/repository/org/jenkins-ci/main/jenkins-bom/2.222.3/jenkins-bom-2.222.3.pom.part.lock (No such file or directory)

I started to look at my Maven settings.xml just in case and realised I added that about two years ago and it may be out of date. So to rule that out can anyone share a link of what the settings.xml should contain. I realise it is highly personal to the developer but I only use Maven for Jenkins development if that helps? At the moment I've got:
  • <pluginGroups>
    • <pluginGroup>org.jenkins-ci.tools</pluginGroup>
  • <profiles>
  • <mirrors>
  • <servers>
    • My secrets for plugin publishing
Does that seem sensible? If so I can troubleshoot elsewhere. Thanks.

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/ce6535a3-2e5b-478b-9c3b-b9cf34ca894en%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: What is the appropriate settings.xml to use these days?

Jesse Glick-4
On Mon, Oct 12, 2020 at 7:36 AM Mez Pahlan <[hidden email]> wrote:
> I am still curious as to what I should be putting in my settings.xml

You do not really need one at all, as all Jenkins components declare
the Jenkins Artifactory repository.

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CANfRfr24ooZSNbXfwzD0mLiK8AtQqz3aTn2L9tuLh_fJOVTNuQ%40mail.gmail.com.
Reply | Threaded
Open this post in threaded view
|

Re: What is the appropriate settings.xml to use these days?

Daniel Beck-2


On Mon, Oct 12, 2020 at 7:19 PM Jesse Glick <[hidden email]> wrote:
On Mon, Oct 12, 2020 at 7:36 AM Mez Pahlan <[hidden email]> wrote:
> I am still curious as to what I should be putting in my settings.xml

You do not really need one at all, as all Jenkins components declare
the Jenkins Artifactory repository.

Well, credentials to publish, but that's probably about it. Documented at https://www.jenkins.io/doc/developer/publishing/releasing/#artifactory-credentials-for-maven 

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CAMo7Pt%2B0Eg7EUGQjR3HmT5iAvHdYskC3Jztrwp7Et_v1qys4Lw%40mail.gmail.com.
Reply | Threaded
Open this post in threaded view
|

Re: What is the appropriate settings.xml to use these days?

Mez Pahlan
Thanks for the pointers!

For anyone else looking as well as the credentials for publishing in my ~/.m2/settings.xml I also needed to add a mirrors section otherwise I started to get weird dependency resolution issues. It looks like this at the moment which is significantly smaller to what I had to start with.

<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">

  <mirrors>
    <mirror>
      <mirrorOf>*</mirrorOf>
      <name>public</name>
      <url>https://repo.jenkins-ci.org/public</url>
      <id>public</id>
    </mirror>
  </mirrors>

  <servers>
    <server>
      <id>maven.jenkins-ci.org</id> <!-- For parent 1.397 or newer; this ID is used for historical reasons and independent of the actual host name -->
      <username>username</username>
      <password>encrypted_password</password>
    </server>
  </servers>

</settings>


Without the mirrors section I was getting the following error: Could not find artifact org.jenkins-ci.tools:maven-hpi-plugin:pom in central (https://repo.maven.apache.org/maven2). That plugin is clearly not in the Central repo which lead me down the path trying to understand mirrors when I came across this answer.

I hope this helps someone for the future.

On Monday, 12 October 2020 at 18:55:21 UTC+1 [hidden email] wrote:
On Mon, Oct 12, 2020 at 7:19 PM Jesse Glick <[hidden email]> wrote:
On Mon, Oct 12, 2020 at 7:36 AM Mez Pahlan <[hidden email]> wrote:
> I am still curious as to what I should be putting in my settings.xml

You do not really need one at all, as all Jenkins components declare
the Jenkins Artifactory repository.

Well, credentials to publish, but that's probably about it. Documented at https://www.jenkins.io/doc/developer/publishing/releasing/#artifactory-credentials-for-maven 

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/5d32803c-9216-4740-bfdd-8c076a4cf7d2n%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: What is the appropriate settings.xml to use these days?

Daniel Beck-2

On Sat, Nov 7, 2020 at 4:35 PM Mez Pahlan <[hidden email]> wrote:
Without the mirrors section I was getting the following error: Could not find artifact org.jenkins-ci.tools:maven-hpi-plugin:pom in central (https://repo.maven.apache.org/maven2). That plugin is clearly not in the Central repo which lead me down the path trying to understand mirrors when I came across this answer.

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/CAMo7PtK6HQVVDezOmJ62bcqRynnLAJ0AM0CAKOhUCwDoR%3DQpdQ%40mail.gmail.com.
Reply | Threaded
Open this post in threaded view
|

Re: What is the appropriate settings.xml to use these days?

Mez Pahlan
Thanks it does. https://github.com/jenkinsci/appcenter-plugin/blob/master/pom.xml#L229

Maybe there is something interfering in my IDE? Apologies I don't often use Maven so am learning (relearning) a lot of this for the first time.

On Saturday, 7 November 2020 at 17:34:43 UTC [hidden email] wrote:
On Sat, Nov 7, 2020 at 4:35 PM Mez Pahlan <[hidden email]> wrote:
Without the mirrors section I was getting the following error: Could not find artifact org.jenkins-ci.tools:maven-hpi-plugin:pom in central (https://repo.maven.apache.org/maven2). That plugin is clearly not in the Central repo which lead me down the path trying to understand mirrors when I came across this answer.

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/acb090aa-ec61-4aaf-8218-519b1722e10cn%40googlegroups.com.