![](/img/trans.png)
[英]couldn't execute maven multi module project using exec-maven-plugin
[英]execute war file using exec-maven-plugin
我将 Spring Boot 应用程序打包为 .war 文件。 然后使用
java -jar MyProj-{version}.war
从命令提示符运行它。
不,我正在尝试使用“exec-maven-plugin”执行相同的命令。 但它因以下错误而失败
[错误] 无法在项目 MyProj 上执行目标 org.codehaus.mojo:exec-maven-plugin:1.6.0:java (default-cli):目标 org.codehaus.mojo:exec-maven- 的参数“mainClass” plugin:1.6.0:java 丢失或无效 -> [帮助 1]
我没有提供主类,因为我没有在命令提示符中提供。 以下是我的插件。 我使用命令
执行:java
从eclipse运行它。
插入
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.6.0</version>
<executions>
<execution>
<goals>
<goal>java</goal>
</goals>
<configuration>
<arguments>
<argument>-jar</argument>
<argument>${basedir}/target/MyProj-${project.version}.war</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
尝试添加
<executable>java</executable>
进入您的<configuration>
并将<configuration>...</configuration>
移到<executions/>
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.