JBoss Fuse 6.3、Maven 和 settings.xml

JBoss Fuse 6.3, Maven and settings.xml

我正在尝试关注 Red Hat JBoss Fuse-6.3 Developer Guide。我根据文档将所有内容添加到 Windows: Documents and Settings\User\.m2\settings.xml(不存在)。

我使用的构建命令是
C:\Apps\apache-maven-3.5.0\bin\mvn archetype:generate -DarchetypeGroupId=io.fabric8.archetypes -DarchetypeArtifactId=karaf-soap-archetype -DarchetypeVersion=1.2.0.redhat-630187 -DgroupId=org.fusesource.example -DartifactId=cxf-basic -Dversion=1.0-SNAPSHOT -Dfabric8-profile=cxf-basic-profile

我现在收到这个错误:

[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] >>> maven-archetype-plugin:3.0.1:generate (default-cli) > generate-sources @ standalone-pom >>>
[INFO]
[INFO] <<< maven-archetype-plugin:3.0.1:generate (default-cli) < generate-sources @ standalone-pom <<<
[INFO]
[INFO]
[INFO] --- maven-archetype-plugin:3.0.1:generate (default-cli) @ standalone-pom ---
[INFO] Generating project in Interactive mode
[INFO] Archetype repository not defined. Using the one from [io.fabric8.archetypes:karaf-soap-archetype:1.2.0.redhat-133] found in catalog remote
[WARNING] The POM for io.fabric8.archetypes:karaf-soap-archetype:jar:1.2.0.redhat-630187 is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.056 s
[INFO] Finished at: 2018-01-17T10:31:19-07:00
[INFO] Final Memory: 12M/54M
[INFO] ------------------------------------------------------------------------
[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 does not exist (io.fabric8.archetypes:karaf-soap-archetype:1.2.0.redhat-630187) -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

C:\P\Projects\JBoss_Dev_Studio-10.1.0.GA_SideProjects\get-started>

我确实看到 archetype 存在。

谷歌搜索 archetype does not exist (io.fabric8.archetypes:karaf-soap-archetype:1.2.0.redhat-630187 是的!这是找到的 0 个结果之一!

钥匙竟然是这个
[INFO] Archetype repository not defined. Using the one from [io.fabric8.archetypes:karaf-soap-archetype:1.2.0.redhat-133] found in catalog remote
[WARNING] The POM for io.fabric8.archetypes:karaf-soap-archetype:jar:1.2.0.redhat-630187 is missing, no dependency information available

我是 Maven 的新手 - 我一开始并不了解它。然后我在谷歌上搜索了更多 settings.xml - 然后我发现 settings.xml 也包含在 C:\Apps\apache-maven-3.5.0\conf

我改为将 Red Hat 存储库添加到该文件(因为它完全是空的),现在一切都可以正确构建。希望这可以帮助其他人比我更快地找出类似的问题,无论是关于 jboss fuse 还是 maven 没有正确设置,