我创建了一个Maven原型并上传到了Nexus存储库。我可以在Windows上使用“mvn archetype:generate -DarchetypeCatalog = http://myhost:8080/nexus/content/repositories/my-snapshots/archetype-catalog.xml”命令生成一个基于该原型的项目。目录xml是有效的,我可以手动从浏览器打开。远程http archetypeCatalog在Linux中不起作用
现在我在Linux上遵循相同的步骤,在conf/setting.xml中将服务器部分和存储库配置文件配置为与Windows相同的内容。 maven报告“没有目录定义,使用内部目录”。看来Maven没有阅读“-DarchetypeCatalog = ....”部分。
调试日志如下。 Maven版本是3.3.9。这个问题在Redhat和Ubuntu上都有转载。希望任何人都能提出解决方案。谢谢。
[DEBUG] RuntimeInstance successfully initialized.
[DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-archetype-plugin:3.0.0:generate' with basic configurator -->
[DEBUG] (f) archetypeCatalog = http://myhost:8080/nexus/content/repositories/my-snapshots/archetype-catalog.xml
[DEBUG] (f) basedir = /opt/testmaven
[DEBUG] (f) interactiveMode = true
[DEBUG] (f) localRepository = id: local
url: file:///root/.m2/repository/
layout: default
snapshots: [enabled => true, update => always]
releases: [enabled => true, update => always]
[DEBUG] (f) remoteArtifactRepositories = [ id: my-snapshots
url: http://myhost:8080/nexus/content/repositories/my-snapshots
layout: default
snapshots: [enabled => true, update => always]
releases: [enabled => false, update => always]
, id: central
url: https://repo.maven.apache.org/maven2
layout: default
snapshots: [enabled => false, update => daily]
releases: [enabled => true, update => daily]
]
[DEBUG] (f) session = [email protected]
[DEBUG] -- end configuration --
[INFO] Generating project in Interactive mode
[INFO] No catalog defined. Using internal catalog
[INFO] No archetype defined. Using maven-archetype-quickstart (org.apache.maven.archetypes:maven-archetype-quickstart:1.0)
Choose archetype:
1: internal -> org.apache.maven.archetypes:maven-archetype-archetype (An archetype which contains a sample archetype.)
.......