mvn 报错 The parameters ‘mainClass’

Posted by 老沙
7月 28 2017

[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.6.0:java (default-cli) on project test_artifact: The parameters ‘mainClass’ for goal org.codehaus.mojo:exec-maven-plugin:1.6.0:java are
missing or invalid -> [Help 1]

因为插件还没配置,注意配置引导路径
解决方法:在pom文件添加如下代码  EchoServer 为包含main的类

<build>
    <plugins>
        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>exec-maven-plugin</artifactId>
            <version>1.6.0</version>
            <executions>
                <execution>
                    <goals>
                        <goal>java</goal>
                    </goals>
                </execution>
            </executions>
            <configuration>
                <mainClass>EchoServer</mainClass>
            </configuration>
        </plugin>
    </plugins>
</build>

Trackback URL for this entry