Maven 无法执行';mvn camel:run';关于Camel示例项目

Maven 无法执行';mvn camel:run';关于Camel示例项目,maven,apache-camel,maven-plugin,Maven,Apache Camel,Maven Plugin,我对camel还不熟悉,我一直在尝试运行camel中的一个示例,名为camel-example-twitter-websocket,可能是 当我运行mvn compile时,它会成功运行 $ mvn compile [INFO] Scanning for projects... [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building Camel :

我对camel还不熟悉,我一直在尝试运行camel中的一个示例,名为camel-example-twitter-websocket,可能是

当我运行
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

看起来这更像是一个专家问题,而不是骆驼问题。我放入了默认的.m2/settings.xml文件(在我为我的公司Nexus存储库配置镜像之前。我认为这可能会把事情搞砸,所以我把它全部取出来)。出于绝望,我甚至尝试从这里添加插件库,但没有成功。

我已经测试了自己,而使用插件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

为我工作,我希望它也能为你工作。我将调查这个插件的问题,它似乎没有导出前缀后者。

阅读自述文件如何运行示例

一些示例使用
mvn camel:run
运行,其他示例使用
mvn exec:java
和其他什么运行

您可以从源代码中的主分支运行。相反,您应该下载一个Camel版本,比如最新的2.16.2并使用它。它在examples目录中提供示例:

如果在源代码中从主分支运行。首先需要重建Camel,请参见构建: