无法生成新的Maven项目
我正在遵循Red Hat的命令,并在maven中运行一个查询:无法生成新的Maven项目,maven,fabric8,Maven,Fabric8,我正在遵循Red Hat的命令,并在maven中运行一个查询: mvn archetype:generate -DarchetypeGroupId=io.fabric8.archetypes -DarchetypeArtifactId=karaf-camel-cbr-archetype -DarchetypeVersion=1.2.0.redhat-630187 -DgroupId=tutorial -DartifactId=tx-jms-router -Dversion=1.0-SNAPSHO
mvn archetype:generate
-DarchetypeGroupId=io.fabric8.archetypes
-DarchetypeArtifactId=karaf-camel-cbr-archetype
-DarchetypeVersion=1.2.0.redhat-630187
-DgroupId=tutorial
-DartifactId=tx-jms-router
-Dversion=1.0-SNAPSHOT
-Dfabric8-profile=tx-jms-router-profile
但我看到了一个错误
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:3
.0.1:generate (default-cli) on project standalone-pom: The desired archetype doe
s not exist (io.fabric8.archetypes:karaf-camel-cbr-archetype:1.2.0.redhat-630187
) -> [Help 1]
我试图使用Jboss Developer Studio创建一个maven项目,但是如果您仔细看,结果是一样的
…您会注意到该工件不在中央maven repo中。
所以问题是,您需要告诉Maven也在非默认位置查看
因此,您需要编辑settings.xml并在上面的链接中添加一个额外的存储库,您将指向正确的存储库
编辑:与在与下面的评论相关的settings.xml中添加存储库相关。您的列表有两个问题:
您缺少activeProfile标记,因为您只有activeProfile
您缺少activeProfiles标记,并且没有出现Maven错误,这让我相信您修改了错误的settings.xml。您是否试图修改.m2文件夹中的文件?
试试这个
-DarchetypeRepository=http://repo.open.iona.com/maven2
是的,我尝试使用Jboss Developer Studio创建一个maven项目,在那里我可以手动选择repository Red Hat,但结果是相同的,我建议在settings.xml中添加repository。我仍然相信这会解决您的问题。我在settings.xml中添加了这一点,但结果是相同的jboss ga repository jboss ga repository maven.repository.redhat.com/ga/true/false jboss ga repositoryyes,我丢失了activeProfiles标签。对不起我的疏忽谢谢你的帮助!