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

Default configuration to Maven Central without HTTPS no longer work

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Blocker
    • Resolution: Fixed
    • None
    • Jenkins 2.204.1 with repository-connector-plugin 1.2.6

    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

            pfo Pierre Fourés created issue -
            pfo Pierre Fourés made changes -
            Field Original Value New Value
            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).
            {quote}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))
            {quote}
            [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]
             .

             
            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).
            {quote}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))
            {quote}
            [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]
             
            jgangemi Jae Gangemi made changes -
            Link This issue is duplicated by JENKINS-62581 [ JENKINS-62581 ]
            jgangemi Jae Gangemi made changes -
            Assignee Jae Gangemi [ jgangemi ]
            jgangemi Jae Gangemi made changes -
            Resolution Fixed [ 1 ]
            Status Open [ 1 ] Closed [ 6 ]

            People

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

              Dates

                Created:
                Updated:
                Resolved: