diff --git a/grails-bootstrap/src/main/groovy/grails/util/Metadata.groovy b/grails-bootstrap/src/main/groovy/grails/util/Metadata.groovy index 3e86fbe138b..c3fc4cf90d8 100644 --- a/grails-bootstrap/src/main/groovy/grails/util/Metadata.groovy +++ b/grails-bootstrap/src/main/groovy/grails/util/Metadata.groovy @@ -99,7 +99,7 @@ class Metadata extends NavigableMap implements ConfigMap { private void afterLoading() { // allow override via system properties - merge(System.properties.findAll { key, val -> val }, true) + merge(new LinkedHashMap(System.properties).findAll { key, val -> val }, true) def value = get(WAR_DEPLOYED) warDeployed = value != null ? Boolean.valueOf(value.toString()) : false } diff --git a/grails-databinding/src/main/groovy/grails/databinding/SimpleDataBinder.groovy b/grails-databinding/src/main/groovy/grails/databinding/SimpleDataBinder.groovy index d7a5c38ae6a..c6f6a6a71de 100755 --- a/grails-databinding/src/main/groovy/grails/databinding/SimpleDataBinder.groovy +++ b/grails-databinding/src/main/groovy/grails/databinding/SimpleDataBinder.groovy @@ -447,6 +447,8 @@ class SimpleDataBinder implements DataBinder { val = [] } else if (SortedSet.isAssignableFrom(type)) { val = new TreeSet() + } else if (LinkedHashSet.isAssignableFrom(type)) { + val = new LinkedHashSet() } else if (Collection.isAssignableFrom(type)) { val = new HashSet() } diff --git a/grails-gradle-plugin/src/main/groovy/org/grails/gradle/plugin/core/GrailsGradlePlugin.groovy b/grails-gradle-plugin/src/main/groovy/org/grails/gradle/plugin/core/GrailsGradlePlugin.groovy index b63f9f675fb..c179403984b 100644 --- a/grails-gradle-plugin/src/main/groovy/org/grails/gradle/plugin/core/GrailsGradlePlugin.groovy +++ b/grails-gradle-plugin/src/main/groovy/org/grails/gradle/plugin/core/GrailsGradlePlugin.groovy @@ -91,6 +91,9 @@ class GrailsGradlePlugin extends GroovyPlugin { @CompileStatic void apply(Project project) { + // reset the environment to ensure it is resolved again for each invocation + Environment.reset() + if( project.tasks.findByName('compileGroovy') == null ) { super.apply(project) }