简体   繁体   中英

Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1 - kafka storm integration

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM