构建项目时使用参数“ LATEST”不适用于“ mvn全新安装”

时间:2018-11-08 14:26:09

标签: s4sdk

如果在生成项目时使用“ LATEST”参数,则“ mvn clean install”命令会出错。应该使用此参数还是应在命令中提供最新版本?

mvn archetype:generate "-DarchetypeGroupId=com.sap.cloud.s4hana.archetypes" "-DarchetypeArtifactId=scp-cf-tomee" **"-DarchetypeVersion=LATEST**" "-DgroupId=com.sap.cloud.s4hana.examples" "-DartifactId=my-app" "-Dversion=1.0-SNAPSHOT"

错误是

Error:
[INFO] Scanning for projects...
Downloading: https://repo.maven.apache.org/maven2/org/springframework/spring-framework-bom/5.1.1.RELEASE/spring-framework-bom-5.1.1.RELEASE.pom
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[ERROR] Non-resolvable import POM: Could not transfer artifact org.springframework:spring-framework-bom:pom:5.1.1.RELEASE from/to central (https://repo.maven.apache.org/maven2): proxy.myproxy.corp @ com.sap.cloud.s4hana:sdk-bom:2.7.1-SNAPSHOT, C:\Users\xxxxxxx\.m2\repository\com\sap\cloud\s4hana\sdk-bom\2.7.1-SNAPSHOT\sdk-bom-2.7.1-SNAPSHOT.pom, line 994, column 25
 @[ERROR] The build could not read 1 project -> [Help 1]
[ERROR][ERROR]   The project com.sap.cloud.s4hana.examples:address-manager1:1.0-SNAPSHOT (C:\my-app\pom.xml) has 1 error
[ERROR]     Non-resolvable import POM: Could not transfer artifact org.springframework:spring-framework-bom:pom:5.1.1.RELEASE from/to central (https://repo.maven.apache.org/maven2): proxy.wdf.sap.corp @ com.sap.cloud.s4hana:sdk-bom:2.7.1-SNAPSHOT, C:\Users\xxxxxx\.m2\repository\com\sap\cloud\s4hana\sdk-bom\2.7.1-SNAPSHOT\sdk-bom-2.7.1-SNAPSHOT.pom, line 994, column 25: Unknown host proxy.myproxy.corp -> [Help 2]
[ERROR][ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR][ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException

2 个答案:

答案 0 :(得分:4)

版本2.7.1-SNAPSHOT不是发行版。外部不可用(Maven中央)。因此,您不能从Maven Central下载它。但是,2.6.1可用。这就是为什么它起作用。

请尝试使用RELEASE而不是LATEST,或者直接更好地使用已发布的版本。

还请检查settings.xml是否未指向内部快照关系服务器,然后删除.m2目录中的本地存储库。

答案 1 :(得分:3)

您检查了网络配置吗?

我可以在日志中看到代理和未知主机错误。