Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
09fafca
fix: update type to remove CompileDynamic
jdaugherty Jul 12, 2025
d1e9e7b
chore: update minimum grails version
jdaugherty Jul 13, 2025
7e6cb83
ci: re-enable sitemesh3 tests
jdaugherty Aug 5, 2025
9d73131
Make scripts executable
jdaugherty Jul 13, 2025
27d9284
feature: #14017 - add micronaut feature to forge
jdaugherty Aug 5, 2025
e0de1ac
feature: #14017 - grails gradle plugin should enforce micronaut versi…
jdaugherty Aug 5, 2025
b1e928d
doc: #14017 - document how to integrate Micronaut with Grails
jdaugherty Aug 5, 2025
15db168
feedback - dependency & styling clean ups
jdaugherty Aug 10, 2025
7d094d4
chore: simplify rat config
jdaugherty Aug 16, 2025
a370d5c
14017 - fix - do not use bean replacement for jspViewResolver & ensur…
jdaugherty Sep 1, 2025
0197fe0
14017 - refactor - do not set the application context on beans that a…
jdaugherty Sep 1, 2025
56b5974
#14017 - fix - bean syntax
jdaugherty Sep 1, 2025
1df83c4
14017 - fix - switch to constructor based bean wiring
jdaugherty Sep 1, 2025
f7c73ee
14017 - cleanup - remove dependency that is no longer included
jdaugherty Sep 1, 2025
f64899b
14017 - styling - clean up styling from original 6.x code
jdaugherty Sep 1, 2025
51db407
14017 - fix - move domain class to auto configuration to fix dependen…
jdaugherty Sep 1, 2025
e2e0a85
14017 - cleanup - move i18n to be included by default and no longer r…
jdaugherty Sep 1, 2025
490ff68
14017 - cleanup - remove commented code
jdaugherty Sep 1, 2025
73410db
14017 - license - fix group for project licensing configuration
jdaugherty Sep 2, 2025
6507fc8
14017 - styling - feedback
jdaugherty Sep 2, 2025
08826bf
14017 - doc - add documentation for why parameters must always be ena…
jdaugherty Sep 2, 2025
a6c3581
14017 - feedback - styling
jdaugherty Sep 2, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion RENAME.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ Below is a reference of all migrated artifacts - both their old and new name.
| org.grails.plugins | gsp | org.apache.grails | grails-gsp | | | grails-views |
| org.grails | grails-gsp | org.apache.grails.views | grails-gsp-core | | | grails-views |
| org.grails | grails-logging | org.apache.grails | grails-logging | | | grails-core |
| org.grails | grails-plugin-i18n | org.apache.grails | grails-i18n | | | grails-core |
| org.grails | grails-plugin-i18n | org.apache.grails.i18n | grails-i18n | | | grails-core |
| org.grails | grails-plugin-interceptors | org.apache.grails | grails-interceptors | | | grails-core |
| org.grails | grails-plugin-mimetypes | org.apache.grails | grails-mimetypes | | | grails-core |
| org.grails.plugins | quartz | org.apache.grails | grails-quartz | | | grails-quartz |
Expand Down
4 changes: 2 additions & 2 deletions etc/bin/rename_gradle_artifacts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ declare -a core_mappings=(
"org[.]grails:grails-plugin-rest|org.apache.grails:grails-rest-transforms"
"org[.]grails:grails-plugin-mimetypes|org.apache.grails:grails-mimetypes"
"org[.]grails:grails-plugin-interceptors|org.apache.grails:grails-interceptors"
"org[.]grails:grails-plugin-i18n|org.apache.grails:grails-i18n"
"org[.]grails:grails-plugin-i18n|REMOVE_ME" # i18n is now included by default and should not be included explicitly
"org[.]grails:grails-plugin-domain-class|org.apache.grails:grails-domain-class"
"org[.]grails:grails-plugin-datasource|org.apache.grails:grails-datasource"
"org[.]grails:grails-plugin-databinding|org.apache.grails:grails-databinding"
Expand Down Expand Up @@ -109,7 +109,7 @@ declare -a excluded_core_mappings=(
"exclude[[:space:]]+module[[:space:]]*:[[:space:]]*['\"]grails-plugin-rest['\"]|exclude module:'grails-rest-transforms'"
"exclude[[:space:]]+module[[:space:]]*:[[:space:]]*['\"]grails-plugin-mimetypes['\"]|exclude module:'grails-mimetypes'"
"exclude[[:space:]]+module[[:space:]]*:[[:space:]]*['\"]grails-plugin-interceptors['\"]|exclude module:'grails-interceptors'"
"exclude[[:space:]]+module[[:space:]]*:[[:space:]]*['\"]grails-plugin-i18n['\"]|exclude module:'grails-i18n'"
"exclude[[:space:]]+module[[:space:]]*:[[:space:]]*['\"]grails-plugin-i18n['\"]|exclude module:'REMOVE_THIS_EXCLUDE'"
"exclude[[:space:]]+module[[:space:]]*:[[:space:]]*['\"]grails-plugin-domain-class['\"]|exclude module:'grails-domain-class'"
"exclude[[:space:]]+module[[:space:]]*:[[:space:]]*['\"]grails-plugin-datasource['\"]|exclude module:'grails-datasource'"
"exclude[[:space:]]+module[[:space:]]*:[[:space:]]*['\"]grails-plugin-databinding['\"]|exclude module:'grails-databinding'"
Expand Down
8 changes: 6 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,15 @@ apacheRatVersion=0.8.1
gradleChecksumPluginVersion=1.4.0
gradleLicensePluginVersion=0.16.1

# micronaut libraries not in the bom due to the potential for spring mismatches
micronautPlatformVersion=4.9.2

# Libraries only specific to test apps, these should not be exposed
grailsSpringSecurityVersion=7.0.0-SNAPSHOT
jbossTransactionApiVersion=2.0.0.Final
micronautVersion=4.9.10
micronautSerdeJacksonVersion=2.15.1
# note: we do not import the micronaut bom in our tests to avoid spring version mismatches
micronautHttpClientVersion=4.9.9
micronautSerdeJacksonVersion=2.11.0

# build dependencies for code quality checks
checkstyleVersion=11.0.0
Expand Down
2 changes: 1 addition & 1 deletion gradle/dependency-licenses.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
apply plugin: 'com.github.hierynomus.license-report'

List<String> licenseExclusions = rootProject.subprojects.collect {
"org.apache.grails:${it.findProperty('pomArtifactId') ?: it.name}:${rootProject.projectVersion}" as String
"${it.group}:${it.findProperty('pomArtifactId') ?: it.name}:${rootProject.projectVersion}" as String
}

downloadLicenses {
Expand Down
2 changes: 1 addition & 1 deletion gradle/java-config.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ tasks.withType(Javadoc).configureEach { Javadoc it ->

tasks.withType(GroovyCompile).configureEach {
groovyOptions.encoding = 'UTF-8' // encoding needs to be the same since it's different across platforms
// Preserve method parameter names in Groovy classes for IDE parameter hints.
// Preserve method parameter names in Groovy/Java classes for IDE parameter hints & bean reflection metadata.
groovyOptions.parameters = true
options.encoding = 'UTF-8' // encoding needs to be the same since it's different across platforms
options.fork = true
Expand Down
29 changes: 15 additions & 14 deletions gradle/publish-root-config.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ version = projectVersion
group = 'this.will.be.overridden'

def publishedProjects = [
'grails-async',
'grails-async-core',
'grails-async-gpars',
'grails-async',
'grails-async-rxjava',
'grails-async-rxjava2',
'grails-async-rxjava3',
Expand All @@ -43,15 +43,15 @@ def publishedProjects = [
'grails-databinding',
'grails-databinding-core',
'grails-datasource',
'grails-dependencies-starter-web',
'grails-dependencies-assets',
'grails-dependencies-starter-web',
'grails-dependencies-test',
'grails-domain-class',
'grails-encoder',
'grails-events',
'grails-events-compat',
'grails-events-core',
'grails-events-gpars',
'grails-events',
'grails-events-rxjava',
'grails-events-rxjava2',
'grails-events-rxjava3',
Expand All @@ -63,14 +63,15 @@ def publishedProjects = [
'grails-gsp-core',
'grails-i18n',
'grails-interceptors',
'grails-layout',
'grails-logging',
'grails-micronaut',
'grails-mimetypes',
'grails-rest-transforms',
'grails-scaffolding',
'grails-services',
'grails-shell-cli',
'grails-sitemesh3',
'grails-layout',
'grails-spring',
'grails-taglib',
'grails-test-core',
Expand All @@ -94,11 +95,11 @@ def publishedProjects = [
'grails-web-taglib',
'grails-web-url-mappings',
// datastore
'grails-datastore-async',
'grails-datastore-core',
'grails-datamapping-async',
'grails-datamapping-core',
'grails-datamapping-core-test',
'grails-datamapping-async',
'grails-datastore-async',
'grails-datastore-core',
//'grails-datamapping-rx',
'grails-datamapping-support',
'grails-datamapping-tck',
Expand All @@ -108,23 +109,23 @@ def publishedProjects = [
// simple
'grails-data-simple',
// hibernate5
'grails-data-hibernate5-spring-boot',
'grails-data-hibernate5-dbmigration',
'grails-data-hibernate5-core',
'grails-data-hibernate5',
'grails-data-hibernate5-core',
'grails-data-hibernate5-dbmigration',
'grails-data-hibernate5-spring-boot',
// mongodb
'grails-data-mongodb-spring-boot',
'grails-data-mongodb-core',
'grails-data-mongodb',
'grails-data-mongodb-bson',
'grails-data-mongodb-core',
'grails-data-mongodb-ext',
'grails-data-mongodb',
'grails-data-mongodb-gson-templates',
'grails-data-mongodb-spring-boot',
// wrapper
'grails-wrapper',
// profiles
'grails-profiles-base',
'grails-profiles-profile',
'grails-profiles-plugin',
'grails-profiles-profile',
'grails-profiles-rest-api',
'grails-profiles-rest-api-plugin',
'grails-profiles-web',
Expand Down
3 changes: 0 additions & 3 deletions gradle/rat-root-config.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ tasks.named('rat') {
def allExcludes = [
'.asf.yaml', // ASF metadata for github integration excluded from src zip
'CODE_OF_CONDUCT.md',
'LICENSE',
'NOTICE',
'BUILD_DATE', // build artifact for storing the build date / verifying
'CHECKSUMS', // build artifact for storing checksums for easy verification
'PUBLISHED_ARTIFACTS', // build artifact for storing published artifacts coordinates & paths
Expand All @@ -34,7 +32,6 @@ tasks.named('rat') {
'grails-web-common/src/main/groovy/org/grails/web/json/JSONElement.java',
'grails-web-common/src/main/groovy/org/grails/web/json/JSONException.java',
'grails-web-common/src/main/groovy/org/grails/web/json/JSONWriter.java',
'gradle/wrapper/gradle-wrapper.properties', // gradle wrapper excluded from src zip
'**/.gitattributes', // git configuration isn't code
'**/.gradle/**', '**/wrapper/**', 'gradlew*', // gradle wrapper files excluded from src zip
'**/*.html', // html files are only in test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import org.grails.plugins.web.async.spring.PromiseFactoryBean
*/
class ControllersAsyncGrailsPlugin extends Plugin {

def grailsVersion = '7.0.0 > *'
def grailsVersion = '7.0.0-SNAPSHOT > *'
def loadAfter = ['controllers']
Closure doWithSpring() {
{ ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import org.grails.plugin.cache.GrailsCacheManager
@Slf4j
class CacheGrailsPlugin extends Plugin {

def grailsVersion = '7.0.0 > *'
def grailsVersion = '7.0.0-SNAPSHOT > *'
def observe = ['controllers', 'services']
def loadAfter = ['controllers', 'services']
def authorEmail = '[email protected]'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,16 @@

import grails.config.Settings;
import grails.core.GrailsApplication;
import org.grails.plugins.domain.GrailsDomainClassAutoConfiguration;
import org.grails.web.config.http.GrailsFilters;
import org.grails.web.filters.HiddenHttpMethodFilter;
import org.grails.web.servlet.mvc.GrailsDispatcherServlet;
import org.grails.web.servlet.mvc.GrailsWebRequestFilter;

@AutoConfiguration(before = { HttpEncodingAutoConfiguration.class, WebMvcAutoConfiguration.class })
@AutoConfiguration(
before = {HttpEncodingAutoConfiguration.class, WebMvcAutoConfiguration.class},
after = {GrailsDomainClassAutoConfiguration.class}
)
@ConditionalOnWebApplication(type = ConditionalOnWebApplication.Type.SERVLET)
public class ControllersAutoConfiguration {

Expand Down
4 changes: 1 addition & 3 deletions grails-core/src/main/groovy/grails/boot/GrailsApp.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ package grails.boot

import java.util.concurrent.ConcurrentLinkedQueue

import groovy.transform.CompileDynamic
import groovy.transform.CompileStatic
import groovy.util.logging.Slf4j
import org.codehaus.groovy.control.CompilationFailedException
Expand Down Expand Up @@ -145,7 +144,6 @@ class GrailsApp extends SpringApplication {
configuredEnvironment = environment
}

@CompileDynamic // TODO: Report Groovy VerifierError
protected void enableDevelopmentModeWatch(Environment environment, ConfigurableApplicationContext applicationContext, String... args) {
def location = environment.getReloadLocation()

Expand Down Expand Up @@ -236,7 +234,7 @@ class GrailsApp extends SpringApplication {

while (isDevelopmentModeActive()) {
// Workaround for some IDE / OS combos - 2 events (new + update) for the same file
def uniqueChangedFiles = changedFiles as Set
def uniqueChangedFiles = changedFiles as Set<File>

def i = uniqueChangedFiles.size()
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class HibernateGrailsPlugin extends Plugin {

public static final String DEFAULT_DATA_SOURCE_NAME = HibernateDatastoreSpringInitializer.DEFAULT_DATA_SOURCE_NAME

def grailsVersion = '7.0.0 > *'
def grailsVersion = '7.0.0-SNAPSHOT > *'

def author = 'Grails Core Team'
def title = 'Hibernate 5 for Grails'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class MongodbGrailsPlugin extends Plugin {
def organization = [name: 'Grails', url: 'https://grails.apache.org/']
def issueManagement = [system: 'Github', url: 'https://github.com/apache/grails-core/issues']
def scm = [url: 'https://github.com/apache/grails-core']
def grailsVersion = '7.0.0 > *'
def grailsVersion = '7.0.0-SNAPSHOT > *'
def observe = ['services', 'domainClass']
def loadAfter = ['domainClass', 'hibernate', 'hibernate5', 'hibernate6', 'services']
def title = 'GORM MongoDB'
Expand Down
3 changes: 1 addition & 2 deletions grails-dependencies/starter-web/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,8 @@ def configurations = [
':grails-encoder',
':grails-events',
':grails-gsp',
':grails-i18n',
':grails-interceptors',
':grails-layout', // layout will be the default because it's fully functional while sitemesh3 still has issues
System.getenv('SITEMESH3_TESTING_ENABLED') == 'true' ? ':grails-sitemesh3' : ':grails-layout',
':grails-logging',
':grails-rest-transforms',
':grails-services',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ dependencies {
implementation "org.apache.grails:grails-core"
implementation "org.apache.grails:grails-logging"
implementation "org.apache.grails:grails-databinding"
implementation "org.apache.grails:grails-i18n"
implementation "org.apache.grails:grails-interceptors"
implementation "org.apache.grails:grails-rest-transforms"
implementation "org.apache.grails:grails-services"
Expand Down
44 changes: 44 additions & 0 deletions grails-doc/src/en/guide/conf/micronaut.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
////
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at

https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
////

=== Micronaut Integration

Grails supports using the Micronaut framework via the `grails-micronaut` plugin. The `grails-micronaut` plugin uses the https://micronaut-projects.github.io/micronaut-spring/latest/guide/#springBootStarter[Micronaut Spring Boot Starter] so that both the Micronaut Application Context & Grails Application Context exist side by side.

To enable Micronaut in your Grails application, two steps must be completed. First, the `grails-micronaut` plugin needs added to the build file. Second, the property `micronautPlatformVersion` needs set to your desired version. Only Micronaut 4.9.2 or higher is supported for Grails.

Here's an example build file:

[source,groovy]
.build.gradle
----
dependencies {
implementation 'org.apache.grails:grails-micronaut'
}
----

Here's an example `gradle.properties` file:

[source,properties]
.gradle.properties
----
micronautPlatformVersion=4.9.2
----

When the `grails-micronaut` plugin is present, the Grails Gradle plugin will automatically apply the required annotation processors to your project & ensure the specified Micronaut version is used.
5 changes: 5 additions & 0 deletions grails-doc/src/en/guide/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,11 @@ include::conf/applicationClass/applicationLifeCycle.adoc[]

include::conf/environments.adoc[]

[[micronaut]]
=== Micronaut

include::conf/micronaut.adoc[]

[[dataSource]]
=== The DataSource

Expand Down
Loading
Loading