我使用exec-maven-plugin执行我的java应用程序,并通过以下设置从IDE (IntelliJ)运行调试:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.4.0</version>
<executions>
<execution>
<id>exec_1</id>
<phase>deploy</phase>
<goals>
<goal>java</goal>
</goals>
</execution>
</executions>
<configuration>
<mainClass>com.myapp.app</mainClass>
</configuration>
</plugin>而且效果很好。然后,我更改设置以执行一个实际的java命令行,该命令行将运行相同的应用程序:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>3.0.0</version>
<executions>
<execution>
<id>exec_1</id>
<phase>deploy</phase>
<goals>
<goal>exec</goal>
</goals>
</execution>
</executions>
<configuration>
<executable>java</executable>
<arguments>
<argument>-cp</argument>
<argument>
"dir1";"dir2;etc..."
</argument>
<argument>com.myapp.app</argument>
</arguments>
</configuration>
</plugin>它可以执行应用程序,但它不将调试器附加到IDE。那么,我还可以添加什么额外的参数来使它捕获调试中断呢?
https://stackoverflow.com/questions/62389740
复制相似问题