How to specify JVM argument for Maven built executable JAR

前端 未结 5 1963
梦谈多话
梦谈多话 2020-12-19 06:16

When using Maven to build an executable JAR, how do I specify the JVM arguments that are used when the JAR is executed?

I can specify the main class using <

5条回答
  •  攒了一身酷
    2020-12-19 07:15

    I think this can be done if you think of it this way. Generate a .bat file that will have a command:

    > java .. yourClass.. -D -D...

    You can try looking on this app assembler plugin for maven.

    I tried it, and seems to work. I am still not clear how to make .bat file to be generated with the somewhat different content, but I think it is doable.

    As another option, you may always try to create the .bat file in the resource sub folder of your project and include that sub folder with your distribution.

提交回复
热议问题