You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I might think I can do: mvn liberty:dev -Dliberty.jvm.arg1="-Xmx4096m" to override, since in general, in Maven, system properties will override POM properties.
However, the current liberty-maven-plugin impl will write both values into the generated jvm.options, e.g.:
jvm.options
-Xmx2048m
-Xmx4096m
In certain cases this may happen to "work", if the JVM ignores the first and uses the second, say.
However if you wanted to "unset" the POM property by passing mvn liberty:dev -Dliberty.jvm.arg1= then this might not work as well.
Looking at the plugin code, I see the root cause is how we use a list to store the JVM option props:
This makes some sense since we throw away the "key" and only use the "value", but leads to the problem above.
PROPOSAL
We should investigate whether we can treat the liberty.jvm.xyz properties with more of a "map" behavior and have the one value override/replace the other. We should think through the complete merging algorithm, including all possible sources for the JVM options, to make sure this makes sense, before doing.
The text was updated successfully, but these errors were encountered:
The server-param-pom-override-it test case confirms some odd behavior related to jvm options. The <jvmOptions> plugin config is last in the jvm.options file, taking precedence over the <liberty.jvm.maxHeap>-Xmx1024m</liberty.jvm.maxHeap> Maven property in the same pom.xml. There is also a jvm.options file in the src/main/liberty/config dir that I think gets overridden by the config in the pom.xml.
We should check the behavior of the server.env properties as well if we change the logic for this.
The Maven properties that start with liberty.var are verified by the test case and the cmd line property (through invoker.properties) takes precedence over the Maven property in the pom.xml.
For a POM with property like:
I might think I can do:
mvn liberty:dev -Dliberty.jvm.arg1="-Xmx4096m"
to override, since in general, in Maven, system properties will override POM properties.However, the current liberty-maven-plugin impl will write both values into the generated jvm.options, e.g.:
jvm.options
In certain cases this may happen to "work", if the JVM ignores the first and uses the second, say.
However if you wanted to "unset" the POM property by passing
mvn liberty:dev -Dliberty.jvm.arg1=
then this might not work as well.Looking at the plugin code, I see the root cause is how we use a list to store the JVM option props:
This makes some sense since we throw away the "key" and only use the "value", but leads to the problem above.
PROPOSAL
We should investigate whether we can treat the
liberty.jvm.xyz
properties with more of a "map" behavior and have the one value override/replace the other. We should think through the complete merging algorithm, including all possible sources for the JVM options, to make sure this makes sense, before doing.The text was updated successfully, but these errors were encountered: