cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Maven central repository link broken

lszabados
Discoverer
8,664

Hi There,

we are using SAP Commerce 1808 and getting the following error today (15.01)

Unable to get resource 'org.apache.maven:apache-maven:pom:3.2.5' from repository central (http://repo1.maven.org/maven2): Error transferring file: Server returned HTTP response code: 501 for URL: http://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.2.5/apache-maven-3.2.5.pom
[null] An error has occurred while processing the Maven artifact tasks.

It was announced that from today maven central will not support http just https and the url https://repo1.maven.org/maven2/ must be updated everywhere.

Is there a way to overwrite the "m2.repo" property?

Unfortunately changing it in the libraries.properties file does not help.

Thanks!

Accepted Solutions (1)

Accepted Solutions (1)

Former Member

You can create a "settings.xml" file into ~/.m2 folder with this:

<mirrors>
    <mirror>
      <id>centralhttps</id>
      <mirrorOf>central</mirrorOf>
      <name>Maven central https</name>
      <url>https://repo1.maven.org/maven2/</url>
    </mirror>
  </mirrors>

However, on the SAP Commerce Cloud build, it won't work.

lszabados
Discoverer

Thanks that solved the problem. We had to do this on Jenkins to be able to build again (on-premise project).

r_spiegel
Member
<settings></settings>

is missing. See answer from aaron.brill

Answers (5)

Answers (5)

Former Member

lszabados & s.cremer when creating a "settings.xml" file in the ~/.m2 folder make sure to enclose the above code Rafa provided in a <settings/> tag, like this:

<settings>
  <mirrors>
      <mirror>
        <id>centralhttps</id>
        <mirrorOf>central</mirrorOf>
        <name>Maven central https</name>
        <url>https://repo1.maven.org/maven2/</url>
      </mirror>
  </mirrors>
</settings>

I had the same exact issue and tried this solution myself and my build succeeds now 🙂

Thank you rafacastelblanque for helping to point us in the right direction!

Aaron

scremer
Explorer

I did wrap the <mirrors/> tag within a <settings/> tag, at least I thought so.

However, I tried again and it seems to work for now. Thanks rafacastelblanque and aaron.brill .

StefanKruk
Active Participant
0 Likes

For those who are using CCV2. SAP documented a solution here: https://jira.hybris.com/browse/ECP-466

Workaround for CCV2

Tell the Customers to not use this functionality (usemaven=true) and commit the libraries into the repository with source code (extension's lib directory and web/webroot/WEB-INF/lib directory if web module is enabled)

lszabados
Discoverer
0 Likes

For those with CCV2: you have to contact SAP about this. As far as I heard from other teams, it will take about 1-2weeks until ccv2 is fixed, but they are trying to find a workaround.

Former Member
0 Likes

Hi we have same problem, is possilble use the maven dependencies in ccv2. Our project is before migration from on-prem to CCV2. I'm afraid of CCV2.

scremer
Explorer
0 Likes

We're experiencing the same problem. Is there a fix available or in the pipeline?

A fix by creating a "settings.xml" file in ~/.m2 doesn't work for us.

former_member750390
Discoverer
0 Likes

I have the same problem, I use macOS, have you been able to fix it?

scremer
Explorer
0 Likes

In the end the answer of Aaron Brill fixed it for us.