【问题标题】:Use Maven to build storm-starter使用 Maven 构建storm-starter
【发布时间】:2014-05-26 16:27:39
【问题描述】:

我按照storm-starter中的步骤尝试使用命令“mvn compile exec:java -Dstorm.topology=storm.starter.WordCountTopology”从storm-starter构建一个项目。但是给出了以下错误。谁能告诉我为什么会发生这种情况以及我需要做些什么来解决这个问题?

[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.017 s
[INFO] Finished at: 2014-05-26T11:23:54-06:00
[INFO] Final Memory: 20M/159M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.3:java (default-cli) on project storm: The parameters 'mainClass' for goal org.codehaus.mojo:exec-maven-plugin:1.3:java are missing or invalid -> [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/PluginParameterException

【问题讨论】:

    标签: java maven build apache-storm


    【解决方案1】:

    我遇到了同样的问题。经过一些试验和错误,这奏效了:

    mvn -X compile exec:java -Dstorm.topology=storm.starter.WordCountTopology -Dexec.mainClass="WordCountTopology"
    

    【讨论】:

      【解决方案2】:

      我遇到了同样的问题,解决起来很简单: 在执行storm starter 教程中给出的mvn 命令之前,您必须进入storm-starter 目录。

      cd examples/storm-starter/
      mvn compile exec:java -Dstorm.topology=storm.starter.WordCountTopology
      

      【讨论】:

        【解决方案3】:

        你需要像这样运行它:

        mvn exec:java -Dexec.mainClass="com.example.Main" [-Dexec.args="argument1"] ...
        

        usage page了解更多信息

        【讨论】:

        • 不,它也不能正常工作......而且我仍然看不出为什么我使用的命令不适用。
        • 这里是错误无法在项目风暴上执行目标 org.codehaus.mojo:exec-maven-plugin:1.3:java (default-cli):目标 org.codehaus 的参数 'mainClass' .mojo:exec-maven-plugin:1.3:java 丢失或无效。所以你需要指定它来运行代码
        • 对不起,我是新来的风暴。你能指定我怎么做吗?
        • 我已经做到了。您需要指定 maniClass,以便 maven 知道要运行什么。 mvn compile exec:java -Dstorm.topology=storm.starter.WordCountTopology -Dexec.mainClass="WordCountTopology"
        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多