什么是 maven-archetype-archetype,为什么在 mvnrepository 中不可用?

What is maven-archetype-archetype and why is not available in mvnrepository?

我正在尝试学习一些 Maven,尤其是如何创建自己的原型。然后我遇到了 Maven 提供的默认值。原型 "org.apache.maven.archetypes:maven-archetype-archetype" 看起来很有希望。

mvn archetype:generate \
    -DarchetypeGroupId=org.apache.maven.archetypes \
    -DarchetypeArtifactId=maven-archetype-archetype \
    -DgroupId=my.test \
    -DartifactId=my-archetype \
    -Dpackage=my.archetype.package \
    -Dversion=1.0-SNAPSHOT

创建包后有一个文件src/main/resources/archetype-resources/pom.xml,它使用我作为参数传递的groupId、artifactId 和版本,前面有一个$,如下所示:

<groupId>$my.test</groupId>
<artifactId>$my-archetype</artifactId>
<version>.0-SNAPSHOT</version>

将它安装到本地仓库目录并使用它创建一个基于它的新 Maven 项目后,它仍然有那些美元符号。

现在我想知道:这个原型是否过时了?当您在网上搜索时,它不会经常被提及。如果不是,我做错了什么?

一个maven-archetype-archetype是一个archetype that contains a sample archetype. A list of provided archetypes can be found here

如果您正在制作测试原型,我建议使用 quickstart archetypeexample, and this guide 将帮助您进行设置。

我不确定为什么 $ 仍然存在于您的 pom.xml 中。

对不起,我没有添加评论等权限;这就是为什么我 post 这就像一个答案......我真的很抱歉! 我想知道您是否在使用 Netbeans IDE! 当然,有一种方法可以通过一些配置来创建 Maven 项目! 但首先;如果 Netbeans 是你的 IDE,现在就让我来吧。