$ mvn -version
Apache Maven 3.5.2 (138edd61fd100ec658bfa2d307c43b76940a5d7d; 2017-10-18T09:58:13+02:00)
从中央存储库获取依赖项效果非常好。
不过,我在获取原型(prototype)时遇到了问题。
例如,我正在尝试使用中央原型(prototype)目录中存在的原型(prototype):
mvn archetype:generate -DgroupId=com.example -DartifactId=sample-ear -DarchetypeArtifactId=wildfly-javaee7-webapp-ear-archetype -DarchetypeGroupId=org.wildfly.archetype -DinteractiveMode=false
Maven 失败。它基本上看不到远程目录中的任何原型(prototype):
[WARNING] No archetype found in remote catalog. Defaulting to internal catalog
[WARNING] Specified archetype not found.
我能够在浏览器中访问目录的 HTTP 链接。
文档 ( http://maven.apache.org/archetype/maven-archetype-plugin/specification/archetype-catalog.html ) 明确指出:
The Archetype Plugin knows by default about its internal catalog. It also knows about the local and remote catalogs.
remote represents the http://repo.maven.apache.org/maven2/archetype-catalog.xml catalog file.
您有遇到过这样的问题吗?
如果有任何可以指导我找到解决方案的提示,我将不胜感激。
最佳答案
添加选项-DarchetypeVersion=8.2.0.Final
关于apache - maven archetype 插件 - 在远程目录中找不到原型(prototype)。默认为内部目录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48284515/