2013-12-23 202 views
0

后,我写了Maven构建错误?

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

,发现了这个!

[INFO]一个或多个必需的插件参数无效/缺少 'EXEC:JAVA'

[0]内的定义为插件 'EXEC-行家-插件' 指定 以下:

...在命令行上VALUE

-OR-

,指定:“-Dstorm.topology = VALUE

+1

尝试mvn -f pom.xml编译exec:java -Dexec.classpathScope =“编译”-Dexec.mainClass =“storm.starter.WordCountTopology” – sasankad

+0

@sasanked我试过了,但仍然是同样的错误! – user1

回答

0

如果你链接你的pom.xml,那么这会更容易。我猜你正在使用Storm。你有没有自己编写topologyClass?从the documentation

topologyClass

拓扑驱动器(例如 “com.foo.bar.MyTopology”) 命令行覆盖的类名:-Dmaven.storm.topology =

该文档还为您提供了代码为您的POM,但你可能想的exec-Maven的插件添加到您的pom.xml像这样:

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

有一点需要注意:您需要更改mainClass以匹配项目中包含要执行的主要方法的类。

然后你可以运行mvn exec:java

+0

我是新来的风暴,并试图提交风暴启动器文件中已经写好的拓扑称为WordCountTopology。在这里链接我的pom.xml文件http://www.2shared.com/document/yZPU74go/pom.html – user1

+0

我不知道't使用风暴,但尝试:'mvn exec:java -Dexec.mainClass =“storm.starter.WordCountTopology' – porcoesphino

+0

或尝试这里列出的两个命令: https://github.com/nathanmarz/storm-starter#running -topologies与 - 行家 'MVN -f平方米-pom.xml中编译的exec:JAVA -Dstorm.topology = storm.starter.WordCountTopology' OR 'MVN -f平方米-pom.xml中编译的exec:JAVA -Dstorm.topology = storm.starter.clj.word_count' – porcoesphino