我试图使用Maven中央仓库中缺少的archetype创建maven项目,但存在于另一个远程仓库中。 maven-archetype插件版本2.4我可以使用-DarchetypeRepository参数来指定另一个回购,其中maven应该寻找我的原型。 在新版本(3.0)中,此参数不起作用。 (证明:http://maven.apache.org/archetype/maven-archetype-plugin/generate-mojo.html#archetypeCatalog)Maven原型:生成插件3.0如何指定远程仓库
所以我需要使用插件的旧版本,并写了很长的命令,如
$ mvn org.apache.maven.plugins:maven-archetype-plugin:2.4:generate -DarchetypeGroupId=some.id -DarchetypeArtifactId=some.another.id -DarchetypeVersion=some.version -DarchetypeRepository=repo.url
我能如何使用Maven的原型 - 插件相同的命令:3.0?
我试过使用archetypeCatalog=repo.url
,但它不能这样工作,我只能用它设置本地或远程回购。
谢谢。
插件开发者的回答是:
Allowing to set a URL via commandline is considered to be a security leak, so specifying the repository (id: archetype) in the settings.xml is the right way.
然后我应该使用什么命令来生成特殊回购的原型,而不是中央? – Limmy
您是否尝试过使用3.0.0插件的-DarchetypeRepository参数? – Limmy