Apache 无法传输项目:未解释settings.xml属性
我正在尝试基于以下项目构建gitlab ci:Apache 无法传输项目:未解释settings.xml属性,apache,maven,gitlab-ci,Apache,Maven,Gitlab Ci,我正在尝试基于以下项目构建gitlab ci: 位于nexus存储库上的父pom(不是父目录) 使用settings.xml中的maven.repo.url属性集 当将${maven.repo.url}/public中的repositories.repository.url条目替换为硬编码的url(例如http://localhost:8081/nexus/content/repositories/public。但是,当尝试使用settings.xml中的属性集时,生成错误会: 无法将项目m
- 位于nexus存储库上的父pom(不是父目录)
- 使用settings.xml中的
属性集maven.repo.url
${maven.repo.url}/public
中的repositories.repository.url
条目替换为硬编码的url(例如http://localhost:8081/nexus/content/repositories/public
。但是,当尝试使用settings.xml中的属性集时,生成错误会:
无法将项目mygroup:myparent:1.0-SNAPSHOT从/传输到myrepo(${maven.repo.url}/public)
.gitlab-ci.yml
.m2/settings.xml(注意:我在GitLab组变量中设置了MAVEN\u REPO\u URL
)
我的个人资料
真的
${env.MAVEN\u REPO\u URL}
pom.xml
4.0.0
mygroup
我的父母
1.0-快照
我的神器
我的名字
1.0-快照
粘液
nexus存储库
${maven.repo.url}/public
我希望我能够在pom.xml中使用maven.repo.url
属性,就像我在pom.xml中的其他地方一样。它可以很好地下拉依赖项,但无法从远程nexus存储库中下拉父pom
以下是maven错误消息:
$ mvn $MAVEN_CLI_OPTS clean compile
[INFO] Scanning for projects...
[WARNING] Could not transfer metadata mygroup:myparent:1.0-SNAPSHOT/maven-metadata.xml from/to myrepo (${maven.repo.url}/public): Cannot access ${maven.repo.url}/public with type default using the available connector factories: BasicRepositoryConnectorFactory
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[FATAL] Non-resolvable parent POM for mygroup:myartifact:1.0-SNAPSHOT: Could not transfer artifact mygroup:myparent:pom:1.0-SNAPSHOT from/to myrepo (${maven.repo.url}/public): Cannot access ${maven.repo.url}/public with type default using the available connector factories: BasicRepositoryConnectorFactory and 'parent.relativePath' points at wrong local POM @ line 3, column 10
@
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project mygroup:myartifact:1.0-SNAPSHOT (/builds/gitlab/group1/myartifact/pom.xml) has 1 error
[ERROR] Non-resolvable parent POM for mygroup:myparent:1.0-SNAPSHOT: Could not transfer artifact mygroup:myparent:1.0-SNAPSHOT from/to myrepo (${maven.repo.url}/public): Cannot access ${maven.repo.url}/public with type default using the available connector factories: BasicRepositoryConnectorFactory and 'parent.relativePath' points at wrong local POM @ line 3, column 10: Cannot access ${maven.repo.url}/public using the registered transporter factories: WagonTransporterFactory: Unsupported transport protocol -> [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
ERROR: Job failed: exit code 1
我发现需要启用快照存储库,以便下载父pom快照。以下是更新后的.m2/settings.xml文件:
我的个人资料
表示默认情况下已启用快照
我发现了这一点,为我指明了正确的方向。你确定你的存储库URL是正确的吗?如果是这样的话,那可能是一个bug,因为存储库URL应该是正确的,因为使用相同的变量来正确地下拉所有依赖项@克里斯涅夫
$ mvn $MAVEN_CLI_OPTS clean compile
[INFO] Scanning for projects...
[WARNING] Could not transfer metadata mygroup:myparent:1.0-SNAPSHOT/maven-metadata.xml from/to myrepo (${maven.repo.url}/public): Cannot access ${maven.repo.url}/public with type default using the available connector factories: BasicRepositoryConnectorFactory
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[FATAL] Non-resolvable parent POM for mygroup:myartifact:1.0-SNAPSHOT: Could not transfer artifact mygroup:myparent:pom:1.0-SNAPSHOT from/to myrepo (${maven.repo.url}/public): Cannot access ${maven.repo.url}/public with type default using the available connector factories: BasicRepositoryConnectorFactory and 'parent.relativePath' points at wrong local POM @ line 3, column 10
@
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project mygroup:myartifact:1.0-SNAPSHOT (/builds/gitlab/group1/myartifact/pom.xml) has 1 error
[ERROR] Non-resolvable parent POM for mygroup:myparent:1.0-SNAPSHOT: Could not transfer artifact mygroup:myparent:1.0-SNAPSHOT from/to myrepo (${maven.repo.url}/public): Cannot access ${maven.repo.url}/public with type default using the available connector factories: BasicRepositoryConnectorFactory and 'parent.relativePath' points at wrong local POM @ line 3, column 10: Cannot access ${maven.repo.url}/public using the registered transporter factories: WagonTransporterFactory: Unsupported transport protocol -> [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
ERROR: Job failed: exit code 1