为什么 Hybris 会发布不安全的 http maven 存储库 URL?为什么我们不能覆盖它?



Inapache-ant/lib/libraries.properties

m2.repo

=http://repo1.maven.org/maven2/

使用httpURL 运送 Hybris 有什么意义?
首先无法访问它,更不用说用于下载了。
理想情况下,它应该是一个httpsURL。

m2.repo

=https://repo1.maven.org/maven2/

我尝试通过在local.properties中重新声明此属性来覆盖它。当它没有选择新值时,我在apache-ant/lib/libraries.properties中将其更改为https,但它仍然http.如何覆盖此属性?

错误日志:

[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: Operation timed out (Connection timed out)
[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: Operation timed out (Connection timed out)
[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

您可以通过设置 $HOME/.m2/settings.xml 文件来覆盖它。

例如:

<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<profiles>
<profile>
<id>default</id>
<repositories>
<repository>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
<id>central</id>
<url>https://repo1.maven.org/maven2</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
<id>central</id>
<url>https://repo1.maven.org/maven2</url>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
<activeProfiles>
<activeProfile>default</activeProfile>
</activeProfiles>
</settings>

local.properties中重新声明m2.repo不起作用,因为 Hybis 没有加载这样的属性。您可以通过在hAC>平台>配置中搜索m2.repo来验证它(或直接在 https://localhost:9002/platform/config 中搜索(。

如果您执行ant,则在apache-ant/lib/libraries.properties中修改它应该有效。如果不是这种情况,请告诉我,我会尝试找到其他选择。

当它没有选择新值时,我将其更改为httpsapache-ant/lib/libraries.properties,但它仍然在挑选http。如何 覆盖此属性?

如果您提到您在哪里看到它挑选http,那将很有帮助。请提及复制此行为的步骤。

最新更新