I am working on kafka strom integration. Im stuck with an error. The Build Fails when I try to Run it using
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

This is a snippet of the pom.xml file:

<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>

I tried

rm -rf ~/.m2/
mvn clean install

I am using storm-0.9.0-rc3 and kafka-0.7.2

有帮助吗?

解决方案

The element mainClass is empty because the property storm.topology has no value, this is why you get an error.

You have to pass the storm.topology parameter instead of mainClass :

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

See the Maven section of the readme of this example for more information: https://github.com/nathanmarz/storm-starter

其他提示

Could you please try adding this line

    <execution>
        <phase>package</phase> <!-- Add this -->
    <goals>
        .....
        .....
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top