协议在 maven 和 Hybris 中从 HTTP 更改为 HTTPS
Protocol changing from HTTP to HTTPS in maven & Hybris
我尝试在 Hybris 中执行 ant all 命令时遇到了麻烦。我已经完成了 Maven 的配置,即将 settings.xml 文件添加到我的 Mac 中的 m2 文件夹中。问题是文件 settings.xml 没有覆盖将 HTTP 协议更改为 HTTPS 的配置。谁能帮我解决这个问题?
我的settings.xml文件代码:
<settings>
<mirrors>
<mirror>
<id>centralhttps</id>
<mirrorOf>central</mirrorOf>
<name>Maven central https</name>
<url>https://repo1.maven.org/maven2/</url>
</mirror>
</mirrors>
</settings>
日志:
[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
我找到了解决办法。我只需要将 settings.xml 文件添加到 {hybris.home}/bin/platform/apache-ant/etc/settings.xml 目录。
我尝试在 Hybris 中执行 ant all 命令时遇到了麻烦。我已经完成了 Maven 的配置,即将 settings.xml 文件添加到我的 Mac 中的 m2 文件夹中。问题是文件 settings.xml 没有覆盖将 HTTP 协议更改为 HTTPS 的配置。谁能帮我解决这个问题?
我的settings.xml文件代码:
<settings>
<mirrors>
<mirror>
<id>centralhttps</id>
<mirrorOf>central</mirrorOf>
<name>Maven central https</name>
<url>https://repo1.maven.org/maven2/</url>
</mirror>
</mirrors>
</settings>
日志:
[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
我找到了解决办法。我只需要将 settings.xml 文件添加到 {hybris.home}/bin/platform/apache-ant/etc/settings.xml 目录。