lsc-project / lsc

LSC engine
http://lsc-project.org/wiki/documentation/latest/start
Other
111 stars 42 forks source link

Broken repositories in pom.xml : shut down/changed behaviour #1

Closed soisik closed 7 years ago

soisik commented 7 years ago

Environment : Apache Maven 3.0.2 & Java 1.6, LSC 2.1.3

Some repositories referenced in the repositories and pluginsRepositories sections of the pom.xml are no longer functional.

Repository https://nexus.codehaus.org/content/repositories/codehaus-snapshots/

Problem

This repository does not exist anymore, See https://support.mulesoft.com/s/article/Codehaus-org-Maven-repositories-shutdown

Solution

As advised in above link, any references to this repositories should be removed of pom.xml.

Repository http://mirrors.ibiblio.org/pub/mirrors/maven2

Problem

The repository is still there, but all requests are redirected to http://maven.ibiblio.org/maven2/. Our version of maven-compiler-plugin (2.3.2) does not seem to handle redirections properly : Instead it stores the 301 http result in the repository in place of pom & jar files, resulting in build failure when he tries to read them :

Downloading: http://mirrors.ibiblio.org/pub/mirrors/maven2/org/apache/directory/api/api-all/1.0.0-M22/api-all-1.0.0-M22.pom
[WARNING] Checksum validation failed, expected <html> but is b113767b47336dcc165c5dd2222b5df4cb86b7ce for http://mirrors.ibiblio.org/pub/mirrors/maven2/org/apache/directory/api/api-all/1.0.0-M22/api-all-1.0.0-M22.pom
[...]
[ERROR] error: error reading /home/sfroger/.m2/repository/org/slf4j/slf4j-api/1.6.0/slf4j-api-1.6.0.jar; error in opening zip file

Solution

Not sure why lsc team project chose to use this mirror as a repository in the first place; My guess is the purpose was to improve building performances. According to https://maven.apache.org/guides/mini/guide-mirror-settings.html, the only official maven mirror is the European central :

<mirror>
   <id>UK</id>
   <name>UK Central</name>
   <url>http://uk.maven.org/maven2</url>
   <mirrorOf>central</mirrorOf>
</mirror>

Other mirrors (including our http://mirrors.ibiblio.org/pub/mirrors/maven2/) referenced in http://repo.maven.apache.org/maven2/.meta/repository-metadata.xml are not supported by maven ("These mirrors may not have the same contents and we don't support them in any way.")

Since I'm in europe, setting the mirror UK central in my settings.xml seems to improve build performances noticeably when dependencies are downloaded. I've removed the mirror http://mirrors.ibiblio.org/pub/mirrors/maven2 from pom.xml with no issue (build complete fine), since I see no reason to keep it.

Notes :

Since project cannot currently build without this fix, this fix will be applied to 2.1.4.

soisik commented 7 years ago

Fixed in 2.1.4

coudot commented 7 years ago

Don't we need to update master branch too?

soisik commented 7 years ago

Fixed by merge in 2.2.0