Java Viking using the Exec Maven plugin without using the `exec` target

In the documentation:

  • exec:exec execute programs and Java programs in a separate process.
  • exec:java execute Java programs in one virtual machine.

I want to deploy a java program. I already worked in exec:java , but this is not fork. So the obvious step is to change the target to exec . The problem is that the syntax for exec quite different from the java syntax. It has no tags like includeProjectDependencies , includePluginDependencies , etc. Is there a plugin that I can use as # 1 in the sense that it plugs but has convenient syntax like # 2? IMO, # 2 must have the configuration <fork>true</fork> .

+6
source share
1 answer

I think you can stick with exec: exec using this configuration if you want to pass the class path of the project to the Java process you are using:

 <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>exec-maven-plugin</artifactId> <configuration> <executable>java</executable> <longClasspath>true</longClasspath> <arguments> <argument>-XX:MaxPermSize=128M</argument> <argument>-Xmx1024M</argument> <argument>-Xdebug</argument> <argument>-Xrunjdwp:transport=dt_socket,address=8888,server=y,suspend=n</argument> <argument>-classpath</argument> <classpath/> </arguments> </configuration> </plugin> 

See also plugin Usage page

0
source

Source: https://habr.com/ru/post/946985/


All Articles