maven archetype插件 - 在远程目录中找不到原型。默认为内部目录

时间:2018-01-16 15:20:16

标签: apache maven archetypes

$ mvn -version
Apache Maven 3.5.2 (138edd61fd100ec658bfa2d307c43b76940a5d7d; 2017-10-18T09:58:13+02:00)

从中央存储库中获取依赖项非常有效 我在获取原型方面遇到了问题。

例如,我试图使用中央原型目录中存在的原型:

mvn archetype:generate -DgroupId=com.example -DartifactId=sample-ear -DarchetypeArtifactId=wildfly-javaee7-webapp-ear-archetype -DarchetypeGroupId=org.wildfly.archetype -DinteractiveMode=false

Maven失败了。它基本上看不到远程目录中的任何原型:

[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)明确指出:

  

Archetype Plugin默认情况下知道其内部目录。它还了解本地远程目录。

     

远程代表http://repo.maven.apache.org/maven2/archetype-catalog.xml目录文件。

你有过这样的问题吗? 如果有任何提示可以指导我找到解决方案,我将不胜感激。

1 个答案:

答案 0 :(得分:1)

添加选项-DarchetypeVersion = 8.2.0.Final

相关问题