[英]Debugging with exec-maven-plugin
我正在使用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。 那么,我可以添加哪些額外的參數來讓它捕獲調試中斷?
When you launch maven goal in debug mode - you are launching debug for the Maven goal process, but you need to debug the forked by the Maven goal JVM process. 為此,您可以
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.