Error in Maven building?

删除回忆录丶 提交于 2020-01-06 14:04:01

问题


After i wrote

mvn -f pom.xml compile exec:java -Dexec.classpathScope=Compile-Dexec.main Class=storm.starter.WordCountTopology 

and found this !!

[INFO] One or more required plugin parameters are invalid/missing for 'exec:java'

[0] Inside the definition for plugin 'exec-maven-plugin' specify the following:

... VALUE

-OR-

on the command line, specify: '-Dstorm.topology=VALUE


回答1:


If you link your pom.xml then this would be easier. I'm guessing you're using Storm. Have you written your own topologyClass? From the documentation:

topologyClass

The class name of the topology driver (e.g. "com.foo.bar.MyTopology") Command line override: -Dmaven.storm.topology=

The documentation also gives you the code for your pom but you might want to add exec-maven-plugin to your pom.xml like so:

<build>
    <plugins>
        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>exec-maven-plugin</artifactId>
            <version>1.2.1</version>
            <configuration>
                <mainClass>com.domain.yourApp</mainClass>
            </configuration>
        </plugin>
    </plugins>
</build>

One thing to note: you need to alter mainClass to match the class in your project that contains the main method you want to execute.

Then you can just run mvn exec:java.



来源:https://stackoverflow.com/questions/20736366/error-in-maven-building

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!