4

我正在研究 kafka strom 集成。我遇到了一个错误。当我尝试使用运行它时构建失败
mvn -e -f m2-pom.xml compile exec:java -Dexec.classpathScope=compile -Dexec.mainClass=storm.starter.MainTopology

[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:java  
(default-cli) on project storm-starter: The parameters 'mainClass' for goal 
 org.codehaus.mojo:exec-maven-plugin:1.2.1:java are missing or invalid

这是 pom.xml 文件的片段:

<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>exec-maven-plugin</artifactId>
    <version>1.2.1</version>
    <executions>
      <execution>
        <goals>
          <goal>exec</goal>
        </goals>
      </execution>
    </executions>
    <configuration>
      <executable>java</executable>
      <includeProjectDependencies>true</includeProjectDependencies>
      <includePluginDependencies>true</includePluginDependencies>
      <classpathScope>compile</classpathScope>
      <mainClass>${storm.topology}</mainClass>
    </configuration>
</plugin>

我试过了

rm -rf ~/.m2/
mvn clean install

我正在使用storm-0.9.0-rc3和kafka-0.7.2

4

2 回答 2

1

元素 mainClass 为空,因为属性storm.topology 没有值,这就是您收到错误的原因。

您必须传递 Storm.topology 参数而不是 mainClass :

mvn -e -f m2-pom.xml compile exec:java -Dstorm.topology=storm.starter.MainTopology

有关更多信息,请参阅本示例自述文件的 Maven 部分: https ://github.com/nathanmarz/storm-starter

于 2013-12-24T12:13:47.793 回答
0

您能否尝试添加此行

    <execution>
        <phase>package</phase> <!-- Add this -->
    <goals>
        .....
        .....
于 2013-12-11T21:22:48.317 回答