mojohaus / appassembler

https://www.mojohaus.org/appassembler/
MIT License
93 stars 49 forks source link

Option to put $JAVA_OPTS after <jvmSettings> values in scripts #48

Open nezda opened 7 years ago

nezda commented 7 years ago

Currently

                        <program>
                            <mainClass>com.foo.Server</mainClass>
                            <id>foo-server</id>
                            <jvmSettings>
                                <maxMemorySize>8g</maxMemorySize>
                            </jvmSettings>
                        </program>

generates scripts including

exec "$JAVACMD" $JAVA_OPTS -Xmx8g \
  -classpath "$CLASSPATH" \

It would be useful if the environment variable $JAVA_OPTS could override Xmx by providing a duplicate JVM flag with a different value (-Xmx16g). It is weird to have duplicate values for a given JVM flag, and resulting behavior surely varies across JVMs, but nonetheless, this would be useful as an option to customize a deployment for a server using only environment variables.

With this new flag (javaOptsAfterJvmSettings?), the generated script would include

exec "$JAVACMD" -Xmx8g $JAVA_OPTS \
  -classpath "$CLASSPATH" \