无法表演骆驼:跑步' on Camel Example Project

时间:2016-03-18 19:45:03

标签: maven apache-camel maven-plugin

我是骆驼新手,我一直试图运行一个名为 camel-example-twitter-websocket 的骆驼示例,其中可能是 found here

当我运行mvn compile时,它成功运作

$ mvn compile
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Camel :: Example :: Twitter WebSocket 2.17-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-enforcer-plugin:1.4:enforce (enforce-maven) @ camel-example-twitter-websocket ---
[INFO]
[INFO] --- maven-bundle-plugin:2.3.7:cleanVersions (versions) @ camel-example-twitter-websocket ---
[INFO]
[INFO] --- maven-remote-resources-plugin:1.5:process (default) @ camel-example-twitter-websocket ---
[INFO]
[INFO] --- maven-resources-plugin:2.7:resources (default-resources) @ camel-example-twitter-websocket ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 4 resources
[INFO] Copying 3 resources
[INFO]
[INFO] --- maven-resources-plugin:2.7:resources (default) @ camel-example-twitter-websocket ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 4 resources
[INFO] Copying 3 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.5.1:compile (default-compile) @ camel-example-twitter-websocket ---
[INFO] Nothing to compile - all classes are up to date
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.504 s
[INFO] Finished at: 2016-03-18T15:27:30-04:00
[INFO] Final Memory: 22M/437M
[INFO] ------------------------------------------------------------------------

但是,当我运行第二步mvn camel:run时,它不起作用,我得到以下输出

$ mvn camel:run
[INFO] Scanning for projects...
[WARNING] The POM for org.apache.camel:camel-maven-plugin:jar:2.17-20151107.033312-28 is invalid, transitive dependencies (if any) will not be av         ailable, enable debug logging for more details
[WARNING] Failed to retrieve plugin descriptor for org.apache.camel:camel-maven-plugin:2.17-SNAPSHOT: Plugin org.apache.camel:camel-maven-plugin:         2.17-SNAPSHOT or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.camel:camel-maven-plugin:jar:2.         17-SNAPSHOT
[WARNING] The POM for org.eclipse.m2e:lifecycle-mapping:jar:1.0.0 is missing, no dependency information available
[WARNING] Failed to retrieve plugin descriptor for org.eclipse.m2e:lifecycle-mapping:1.0.0: Plugin org.eclipse.m2e:lifecycle-mapping:1.0.0 or one          of its dependencies could not be resolved: Failure to find org.eclipse.m2e:lifecycle-mapping:jar:1.0.0 in https://repo.maven.apache.org/maven2 w         as cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced
[WARNING] The POM for org.apache.maven.plugins:maven-surefire-plugin:jar:{maven-surefire-plugin-version} is missing, no dependency information av         ailable
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-surefire-plugin:{maven-surefire-plugin-version}: Plugin org.apa         che.maven.plugins:maven-surefire-plugin:{maven-surefire-plugin-version} or one of its dependencies could not be resolved: Failure to find org.apa         che.maven.plugins:maven-surefire-plugin:jar:{maven-surefire-plugin-version} in https://repo.maven.apache.org/maven2 was cached in the local repos         itory, resolution will not be reattempted until the update interval of central has elapsed or updates are forced
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-metadata.xml
Downloading: https://repository.apache.org/content/repositories/snapshots/org/apache/maven/plugins/maven-metadata.xml
Downloading: https://repo.maven.apache.org/maven2/org/codehaus/mojo/maven-metadata.xml
Downloading: https://repository.apache.org/content/repositories/snapshots/org/codehaus/mojo/maven-metadata.xml
Downloaded: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-metadata.xml (13 KB at 36.9 KB/sec)
Downloaded: https://repo.maven.apache.org/maven2/org/codehaus/mojo/maven-metadata.xml (20 KB at 57.4 KB/sec)
Downloaded: https://repository.apache.org/content/repositories/snapshots/org/apache/maven/plugins/maven-metadata.xml (9 KB at 9.7 KB/sec)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.140 s
[INFO] Finished at: 2016-03-18T15:28:29-04:00
[INFO] Final Memory: 27M/327M
[INFO] ------------------------------------------------------------------------
[ERROR] No plugin found for prefix 'camel' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] availabl         e from the repositories [local (C:\Users\myNameHere\.m2\repository), apache.snapshots (https://repository.apache.org/content/repositories/snapshots/),          central (https://repo.maven.apache.org/maven2)] -> [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/NoPluginFoundForPrefixException

看起来这更像是一个Maven问题而不是Camel问题。我输入了默认的 .m2 / settings.xml 文件(之前我为我公司的Nexus存储库配置了一个镜像。我认为这可能会搞砸了,所以我把它全部拿出来)。出于绝望,我甚至尝试从这里添加插件存储库http://camel.apache.org/maven-2-snapshot-repository-in-pom.html,但这不起作用。

2 个答案:

答案 0 :(得分:1)

阅读自述文件,了解如何运行示例。

有些示例使用mvn camel:run和其他人使用mvn exec:java以及其他内容运行。

您从源代码中的主分支运行。相反,你应该下载一个版本的Camel,如最新的2.16.2并使用它。它将示例放在示例目录中:http://camel.apache.org/download

如果从源代码中的master分支运行。您需要先重建Camel,请参阅构建:http://camel.apache.org/building.html

答案 1 :(得分:0)

我已经测试过自己,并且插件2.16也没有解决它。

但在自述文件中,我发现了这一点:

We have described this in more details at the Camel twitter documentation:
  http://camel.apache.org/twitter

You will need to compile this example first:
  mvn compile

To run the example type
  mvn exec:java

Then open a browser to see live twitter updates in the web page
  http://localhost:9090

为我工作,我希望它也适合你。我将调查插件的问题,似乎没有导出后缀。