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

Why does Hybris ship insecure http maven repository URL? And why can't we override it?

apache-ant/lib/libraries.properties

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

http URL 运送 Hybris 有什么意义?
一开始就无法访问,更不用说下载了。
理想情况下,它应该是 https URL.

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

我尝试通过在 local.properties 中重新声明此 属性 来 覆盖 它。当那个没有pick新值的时候,我在apache-ant/lib/libraries.properties中改成了https,但是它还是在picking 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 将不起作用,因为 Hybris 没有加载这样的 属性。您可以通过在 hAC > Platform > Configuration(或直接在 https://localhost:9002/platform/config)中搜索 m2.repo 来验证它。

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

When that did not pick the new value, I changed it to https in apache-ant/lib/libraries.properties, but it is still picking http. How to override this property?

如果你提到你看到它采摘的地方会很有帮助 http。请提及复制此行为的步骤。