I've faced trouble when I was trying to execute ant all command in Hybris. I've done configuration for maven i.e. added settings.xml file to m2 folder in my Mac. The problem is that the file settings.xml doesn't override the configuration which changes the HTTP protocol to HTTPS. Could anyone help me fix this issue?
My settings.xml file code:
<settings>
<mirrors>
<mirror>
<id>centralhttps</id>
<mirrorOf>central</mirrorOf>
<name>Maven central https</name>
<url>https://repo1.maven.org/maven2/</url>
</mirror>
</mirrors>
</settings>
The log:
[artifact:mvn] Downloading: org/apache/maven/apache-maven/3.2.5/apache-maven-3.2.5.pom from repository central at http://repo1.maven.org/maven2
[artifact:mvn] 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
[artifact:mvn] [WARNING] 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
[artifact:mvn] Downloading: org/apache/maven/apache-maven/3.2.5/apache-maven-3.2.5.pom from repository central at http://repo1.maven.org/maven2
[artifact:mvn] 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
[artifact:mvn] [WARNING] 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.
[null] Diagnosis:
[null]
[null] Unable to resolve artifact: Missing:
[null] ----------
[null] 1) org.apache.maven:apache-maven:pom:3.2.5
[null] Path to dependency:
[null] 1) org.apache.maven:super-pom:pom:2.0
[null] 2) org.apache.maven:apache-maven:pom:3.2.5
[null]
[null] ----------
[null] 1 required artifact is missing.
[null]
[null] for artifact:
[null] org.apache.maven:super-pom:pom:2.0
[null]
[null] from the specified remote repositories:
[null] central (http://repo1.maven.org/maven2)
[null]
[null]
BUILD FAILED
I've found the solution. I just had to add settings.xml file to {hybris.home}/bin/platform/apache-ant/etc/settings.xml directory.