Context: I am using Gradle 5.1.1 with JVM 1.8.0_161 , Play 2.6.15, Scala 2.12.
I have the following plugins defined:
plugins {
id 'idea'
id 'scala'
id 'play'
}
Problem
I am trying to pass some specific system properties to the JVM which gradle creates to run the play application (via the runPlayBinary task). (As it happens this is in order to debug some weird behaviour which I suspect is caused by Gradle’s way of running play - that can be the topic of another post.
…however this fails because neither the implementing class nor any of its superclasses define a suitable setter method, as follows:
> Exception thrown while executing model rule: copyToTaskContainer
> Could not find method systemProperties() for arguments
It seems to me that being able to pass System Properties to the JVM is an incredibly basic requirement, so perhaps I am missing some obvious solution? Any assistance would be much appreciated.
It’s assumed to be part of the distribution feature set, specifically CreateStartScripts, so you’re not seeing it. It doesn’t help that the links are broken:
Dear Will - thankyou for this. Problem is now that PlayRun task (note I am now using version 0.9 of the “new” Gradle Play plugin) ignores JVM settings and does not have a way to easily set HttpPort (that I can see). I am not a fan of SBT but Gradle is rather behind when it comes to Play.
Update: I have tested the below but the System property is not reaching the actual Play JVM. When I call System.getProperty from a custom play ApplicationLoader (which extends GuiceApplicationLoader), the resulting value is null.
However I can see that some transitive dependencies as resolved by Gradle have brought in some play sub-library versioning conflicts. Perhaps these are causing the unexpected behaviour.