Maven 构建错误? [英] Error in Maven building?

查看:23
本文介绍了Maven 构建错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

写完之后

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

发现了这个!!

[INFO] 一个或多个必需的插件参数无效/缺失'执行:java'

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

[0] 在插件 'exec-maven-plugin' 的定义中指定以下:

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

...值

-或-

在命令行中,指定:'-Dstorm.topology=VALUE

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

推荐答案

如果你链接你的 pom.xml 那么这会更容易.我猜你正在使用 Storm.您是否编写了自己的topologyClass?来自文档:

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:

拓扑类

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

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

文档还为您提供了 pom 的代码,但您可能希望像这样将 exec-maven-plugin 添加到 pom.xml 中:

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>

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

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.

然后你就可以运行mvn exec:java.

这篇关于Maven 构建错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆