-
Bug
-
Resolution: Fixed
-
Blocker
-
None
-
Jenkins 2.204.1 with repository-connector-plugin 1.2.6
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.GlobalConfigurationdef 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
- is duplicated by
-
JENKINS-62581 Artifact resolver using http maven central
- Closed