Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-60861

Default configuration to Maven Central without HTTPS no longer work

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Blocker
    • Resolution: Fixed
    • Labels:
      None
    • Environment:
      Jenkins 2.204.1 with repository-connector-plugin 1.2.6
    • Similar Issues:

      Description

      Following to Sonatype disabling [1] the HTTP access to Maven Central on January 15th 2020, the plugin doesn't work anymore (if using the default configuration) as requests to http://repo1.maven.org/maven2/ now returns 501 HTTPS Required [2]. More info from Sonatype can be found here [3].

      A code upgrade is required to now use https://repo1.maven.org/maven2/ as the default configuration.

      In the meantime, the current workaround consists to manually edit the link (and add the "s" to "http") in Jenkins Configuration (/jenkins/configure). Also, for systems installed programmatically, one easy workaround consists to drop in the Jenkins install folder (/var/lib/jenkins on Debian systems) the file org.jvnet.hudson.plugins.repositoryconnector.RepositoryConfiguration.xml. The template for this file can be created while manually editing the link on a scratch instance.

      A more elaborated workaround might consist to programmatically configure the plugin. While doing so, one might also take the opportunity to use their repository proxy (nexus, artifactory). Here comes the code snippet I used to configure the plugin (with the standard Maven Central).

      import org.jvnet.hudson.plugins.repositoryconnector.Repository
      import org.jvnet.hudson.plugins.repositoryconnector.RepositoryConfiguration
      import jenkins.model.GlobalConfiguration

      def repos = GlobalConfiguration.all().get(RepositoryConfiguration.class).repositoryMap
      repos.clear()
      repos.put("central", new Repository("central", "default", "https://repo1.maven.org/maven2", null, null, false))

      [1] https://twitter.com/sonatype_ops/status/1217494086090985472
      [2] https://support.sonatype.com/hc/en-us/articles/360041287334
      [3] https://blog.sonatype.com/central-repository-moving-to-https
       

        Attachments

          Issue Links

            Activity

            Hide
            pfo Pierre Fourés added a comment - - edited

            I just created the fix and opened a pull request. See [1] 

            [1] https://github.com/jenkinsci/repository-connector-plugin/pull/39

            Show
            pfo Pierre Fourés added a comment - - edited I just created the fix and opened a pull request. See [1]   [1]   https://github.com/jenkinsci/repository-connector-plugin/pull/39
            Hide
            dhena_smile Dhinadhayalan parry added a comment -

            Hi,

             

            Still this issue prevails in our project Jenkins also. Is this fixed?

             

            Thanks,

            Dhina

            Show
            dhena_smile Dhinadhayalan parry added a comment - Hi,   Still this issue prevails in our project Jenkins also. Is this fixed?   Thanks, Dhina
            Hide
            jgangemi Jae Gangemi added a comment -

            fixed and released in 1.3.1

            Show
            jgangemi Jae Gangemi added a comment - fixed and released in 1.3.1

              People

              Assignee:
              jgangemi Jae Gangemi
              Reporter:
              pfo Pierre Fourés
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: