svn commit: r1826374 - in /ofbiz/ofbiz-framework/trunk: README.md build.gradle

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1826374 - in /ofbiz/ofbiz-framework/trunk: README.md build.gradle

mbrohl
Author: mbrohl
Date: Fri Mar  9 20:46:43 2018
New Revision: 1826374

URL: http://svn.apache.org/viewvc?rev=1826374&view=rev
Log:
Improved: Pass JVM options to OFBiz when using Gradle.
(OFBIZ-10253)

This enables passing JVM options like memory, garbage collection or JMX
configurations to the OFBiz VM. Falls back to the previously hard coded
default if not set.

Modified:
    ofbiz/ofbiz-framework/trunk/README.md
    ofbiz/ofbiz-framework/trunk/build.gradle

Modified: ofbiz/ofbiz-framework/trunk/README.md
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/README.md?rev=1826374&r1=1826373&r2=1826374&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/README.md (original)
+++ ofbiz/ofbiz-framework/trunk/README.md Fri Mar  9 20:46:43 2018
@@ -273,6 +273,14 @@ You can also offset the port, for exampl
 
 `gradlew "ofbizBackground --start --portoffset 10000"`
 
+#### Passing JVM runtime options to OFBiz
+
+You can pass JVM runtime options by specifying the project property `-PjvmArgs`.
+
+`gradlew ofbiz -PjvmArgs="-Xms1024M -Xmx2048M" -Dsome.parameter=hello`
+
+If you do not specify `jvmArgs`, a default of `-Xms128M -Xmx1024M` is set.
+
 * * * * * * * * * * * *
 
 ### Data loading tasks

Modified: ofbiz/ofbiz-framework/trunk/build.gradle
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/build.gradle?rev=1826374&r1=1826373&r2=1826374&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/build.gradle (original)
+++ ofbiz/ofbiz-framework/trunk/build.gradle Fri Mar  9 20:46:43 2018
@@ -46,7 +46,10 @@ ext.os = System.getProperty('os.name').t
 ext.pluginsDir = "${rootDir}/plugins"
 
 // java settings
-def jvmArguments = ['-Xms128M', '-Xmx1024M']
+List jvmArguments = ['-Xms128M', '-Xmx1024M']
+if (project.hasProperty('jvmArgs')) {
+    jvmArguments = jvmArgs.tokenize()
+}
 ext.ofbizMainClass = 'org.apache.ofbiz.base.start.Start'
 javadoc.failOnError = true
 sourceCompatibility = '1.8'