Skip to content

Commit 3a1d6d1

Browse files
renovate[bot]puneetbehlmatreidependabot[bot]eric-milles
authored
Update dependency com.sun.xml.bind:jaxb-impl to v2.3.8 (#12858)
* Update projectVersion to 6.0.0-SNAPSHOT * Update GrailsUtilTests.java * Update groovy-joint-workflow.yml * Update to minimum Java 11 (#12783) * Update Micronaut monorepo (#12800) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Support Environments Concept in Micronaut Context (#12809) * Support Environments Concept in Micronaut Context Implemented a new MicronautYamlPropertySourceLoader which reads environment specific properties from application.yml file based on the current configured environment. Fixes #12082 * Update GroovyConfigPropertySourceLoaderSpec.groovy * Use Java 11 for Release (#12812) Update Release Workflow YAML file to use Java 11 for the build. * Release v6.0.0-M1 * Back to 6.0.0-SNAPSHOT * Merge branch 5.3.x (#12908) * Update dependabot.yml * Update aspectjVersion to v1.9.19 (#12822) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Fix typo in Readme (#12838) * Update Micronaut monorepo (#12806) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Bump grails-datastore-gorm-hibernate5 from 7.3.0 to 7.3.1 (#12824) Bumps [grails-datastore-gorm-hibernate5](https://github.com/grails/gorm-hibernate5) from 7.3.0 to 7.3.1. - [Release notes](https://github.com/grails/gorm-hibernate5/releases) - [Commits](grails/grails-data-hibernate5@v7.3.0...v7.3.1) --- updated-dependencies: - dependency-name: org.grails:grails-datastore-gorm-hibernate5 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Update spring boot to v2.7.8 (#12823) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Update plugin com.gradle.enterprise to v3.12.2 (#12813) * Update plugin com.gradle.enterprise to v3.12.2 * Remove explicit test-rety plugin Gradle Enterprise 3.12.2 implicity includes the test-retry plugin Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Puneet Behl <[email protected]> * Update apache-tomcat monorepo to v9.0.71 (#12842) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Update apache-maven-resolver monorepo to v1.9.4 (#12841) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Update apache-ant monorepo to v1.10.13 (#12830) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Update Micronaut Spring monorepo to v4.5.0 (#12846) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Update spring core to v5.3.25 (#12845) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Update junit5 monorepo (#12844) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Update dependency net.java.dev.jna:jna to v5.13.0 (#12847) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Update release-drafter/release-drafter action to v5.22.0 (#12849) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Update dependency io.methvin:directory-watcher to v0.17.3 (#12856) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Update plugin com.gradle.enterprise to v3.12.3 (#12853) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Update Micronaut monorepo to v3.8.3 (#12852) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Update Grails Profile BOM (#12857) Update grails angular profile to 8.0.2 * Release v5.3.0 * Back to 5.3.1-SNAPSHOT * Fix for Groovy STC and SC issues (#12851) * `@CompileStatic` property access * `@CompileStatic` property access * `@CompileStatic` collection element type * Update Micronaut monorepo to v3.8.4 (#12862) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Update datastoreVersion to v7.3.3 (#12861) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Update dependency org.apache.maven:maven-resolver-provider to v3.9.0 (#12843) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Update dependency io.methvin:directory-watcher to v0.18.0 (#12866) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Update Grails Gradle Plugin to 5.2.5 (#12865) * Update dependency com.netflix.nebula:gradle-extra-configurations-plugin to v9 (#12818) * Update dependency com.netflix.nebula:gradle-extra-configurations-plugin to v9 * Update nebula.optional-base plugin id --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Puneet Behl <[email protected]> * Update alpine Docker tag to v20230208 (#12864) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Update Vue profile to 5.0.3 (#12867) * Update from Micronaut 3.5.4 to 3.5.7 (#12871) * Update Grails Gradle Plugin to 5.2.6 (#12872) * Release v5.2.6 * Back to 5.2.7-SNAPSHOT * Update dependency commons-fileupload:commons-fileupload to v1.5 (#12869) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Dependency cleanup (#12868) Remove dependency to tomcat-embed-logging-log4j from grails-plugin-datasource Issue #11631 (#11631) * Update Grails Gradle Plugin to 5.3.0 (#12873) * Release v5.3.1 * Back to 5.3.2-SNAPSHOT * Revert "Update dependency org.apache.maven:maven-resolver-provider to v3.9.0 (#12843)" This reverts commit 9fdfad5. * Release v5.3.2 * Back to 5.3.3-SNAPSHOT * Update Micronaut monorepo to v3.8.5 (#12876) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Update dependency io.github.gradle-nexus:publish-plugin to v1.2.0 (#12881) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Update release-drafter/release-drafter action to v5.23.0 (#12880) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Update dependency org.jsoup:jsoup to v1.15.4 (#12878) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Update gspVersion to v5.2.2 (#12877) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Update dependency gradle to v6.9.4 (#12882) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Update apache-tomcat monorepo to v9.0.72 (#12884) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Update spring boot to v2.7.9 (#12885) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Update apache-maven-resolver monorepo to v1.9.5 (#12883) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Mattias Reichel <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Eric Milles <[email protected]> Co-authored-by: ivo-k <[email protected]> * Update dependency com.sun.xml.bind:jaxb-impl to v2.3.8 --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: Puneet Behl <[email protected]> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Mattias Reichel <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Eric Milles <[email protected]> Co-authored-by: ivo-k <[email protected]>
1 parent 8efd8cc commit 3a1d6d1

20 files changed

+378
-20
lines changed

.github/workflows/gradle.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
runs-on: ubuntu-latest
2525
strategy:
2626
matrix:
27-
java: ['8', '11', '14']
27+
java: ['11', '14']
2828
env:
2929
WORKSPACE: ${{ github.workspace }}
3030
GRADLE_OPTS: -Xmx1500m -Dfile.encoding=UTF-8

.github/workflows/groovy-joint-workflow.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,10 @@ jobs:
4848
run: env
4949

5050
# Select correct Groovy branch for this build:
51-
- name: Checkout Groovy 3_0_X (Grails 5)
51+
- name: Checkout Groovy 3_0_X (Grails 5 and later)
5252
run: cd .. && git clone --depth 1 https://github.com/apache/groovy.git -b GROOVY_3_0_X --single-branch
53-
if: github.ref == 'refs/heads/5.3.x' || github.base_ref == '5.3.x' || github.ref == 'refs/heads/5.2.x' || github.base_ref == '5.2.x' || github.ref == 'refs/heads/5.1.x' || github.base_ref == '5.1.x' || github.ref == 'refs/heads/5.0.x' || github.base_ref == '5.0.x' || github.ref == 'refs/heads/master' || github.base_ref == 'master'
54-
- name: Checkout Groovy 2_5_X (Grails 4)
53+
if: github.ref == 'refs/heads/6.0.x' || github.base_ref == '6.0.x' || github.ref == 'refs/heads/5.3.x' || github.base_ref == '5.3.x' || github.ref == 'refs/heads/5.2.x' || github.base_ref == '5.2.x' || github.ref == 'refs/heads/5.1.x' || github.base_ref == '5.1.x' || github.ref == 'refs/heads/5.0.x' || github.base_ref == '5.0.x' || github.ref == 'refs/heads/master' || github.base_ref == 'master'
54+
- name: Checkout Groovy 2_5_X (Grails 4.0.x)
5555
run: cd .. && git clone --depth 1 https://github.com/grails/grails-core.git -b GROOVY_2_5_X --single-branch
5656
if: github.ref == 'refs/heads/4.1.x' || github.base_ref == '4.1.x' || github.ref == 'refs/heads/4.0.x' || github.base_ref == '4.0.x'
5757
- name: Set CI_GROOVY_VERSION for Grails

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
runs-on: ubuntu-latest
1313
strategy:
1414
matrix:
15-
java: ['8']
15+
java: ['11']
1616
env:
1717
GIT_USER_NAME: puneetbehl
1818
GIT_USER_EMAIL: [email protected]

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -417,8 +417,8 @@ subprojects { project ->
417417
if(project.name == 'grails-dependencies') return
418418
if(project.name == 'grails-bom') return
419419

420-
sourceCompatibility = "1.8"
421-
targetCompatibility = "1.8"
420+
sourceCompatibility = "1.11"
421+
targetCompatibility = "1.11"
422422

423423
if(project.name =~ /^(grails-web|grails-plugin-|grails-test-suite|grails-test)/) {
424424
dependencies {

gradle.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
projectVersion=5.3.3-SNAPSHOT
1+
projectVersion=6.0.0-SNAPSHOT
22
antVersion=1.10.13
33
aspectjVersion=1.9.19
44
asyncVersion=4.0.0
@@ -20,7 +20,7 @@ jakartaAnnotationApiVersion=2.0.0
2020
jansiVersion=1.18
2121
javaParserCoreVersion=3.15.14
2222
javaxAnnotationApiVersion=1.3.2
23-
jaxbVersion=2.3.1
23+
jaxbVersion=2.3.8
2424
jlineVersion=2.14.6
2525
jnaVersion=5.13.0
2626
junitVersion=4.13.2

grails-bootstrap/src/main/groovy/org/grails/io/support/MainClassFinder.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ class MainClassFinder {
170170
boolean found = false
171171

172172
MainMethodFinder() {
173-
super(Opcodes.ASM4)
173+
super(Opcodes.ASM7)
174174
}
175175

176176
@Override

grails-core/src/main/groovy/org/grails/compiler/injection/GrailsAwareInjectionOperation.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ private static void initializeState() {
120120
final ClassReader classReader = new ClassReader(inputStream);
121121
final String astTransformerClassName = AstTransformer.class.getSimpleName();
122122
final ClassLoader finalClassLoader = classLoader;
123-
classReader.accept(new ClassVisitor(Opcodes.ASM4) {
123+
classReader.accept(new ClassVisitor(Opcodes.ASM7) {
124124
@Override
125125
public AnnotationVisitor visitAnnotation(String desc, boolean visible) {
126126
try {
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
/*
2+
* Copyright 2017-2020 original authors
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package org.grails.core.cfg
17+
18+
import groovy.transform.Internal
19+
import io.micronaut.context.env.yaml.ConstructIsoTimestampString
20+
import org.yaml.snakeyaml.constructor.SafeConstructor
21+
import org.yaml.snakeyaml.nodes.MappingNode
22+
import org.yaml.snakeyaml.nodes.SequenceNode
23+
import org.yaml.snakeyaml.nodes.Tag
24+
25+
/**
26+
* Yaml constructor to create containers with sensible
27+
* default array bounds.
28+
*
29+
* @author James Kleeh
30+
* @since 6.0.0
31+
*/
32+
@Internal
33+
class CustomSafeConstructor extends SafeConstructor {
34+
CustomSafeConstructor() {
35+
yamlConstructors.put(Tag.TIMESTAMP, new ConstructIsoTimestampString())
36+
}
37+
38+
@Override
39+
protected Map<Object, Object> newMap(MappingNode node) {
40+
return createDefaultMap(node.getValue().size())
41+
}
42+
43+
@Override
44+
protected List<Object> newList(SequenceNode node) {
45+
return createDefaultList(node.getValue().size())
46+
}
47+
}
48+

grails-core/src/main/groovy/org/grails/core/cfg/MicronautGroovyPropertySourceLoader.groovy

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
package org.grails.core.cfg
22

3+
import grails.plugins.GrailsPlugin
34
import grails.util.BuildSettings
45
import grails.util.Environment
56
import grails.util.Metadata
67
import groovy.transform.CompileStatic
78
import io.micronaut.context.env.AbstractPropertySourceLoader
9+
import io.micronaut.context.env.MapPropertySource
810
import io.micronaut.context.exceptions.ConfigurationException
911
import io.micronaut.core.io.ResourceLoader
1012
import org.grails.config.NavigableMap
@@ -22,7 +24,7 @@ class MicronautGroovyPropertySourceLoader extends AbstractPropertySourceLoader {
2224

2325
@Override
2426
int getOrder() {
25-
return DEFAULT_POSITION
27+
return DEFAULT_POSITION + 1
2628
}
2729

2830
@Override
@@ -37,9 +39,10 @@ class MicronautGroovyPropertySourceLoader extends AbstractPropertySourceLoader {
3739
appVersion: Metadata.getCurrent().getApplicationVersion())
3840
try {
3941
def configObject = configSlurper.parse(input.getText("UTF-8"))
40-
def propertySource = new NavigableMap()
42+
final Map<String, Object> propertySource = new NavigableMap()
4143
propertySource.merge(configObject.flatten(), false)
4244
finalMap.putAll(propertySource)
45+
processEnvironmentSpecificProperties(finalMap, propertySource)
4346
} catch (Throwable e) {
4447
throw new ConfigurationException("Exception occurred reading configuration [" + name + "]: " + e.getMessage(), e)
4548
}
@@ -68,4 +71,19 @@ class MicronautGroovyPropertySourceLoader extends AbstractPropertySourceLoader {
6871
return Collections.singleton("groovy")
6972
}
7073

74+
@Override
75+
protected MapPropertySource createPropertySource(String name, Map<String, Object> map, int order) {
76+
return super.createPropertySource("grails.$name", map, order)
77+
}
78+
79+
void processEnvironmentSpecificProperties(finalMap, Map<String, Object> propertySource) {
80+
final String environmentName = Environment.current.name
81+
if (environmentName != null) {
82+
final String environmentPrefix = GrailsPlugin.ENVIRONMENTS + '.' + environmentName + '.'
83+
propertySource.keySet().stream()
84+
.filter(k -> k.startsWith(environmentPrefix))
85+
.forEach(propertyName -> { finalMap[propertyName.substring(environmentPrefix.length())] = propertySource.get(propertyName) })
86+
}
87+
}
88+
7189
}
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
package org.grails.core.cfg
2+
3+
import grails.plugins.GrailsPlugin
4+
import grails.util.Environment
5+
import groovy.transform.CompileStatic
6+
import io.micronaut.context.env.MapPropertySource
7+
import io.micronaut.context.env.yaml.YamlPropertySourceLoader
8+
9+
/**
10+
* Load properties from a YAML file. This class extends the Micronaut default implementation {@link io.micronaut.context.env.yaml.YamlPropertySourceLoader} where it adds support for Micronaut beans receive configuration from environments block.
11+
*
12+
* @author Puneet Behl
13+
* @since 6.0.0
14+
*/
15+
@CompileStatic
16+
class MicronautYamlPropertySourceLoader extends YamlPropertySourceLoader {
17+
18+
@Override
19+
int getOrder() {
20+
return super.getOrder() + 1
21+
}
22+
23+
@Override
24+
protected MapPropertySource createPropertySource(String name, Map<String, Object> map, int order) {
25+
return super.createPropertySource("grails.$name", map, order)
26+
}
27+
28+
/**
29+
* Only process environment specific entries as the other entries are already processed by Micronaut default {@link io.micronaut.context.env.yaml.YamlPropertySourceLoader}
30+
*
31+
* @param finalMap The map with all the properties processed
32+
* @param map The map to process
33+
* @param prefix The prefix for the keys
34+
*/
35+
@Override
36+
protected void processMap(Map<String, Object> finalMap, Map map, String prefix) {
37+
final String env = Environment.current.name
38+
if (env != null) {
39+
final String grailsEnvironmentPrefix = GrailsPlugin.ENVIRONMENTS + '.' + env + '.'
40+
((Map<String, Object>) map).entrySet().stream()
41+
.filter(e -> e.key instanceof String && (((String) e.key).startsWith(GrailsPlugin.ENVIRONMENTS) || prefix.startsWith(GrailsPlugin.ENVIRONMENTS)))
42+
.forEach(e -> {
43+
Map.Entry entry = (Map.Entry) e
44+
String key = entry.getKey().toString()
45+
Object value = entry.getValue()
46+
if (value instanceof Map && !((Map) value).isEmpty()) {
47+
processMap(finalMap, (Map) value, prefix + key + '.')
48+
} else if ((prefix + key).startsWith(grailsEnvironmentPrefix)) {
49+
finalMap.put((prefix + key).substring(grailsEnvironmentPrefix.length()), value)
50+
}
51+
})
52+
}
53+
}
54+
}

0 commit comments

Comments
 (0)