I am not able to build my 2.3.7 grails projects since the maven central repository has moved to https. I tried the recommandations on this post : Requests to http://repo1.maven.org/maven2/ return a 501 HTTPS Required status and a body
However I'am still having an issue because the maven repo is coded in the framework jars ( grails-aether-2.3.7-sources.jar ) The class is org.codehaus.groovy.grails.resolve.maven.aether.config.RepositoriesConfinguration.groovy.
RemoteRepository mavenCentral(Closure configurer = null) {
final existing = repositories.find { ArtifactRepository ar -> ar.id == "mavenCentral" }
if (!existing) {
final repositoryBuilder = new RemoteRepository.Builder("mavenCentral", "default", "http://repo1.maven.org/maven2/")
configureRepository(repositoryBuilder, configurer)
final repository = repositoryBuilder.build()
repositories << repository
return repository
}
else {
return existing
}
}
This file is readonly.
How can I fix this issue? I cannot migrate the project to a new Grails version for several reasons. This is the error I got.
16:14:10 + /opt/grails-2.3.7/bin/grails --stacktrace clean 16:14:13 | Loading Grails 2.3.7 16:14:17 | Configuring classpath 16:14:20 | Error Resolve error obtaining dependencies: Failed to read artifact descriptor for xalan:serializer:jar:2.7.1 (NOTE: Stack trace has been filtered. Use --verbose to see entire trace.) 16:14:20 org.eclipse.aether.resolution.ArtifactDescriptorException: Failed to read artifact descriptor for xalan:serializer:jar:2.7.1 16:14:20 at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom(DefaultArtifactDescriptorReader.java:335) 16:14:20 at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.readArtifactDescriptor(DefaultArtifactDescriptorReader.java:217) 16:14:20 at org.eclipse.aether.internal.impl.DefaultDependencyCollector.process(DefaultDependencyCollector.java:466) 16:14:20 at org.eclipse.aether.internal.impl.DefaultDependencyCollector.collectDependencies(DefaultDependencyCollector.java:261) 16:14:20 at org.eclipse.aether.internal.impl.DefaultRepositorySystem.collectDependencies(DefaultRepositorySystem.java:317) 16:14:20 at grails.util.BuildSettings.doResolve(BuildSettings.groovy:513) 16:14:20 at grails.util.BuildSettings.doResolve(BuildSettings.groovy) 16:14:20 at grails.util.BuildSettings$_getDefaultBuildDependencies_closure17.doCall(BuildSettings.groovy:774) 16:14:20 at grails.util.BuildSettings$_getDefaultBuildDependencies_closure17.doCall(BuildSettings.groovy) 16:14:20 at grails.util.BuildSettings.getDefaultBuildDependencies(BuildSettings.groovy:768) 16:14:20 at grails.util.BuildSettings.getBuildDependencies(BuildSettings.groovy:673) 16:14:20 Caused by: org.eclipse.aether.resolution.ArtifactResolutionException: Could not transfer artifact xalan:serializer:pom:2.7.1 from/to mavenCentral (http://repo1.maven.org/maven2/ ): HTTPS Required (501) 16:14:20 at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:460) 16:14:20 at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:262) 16:14:20 at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifact(DefaultArtifactResolver.java:239) 16:14:20 at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom(DefaultArtifactDescriptorReader.java:320) 16:14:20 ... 10 more 16:14:20 Caused by: org.eclipse.aether.transfer.ArtifactTransferException: Could not transfer artifact xalan:serializer:pom:2.7.1 from/to mavenCentral (http://repo1.maven.org/maven2/ ): HTTPS Required (501) 16:14:20 at org.eclipse.aether.connector.basic.ArtifactTransportListener.transferFailed(ArtifactTransportListener.java:43) 16:14:20 at org.eclipse.aether.connector.basic.BasicRepositoryConnector$TaskRunner.run(BasicRepositoryConnector.java:342) 16:14:20 at org.eclipse.aether.util.concurrency.RunnableErrorForwarder$1.run(RunnableErrorForwarder.java:67) 16:14:20 at org.eclipse.aether.connector.basic.BasicRepositoryConnector$DirectExecutor.execute(BasicRepositoryConnector.java:649) 16:14:20 at org.eclipse.aether.connector.basic.BasicRepositoryConnector.get(BasicRepositoryConnector.java:247) 16:14:20 at org.eclipse.aether.internal.impl.DefaultArtifactResolver.performDownloads(DefaultArtifactResolver.java:536) 16:14:20 at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:437) 16:14:20 ... 13 more 16:14:20 Caused by: org.apache.http.client.HttpResponseException: HTTPS Required (501) 16:14:20 at org.eclipse.aether.transport.http.HttpTransporter.handleStatus(HttpTransporter.java:404) 16:14:20 at org.eclipse.aether.transport.http.HttpTransporter.execute(HttpTransporter.java:298) 16:14:20 at org.eclipse.aether.transport.http.HttpTransporter.implGet(HttpTransporter.java:250) 16:14:20 at org.eclipse.aether.spi.connector.transport.AbstractTransporter.get(AbstractTransporter.java:59) 16:14:20 at org.eclipse.aether.connector.basic.BasicRepositoryConnector$GetTaskRunner.runTask(BasicRepositoryConnector.java:418) 16:14:20 at org.eclipse.aether.connector.basic.BasicRepositoryConnector$TaskRunner.run(BasicRepositoryConnector.java:337) 16:14:20 ... 18 more