diff --git a/.github/workflows/sdkman.yml b/.github/workflows/sdkman.yml
deleted file mode 100644
index 9b475d7a73f..00000000000
--- a/.github/workflows/sdkman.yml
+++ /dev/null
@@ -1,53 +0,0 @@
-# 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.
-
-name: "Release to SDKMan"
-on:
- workflow_dispatch:
- inputs:
- version:
- description: Version to release
- required: true
-jobs:
- sdkman:
- runs-on: ubuntu-latest
- permissions:
- contents: read
- steps:
- - name: "📥 Checkout repository"
- uses: actions/checkout@v4
- with:
- token: ${{ secrets.GH_TOKEN }}
- ref: v${{ github.event.inputs.version }}
- - name: "☕️ Setup JDK"
- uses: actions/setup-java@v4
- with:
- distribution: liberica
- java-version: 17
- - name: "🐘 Setup Gradle"
- uses: gradle/actions/setup-gradle@v4
- with:
- develocity-access-key: ${{ secrets.GRAILS_DEVELOCITY_ACCESS_KEY }}
- - name: "🏆 Grails SDK Minor Release"
- env:
- GVM_SDKVENDOR_KEY: ${{ secrets.GVM_SDKVENDOR_KEY }}
- GVM_SDKVENDOR_TOKEN: ${{ secrets.GVM_SDKVENDOR_TOKEN }}
- run: ./gradlew sdkMinorRelease
- - name: "Set output"
- id: set_output
- run: |
- echo ::set-output name=release_version::$(cat $GITHUB_OUTPUT)
- env:
- GITHUB_OUTPUT: ${{ github.workspace }}/build/release_version
diff --git a/HEADER b/HEADER
new file mode 100644
index 00000000000..4f38e29e24e
--- /dev/null
+++ b/HEADER
@@ -0,0 +1,16 @@
+ 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.
\ No newline at end of file
diff --git a/UPGRADE7.md b/UPGRADE7.md
index a76cac2e3e2..54ff858600e 100644
--- a/UPGRADE7.md
+++ b/UPGRADE7.md
@@ -17,32 +17,12 @@ limitations under the License.
# Common 7.0 Upgrade Gotchas - DRAFT -
Experienced while upgrading modules for Grails 7
-- the following deprecated classes were removed, please use the suggested replacement
- * grails.core.GrailsTagLibClass -> grails.core.gsp.GrailsTagLibClass
- * org.grails.core.artefact.TagLibArtefactHandler -> org.grails.core.artefact.gsp.TagLibArtefactHandler
- * org.grails.core.DefaultGrailsTagLibClass -> org.grails.core.gsp.DefaultGrailsTagLibClass
-- h2 2.x is stricter about reserved words
- - https://github.com/apache/gorm-hibernate5/pull/910/commits/c8de45df204966ccc228b46b94beeb2142ae0f59
-- [GROOVY-10621](https://issues.apache.org/jira/browse/GROOVY-10621)
- - Primitive booleans will no longer generate the form of isProperty & getProperty. They will only generate isProperty()
+
+- NOTE: Several items have been directly integrated into the upgrade guide. Please refer to it for the full list.
- The amount of boilerplate required in gradle files has been reduced:
- When `org.grails.grails-plugin` gradle plugin is applied, the bootJar task is disabled by default. No more needing to explicitly set it to false!
- We no longer have a `micronaut-bom` and a `spring-bom`. We only have the `spring-bom` now, which allows `grails-bom` to inherit from it and be applied as part of the Spring Dependency Management plugin. This means versions do not need included for any library in the bom. Override bom versions via gradle properties.
- The `grailsPublish` plugin returns and is no longer an internal only plugin. It has been enhanced to work with some multi-project workflows. Eliminate publishing boilerplate of the nexus-publish, maven-publish, & signing plugin by adopting it.
-- Jar artifacts produced by Grails Plugins will no longer have the suffix `-plain`
- - https://github.com/apache/grails-gradle-plugin/pull/347
-- [GROOVY-5169](https://issues.apache.org/jira/browse/GROOVY-5169) [GROOVY-10449](https://issues.apache.org/jira/browse/GROOVY-10449)
- - Fields with a public modifier were not returned with MetaClassImpl#getProperties() in groovy 3, but are now.
-- Some older libraries may include an older version of groovy, but still be compatible with Groovy 4. One example is `GPars`. In your gradle file, you can force a dependency upgrade via this code:
-
- configurations.configureEach {
- resolutionStrategy.eachDependency { DependencyResolveDetails details ->
- if (details.requested.group == 'org.codehaus.groovy') {
- details.useTarget(group: 'org.apache.groovy', name: details.requested.name, version: '4.0.25')
- }
- }
- }
-- The `jakarta` package switch means that older libraries using `javax` will need to be updated to use the correct namespace. The side effect of this change is most grails plugins will likely need updated to be compatible with Grails 7.
- When migrating a new project to Grails 7, it's advised to generate a stock 7.0 app from [start.grails.org](https://start.grails.org) and compare the project with a grails app generated from the same grails version that your application uses. This helps catch the dependency clean up that has occurred. Including the additions of new dependencies. Note: due to an issue with project resolution the `grails-bom` will need explicitly imported in buildSrc or any project that does not apply the grails gradle plugins (grails-plugin, grails-web, or grails-gsp). By default, the grails gradle plugins (grails-plugin, grails-web, grails-gsp) will apply the bom automatically.
- the gradle property `groovyVersion` is being replaced with the upstream spring property name `groovy.version`. Please update your projects accordingly.
- hibernate-ehcache
@@ -66,20 +46,8 @@ Experienced while upgrading modules for Grails 7
## NOTE: This document is a draft and the explanations are only highlights and will be expanded further prior to release of 7.0.
-## New Features
-- [grails-gsp #551](https://github.com/apache/grails-gsp/issues/551) adopts a `formActionSubmit` tag to replace `actionSubmit`. Dispatching actions via a parameter name on a form submit will be removed in a future version of grails.
-
### Cool New Features
-- You can now @Scaffold Controllers and Services and virtually eliminate any boiler plate code.
- Hello Exterminator, Good by bugs! Lot's of things started working... and working well! For instance, use of controller namespaces now work seemlessly.
-- Bootstrap 5.3.3 support. Saffolding and Fields tags now optionally support boostrap classes.
-- Priortization of AutoConfiguration over bean overriding.
-- Lightweight, Removal of numerous dependencies.
-- grails-bom overhaul for keeping depedencies up to date and in sync.
-- g:form now automatically provides csrf protection when Spring Security CSRF is enabled.
- Massive decoupling of dependencies and cleanup between modules. SiteMesh dependencies are no longer compiled into controllers fused between numerous modules. SiteMesh isn't even required to use Grails!
-- SiteMesh ahs been upgrade to SiteMesh 3!
-- Completely up to date modern stack that has been optimized for easier future transitions.
- GSP can now be used OUTSIDE of Grails! see grails-boot
- Works with Spring Security 6 out of the box. No plugin needed!
-- Tested and works with Java 17-23 [grails-core](https://github.com/apache/grails-core/blob/7.0.x/.github/workflows/gradle.yml#L18)
diff --git a/build.gradle b/build.gradle
index 8ded727cab4..aa7b163fbfb 100644
--- a/build.gradle
+++ b/build.gradle
@@ -46,6 +46,12 @@ ext {
allprojects {
repositories {
+ // workaround for https://github.com/spring-gradle-plugins/dependency-management-plugin/issues/164
+ maven {
+ name = 'localGrailsBom'
+ url = file("$rootDir/grails-bom/build/repo")
+ content { includeModule 'org.apache.grails', 'grails-bom' }
+ }
maven { url = 'https://repo.grails.org/grails/restricted' }
// mavenLocal() // Keep, this will be uncommented and used by CI (groovy-joint-workflow)
maven { url = 'https://repository.apache.org/content/groups/snapshots' }
diff --git a/gradle/java-config.gradle b/gradle/java-config.gradle
index 96d64fae69d..6f7c3f544f7 100644
--- a/gradle/java-config.gradle
+++ b/gradle/java-config.gradle
@@ -49,7 +49,6 @@ tasks.withType(Jar).configureEach {
'Implementation-Version': grailsVersion,
'Implementation-Vendor': 'grails.org'
)
- duplicatesStrategy = DuplicatesStrategy.INCLUDE
}
// Any jar, zip, or archive should be reproducible
diff --git a/grails-bom/build.gradle b/grails-bom/build.gradle
index 2d3fa5e7569..bd1cdf3fefb 100644
--- a/grails-bom/build.gradle
+++ b/grails-bom/build.gradle
@@ -161,4 +161,16 @@ ext {
apply {
from rootProject.layout.projectDirectory.file('gradle/publish-config.gradle')
+}
+
+// Workaround for https://github.com/spring-gradle-plugins/dependency-management-plugin/issues/164
+pluginManager.withPlugin('maven-publish') {
+ publishing {
+ repositories {
+ maven {
+ name = 'localBom'
+ url = layout.buildDirectory.dir('repo')
+ }
+ }
+ }
}
\ No newline at end of file
diff --git a/grails-codecs/src/main/groovy/org/grails/plugins/CodecsGrailsPlugin.groovy b/grails-codecs/src/main/groovy/org/grails/plugins/CodecsGrailsPlugin.groovy
deleted file mode 100644
index 72ed16cf56f..00000000000
--- a/grails-codecs/src/main/groovy/org/grails/plugins/CodecsGrailsPlugin.groovy
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * 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.
- */
-package org.grails.plugins
-
-import org.grails.plugins.codecs.DefaultCodecLookup
-
-/**
- * @deprecated Use {@link org.grails.plugins.codecs.CodecsGrailsPlugin} instead
- */
-@Deprecated
-class CodecsGrailsPlugin extends org.grails.plugins.codecs.CodecsGrailsPlugin {
-
- Closure doWithSpring() {{->
- codecLookup(DefaultCodecLookup)
- }}
-}
diff --git a/grails-codecs/src/main/groovy/org/grails/plugins/codecs/CodecsGrailsPlugin.groovy b/grails-codecs/src/main/groovy/org/grails/plugins/codecs/CodecsGrailsPlugin.groovy
index 8d20e8e8926..403897ba7f8 100644
--- a/grails-codecs/src/main/groovy/org/grails/plugins/codecs/CodecsGrailsPlugin.groovy
+++ b/grails-codecs/src/main/groovy/org/grails/plugins/codecs/CodecsGrailsPlugin.groovy
@@ -20,14 +20,10 @@ package org.grails.plugins.codecs
import grails.plugins.Plugin
import grails.util.GrailsUtil
-import org.grails.plugins.codecs.DefaultCodecLookup
-import org.grails.commons.CodecArtefactHandler
import org.grails.encoder.impl.HTML4Codec
-import org.grails.plugins.codecs.HTMLCodec
import org.grails.encoder.impl.HTMLJSCodec
import org.grails.encoder.impl.JavaScriptCodec
import org.grails.encoder.impl.RawCodec
-import org.grails.plugins.codecs.URLCodec
/**
* Configures pluggable codecs.
@@ -48,4 +44,9 @@ class CodecsGrailsPlugin extends Plugin {
RawCodec
]
+ Closure doWithSpring() {
+ { ->
+ codecLookup(DefaultCodecLookup)
+ }
+ }
}
\ No newline at end of file
diff --git a/grails-codecs/src/main/resources/META-INF/grails-plugin.xml b/grails-codecs/src/main/resources/META-INF/grails-plugin.xml
deleted file mode 100644
index dc109292256..00000000000
--- a/grails-codecs/src/main/resources/META-INF/grails-plugin.xml
+++ /dev/null
@@ -1,3 +0,0 @@
-
- org.grails.plugins.codecs.CodecsGrailsPlugin
-
\ No newline at end of file
diff --git a/grails-controllers/src/main/resources/META-INF/grails-plugin.xml b/grails-controllers/src/main/resources/META-INF/grails-plugin.xml
deleted file mode 100644
index d482c7aa80a..00000000000
--- a/grails-controllers/src/main/resources/META-INF/grails-plugin.xml
+++ /dev/null
@@ -1,3 +0,0 @@
-
- org.grails.plugins.web.controllers.ControllersGrailsPlugin
-
\ No newline at end of file
diff --git a/grails-controllers/src/main/resources/META-INF/grails.factories b/grails-controllers/src/main/resources/META-INF/grails.factories
deleted file mode 100644
index e570518b6c7..00000000000
--- a/grails-controllers/src/main/resources/META-INF/grails.factories
+++ /dev/null
@@ -1 +0,0 @@
-grails.compiler.traits.TraitInjector=grails.compiler.traits.ControllerTraitInjector
diff --git a/grails-core/src/main/groovy/grails/plugins/GrailsPlugin.java b/grails-core/src/main/groovy/grails/plugins/GrailsPlugin.java
index 42222061638..2732abc8865 100644
--- a/grails-core/src/main/groovy/grails/plugins/GrailsPlugin.java
+++ b/grails-core/src/main/groovy/grails/plugins/GrailsPlugin.java
@@ -18,22 +18,21 @@
*/
package grails.plugins;
+import grails.core.GrailsApplication;
import grails.util.Environment;
import groovy.lang.GroovyObject;
-
-import java.util.Collection;
-import java.util.List;
-import java.util.Map;
-
-import grails.core.GrailsApplication;
-import org.grails.spring.RuntimeSpringConfiguration;
import org.grails.plugins.support.WatchPattern;
+import org.grails.spring.RuntimeSpringConfiguration;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.core.env.PropertySource;
import org.springframework.core.io.Resource;
import org.springframework.core.type.filter.TypeFilter;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+
/**
*
Plugin interface that adds Spring {@link org.springframework.beans.factory.config.BeanDefinition}s
* to a registry based on a {@link GrailsApplication} object. After all GrailsPlugin
classes
@@ -214,14 +213,6 @@ public interface GrailsPlugin extends ApplicationContextAware, Comparable, Grail
*/
boolean supportsCurrentScopeAndEnvironment();
- /**
- * Write some documentation to the DocumentationContext
- * @deprecated Dynamic document generation no longer supported
- * @param text
- */
- @Deprecated
- void doc(String text);
-
/**
* Returns the path of the plug-in
*
diff --git a/grails-core/src/main/groovy/org/grails/plugins/AbstractGrailsPlugin.java b/grails-core/src/main/groovy/org/grails/plugins/AbstractGrailsPlugin.java
index 96b2c11281d..2fb57066f8e 100644
--- a/grails-core/src/main/groovy/org/grails/plugins/AbstractGrailsPlugin.java
+++ b/grails-core/src/main/groovy/org/grails/plugins/AbstractGrailsPlugin.java
@@ -40,7 +40,11 @@
import java.io.IOException;
import java.net.URL;
-import java.util.*;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
/**
* Abstract implementation that provides some default behaviours
@@ -130,7 +134,7 @@ protected Resource readPluginConfiguration(Class> pluginClass) {
if(ymlResource != null && ymlResource.exists()) {
if (groovyResourceExists) {
- throw new RuntimeException("A plugin may define a plugin.yml or a plugin.groovy, but not both");
+ throw new RuntimeException("A plugin [" + pluginClass.getName() + "] may define a plugin.yml or a plugin.groovy, but not both");
}
return ymlResource;
}
diff --git a/grails-core/src/main/groovy/org/grails/plugins/DefaultGrailsPlugin.java b/grails-core/src/main/groovy/org/grails/plugins/DefaultGrailsPlugin.java
index 8e9a1f93fd8..6ab8520d9b0 100644
--- a/grails-core/src/main/groovy/org/grails/plugins/DefaultGrailsPlugin.java
+++ b/grails-core/src/main/groovy/org/grails/plugins/DefaultGrailsPlugin.java
@@ -18,42 +18,33 @@
*/
package org.grails.plugins;
+import grails.core.ArtefactHandler;
+import grails.core.GrailsApplication;
+import grails.core.support.GrailsApplicationAware;
+import grails.core.support.ParentApplicationContextAware;
import grails.plugins.GrailsPlugin;
import grails.plugins.GrailsPluginManager;
import grails.plugins.Plugin;
+import grails.plugins.exceptions.PluginException;
import grails.spring.BeanBuilder;
import grails.util.CollectionUtils;
import grails.util.Environment;
+import grails.util.GrailsArrayUtils;
+import grails.util.GrailsClassUtils;
import grails.util.GrailsUtil;
-import groovy.lang.*;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
+import groovy.lang.Binding;
+import groovy.lang.Closure;
+import groovy.lang.GroovyClassLoader;
+import groovy.lang.GroovyObject;
+import groovy.lang.MetaClass;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import grails.core.ArtefactHandler;
-import grails.core.GrailsApplication;
-import grails.util.GrailsArrayUtils;
-import grails.util.GrailsClassUtils;
+import org.codehaus.groovy.runtime.DefaultGroovyMethods;
import org.grails.core.io.CachingPathMatchingResourcePatternResolver;
import org.grails.core.io.SpringResource;
-import org.grails.spring.RuntimeSpringConfiguration;
-import grails.plugins.exceptions.PluginException;
import org.grails.plugins.support.WatchPattern;
import org.grails.plugins.support.WatchPatternParser;
-import grails.core.support.GrailsApplicationAware;
-import grails.core.support.ParentApplicationContextAware;
-import org.codehaus.groovy.runtime.DefaultGroovyMethods;
+import org.grails.spring.RuntimeSpringConfiguration;
import org.springframework.beans.BeanWrapper;
import org.springframework.beans.BeanWrapperImpl;
import org.springframework.beans.BeansException;
@@ -68,6 +59,18 @@
import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
import org.springframework.core.type.filter.TypeFilter;
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
/**
* Implementation of the GrailsPlugin interface that wraps a Groovy plugin class
* and provides the magic to invoke its various methods from Java.
@@ -607,15 +610,6 @@ private boolean supportsValueInIncludeExcludeMap(Map includeExcludeMap, Object v
return !(excludes != null && excludes.contains(value));
}
- /**
- * @deprecated Dynamic document generation no longer supported
- * @param text
- */
- @Deprecated
- public void doc(String text) {
- // no-op
- }
-
@Override
public String[] getDependencyNames() {
return dependencyNames;
diff --git a/grails-datasource/src/main/resources/META-INF/grails-plugin.xml b/grails-datasource/src/main/resources/META-INF/grails-plugin.xml
deleted file mode 100644
index c29d68fa712..00000000000
--- a/grails-datasource/src/main/resources/META-INF/grails-plugin.xml
+++ /dev/null
@@ -1,3 +0,0 @@
-
- org.grails.plugins.datasource.DataSourceGrailsPlugin
-
\ No newline at end of file
diff --git a/grails-doc/src/en/guide/commandLine.adoc b/grails-doc/src/en/guide/commandLine.adoc
index c686d60751f..83c7637d3b5 100644
--- a/grails-doc/src/en/guide/commandLine.adoc
+++ b/grails-doc/src/en/guide/commandLine.adoc
@@ -234,10 +234,6 @@ dependencies {
implementation 'org.grails:grails-core'
// Add more dependencies as needed...
}
-
-grails {
- pathingJar = true
-}
----
=== Utilizing Gradle Build Tool
diff --git a/grails-doc/src/en/guide/gettingStarted/aHelloWorldExample.adoc b/grails-doc/src/en/guide/gettingStarted/aHelloWorldExample.adoc
index 6744ec1bf4f..50368b1ddb0 100644
--- a/grails-doc/src/en/guide/gettingStarted/aHelloWorldExample.adoc
+++ b/grails-doc/src/en/guide/gettingStarted/aHelloWorldExample.adoc
@@ -184,8 +184,6 @@ Replace "9090" with your preferred port.
=== Note for Windows Users
-If you encounter an error related to the Java process or filename length, you can use the `--stacktrace` flag or add `grails { pathingJar = true }` to your "build.gradle" file.
-
It may also be necessary to enclose the system properties in quotes on Windows:
----
./gradlew bootRun "-Dgrails.server.port=9090"
diff --git a/grails-doc/src/en/guide/upgrading/upgrading60x.adoc b/grails-doc/src/en/guide/upgrading/upgrading60x.adoc
index 33773cb97ea..9e65359312c 100644
--- a/grails-doc/src/en/guide/upgrading/upgrading60x.adoc
+++ b/grails-doc/src/en/guide/upgrading/upgrading60x.adoc
@@ -214,6 +214,7 @@ Please consult the Spring upgrade guides for the impacts of this change.
1. `grails.core.GrailsTagLibClass` -> `grails.core.gsp.GrailsTagLibClass`
2. `org.grails.core.artefact.TagLibArtefactHandler` -> `org.grails.core.artefact.gsp.TagLibArtefactHandler`
3. `org.grails.core.DefaultGrailsTagLibClass` -> `org.grails.core.gsp.DefaultGrailsTagLibClass`
+4. `org.grails.plugins.CodecsGrailsPlugin` -> `org.grails.plugins.codecs.CodecsGrailsPlugin`
===== 12.3 Micronaut in Grails is now supported via the Micronaut Spring Boot Starter
- This change was made based on community input: https://github.com/orgs/grails/discussions/13517
diff --git a/grails-domain-class/src/main/resources/META-INF/grails-plugin.xml b/grails-domain-class/src/main/resources/META-INF/grails-plugin.xml
deleted file mode 100644
index 4e90e27e857..00000000000
--- a/grails-domain-class/src/main/resources/META-INF/grails-plugin.xml
+++ /dev/null
@@ -1,3 +0,0 @@
-
- org.grails.plugins.domain.DomainClassGrailsPlugin
-
\ No newline at end of file
diff --git a/grails-domain-class/src/main/resources/META-INF/grails.factories b/grails-domain-class/src/main/resources/META-INF/grails.factories
deleted file mode 100644
index f2c568a97ef..00000000000
--- a/grails-domain-class/src/main/resources/META-INF/grails.factories
+++ /dev/null
@@ -1 +0,0 @@
-grails.compiler.traits.TraitInjector=grails.compiler.traits.DomainClassTraitInjector
diff --git a/grails-geb/build.gradle b/grails-geb/build.gradle
index 31872584eac..db2cf982abf 100644
--- a/grails-geb/build.gradle
+++ b/grails-geb/build.gradle
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
plugins {
id 'java-library'
id 'java-test-fixtures'
diff --git a/grails-gradle/gradle/java-config.gradle b/grails-gradle/gradle/java-config.gradle
index bc521df6d07..59121df80ad 100644
--- a/grails-gradle/gradle/java-config.gradle
+++ b/grails-gradle/gradle/java-config.gradle
@@ -57,7 +57,6 @@ tasks.withType(Jar).configureEach {
'Implementation-Version': projectVersion,
'Implementation-Vendor': 'grails.org'
)
- duplicatesStrategy = DuplicatesStrategy.INCLUDE
}
// Any jar, zip, or archive should be reproducible
diff --git a/grails-gradle/model/src/main/groovy/org/grails/io/support/MainClassFinder.groovy b/grails-gradle/model/src/main/groovy/org/grails/io/support/MainClassFinder.groovy
index eadb7a006c7..724d0f6bb21 100644
--- a/grails-gradle/model/src/main/groovy/org/grails/io/support/MainClassFinder.groovy
+++ b/grails-gradle/model/src/main/groovy/org/grails/io/support/MainClassFinder.groovy
@@ -21,7 +21,11 @@ package org.grails.io.support
import grails.util.BuildSettings
import groovy.transform.CompileStatic
-import groovyjarjarasm.asm.*
+import groovyjarjarasm.asm.ClassReader
+import groovyjarjarasm.asm.ClassVisitor
+import groovyjarjarasm.asm.MethodVisitor
+import groovyjarjarasm.asm.Opcodes
+import groovyjarjarasm.asm.Type
import java.nio.file.Paths
import java.util.concurrent.ConcurrentHashMap
diff --git a/grails-gradle/plugins/build.gradle b/grails-gradle/plugins/build.gradle
index 958cfe398fe..17b39a27d5b 100644
--- a/grails-gradle/plugins/build.gradle
+++ b/grails-gradle/plugins/build.gradle
@@ -32,7 +32,10 @@ dependencies {
// compile grails-gradle-plugin with the Groovy version provided by Gradle
// to ensure build compatibility with Gradle, currently Groovy 3.0.x
// see: https://docs.gradle.org/current/userguide/compatibility.html#groovy
- compileOnly 'org.codehaus.groovy:groovy'
+ // TODO: tasks are isolated as of Gradle 7 so we must expose the version of the groovy.
+ // We could upgrade to groovy 4 for the tasks, but gradle plugins are not isolated and still
+ // need groovy 3.
+ implementation "org.codehaus.groovy:groovy"
implementation project(':grails-gradle-model'), {
exclude group: 'org.apache.groovy'
diff --git a/grails-gradle/plugins/src/main/groovy/org/grails/gradle/plugin/core/GrailsExtension.groovy b/grails-gradle/plugins/src/main/groovy/org/grails/gradle/plugin/core/GrailsExtension.groovy
index 76da88a551e..95a29829382 100644
--- a/grails-gradle/plugins/src/main/groovy/org/grails/gradle/plugin/core/GrailsExtension.groovy
+++ b/grails-gradle/plugins/src/main/groovy/org/grails/gradle/plugin/core/GrailsExtension.groovy
@@ -55,11 +55,6 @@ class GrailsExtension {
*/
boolean exploded = true
- /**
- * Whether to create a jar file to reference the classpath to prevent classpath too long issues in Windows
- */
- boolean pathingJar = false
-
/**
* Whether java.time.* package should be a default import package
*/
diff --git a/grails-gradle/plugins/src/main/groovy/org/grails/gradle/plugin/core/GrailsGradlePlugin.groovy b/grails-gradle/plugins/src/main/groovy/org/grails/gradle/plugin/core/GrailsGradlePlugin.groovy
index 89b9cf6424f..dd124ba0f0b 100644
--- a/grails-gradle/plugins/src/main/groovy/org/grails/gradle/plugin/core/GrailsGradlePlugin.groovy
+++ b/grails-gradle/plugins/src/main/groovy/org/grails/gradle/plugin/core/GrailsGradlePlugin.groovy
@@ -28,7 +28,11 @@ import io.spring.gradle.dependencymanagement.DependencyManagementPlugin
import io.spring.gradle.dependencymanagement.dsl.DependencyManagementExtension
import org.apache.tools.ant.filters.EscapeUnicode
import org.apache.tools.ant.filters.ReplaceTokens
-import org.gradle.api.*
+import org.gradle.api.Action
+import org.gradle.api.NamedDomainObjectProvider
+import org.gradle.api.Plugin
+import org.gradle.api.Project
+import org.gradle.api.Task
import org.gradle.api.artifacts.Configuration
import org.gradle.api.artifacts.Dependency
import org.gradle.api.artifacts.DependencyResolveDetails
@@ -39,7 +43,12 @@ import org.gradle.api.file.RegularFile
import org.gradle.api.plugins.ExtraPropertiesExtension
import org.gradle.api.plugins.GroovyPlugin
import org.gradle.api.provider.Provider
-import org.gradle.api.tasks.*
+import org.gradle.api.tasks.AbstractCopyTask
+import org.gradle.api.tasks.JavaExec
+import org.gradle.api.tasks.SourceSet
+import org.gradle.api.tasks.SourceSetOutput
+import org.gradle.api.tasks.TaskContainer
+import org.gradle.api.tasks.TaskProvider
import org.gradle.api.tasks.compile.GroovyCompile
import org.gradle.api.tasks.testing.Test
import org.gradle.language.jvm.tasks.ProcessResources
@@ -54,7 +63,10 @@ import org.grails.gradle.plugin.run.FindMainClassTask
import org.grails.gradle.plugin.util.SourceSets
import org.grails.io.support.FactoriesLoaderSupport
import org.springframework.boot.gradle.dsl.SpringBootExtension
+import org.springframework.boot.gradle.plugin.ResolveMainClassName
import org.springframework.boot.gradle.plugin.SpringBootPlugin
+import org.springframework.boot.gradle.tasks.bundling.BootArchive
+import org.springframework.boot.gradle.tasks.run.BootRun
import javax.inject.Inject
@@ -66,8 +78,8 @@ import javax.inject.Inject
*/
@CompileStatic
class GrailsGradlePlugin extends GroovyPlugin {
- public static final String APPLICATION_CONTEXT_COMMAND_CLASS = "grails.dev.commands.ApplicationCommand"
- public static final String PROFILE_CONFIGURATION = "profile"
+ public static final String APPLICATION_CONTEXT_COMMAND_CLASS = 'grails.dev.commands.ApplicationCommand'
+ public static final String PROFILE_CONFIGURATION = 'profile'
protected static final List CORE_GORM_LIBRARIES = ['async', 'core', 'simple', 'web', 'rest-client', 'gorm', 'gorm-validation', 'gorm-plugin-support', 'gorm-support', 'test-support', 'hibernate-core', 'gorm-test', 'rx', 'rx-plugin-support']
// NOTE: mongodb, neo4j etc. should NOT be included here so they can be independently versioned
@@ -251,7 +263,7 @@ class GrailsGradlePlugin extends GroovyPlugin {
String slf4jPreventExclusion = project.properties['slf4jPreventExclusion']
if (!slf4jPreventExclusion || slf4jPreventExclusion != 'true') {
project.configurations.configureEach {Configuration configuration ->
- configuration.exclude group: "org.slf4j", module: "slf4j-simple"
+ configuration.exclude group: 'org.slf4j', module: 'slf4j-simple'
}
}
}
@@ -310,12 +322,12 @@ class GrailsGradlePlugin extends GroovyPlugin {
@CompileDynamic
protected Task createBuildPropertiesTask(Project project) {
- if (project.tasks.findByName("buildProperties") == null) {
+ if (project.tasks.findByName('buildProperties') == null) {
File resourcesDir = SourceSets.findMainSourceSet(project).output.resourcesDir
- File buildInfoFile = new File(resourcesDir, "META-INF/grails.build.info")
+ File buildInfoFile = new File(resourcesDir, 'META-INF/grails.build.info')
- Task buildPropertiesTask = project.tasks.create("buildProperties")
+ Task buildPropertiesTask = project.tasks.create('buildProperties')
Map buildPropertiesContents = ['grails.env' : Environment.isSystemSet() ? Environment.getCurrent().getName() : Environment.PRODUCTION.getName(),
'info.app.name' : project.name,
'info.app.version' : project.version instanceof Serializable ? project.version : project.version.toString(),
@@ -334,7 +346,7 @@ class GrailsGradlePlugin extends GroovyPlugin {
}
TaskContainer tasks = project.tasks
- tasks.findByName("processResources")?.dependsOn(buildPropertiesTask)
+ tasks.findByName('processResources')?.dependsOn(buildPropertiesTask)
}
}
@@ -342,13 +354,12 @@ class GrailsGradlePlugin extends GroovyPlugin {
protected void configureMicronaut(Project project) {
final String micronautVersion = project.properties['micronautVersion']
if (micronautVersion) {
- project.configurations.all({ Configuration configuration ->
+ project.configurations.configureEach({ Configuration configuration ->
configuration.resolutionStrategy.eachDependency({ DependencyResolveDetails details ->
String dependencyName = details.requested.name
String group = details.requested.group
if (group == 'io.micronaut' && dependencyName.startsWith('micronaut')) {
details.useVersion(micronautVersion)
- return
}
} as Action)
} as Action)
@@ -359,7 +370,7 @@ class GrailsGradlePlugin extends GroovyPlugin {
protected void configureGroovy(Project project) {
final String groovyVersion = project.properties['groovy.version']
if (groovyVersion) {
- project.logger.lifecycle("Warning: groovy.version is defined, Grails Gradle Plugin will force all groovy dependencies to version ${groovyVersion}.")
+ project.logger.lifecycle('Warning: groovy.version is defined, Grails Gradle Plugin will force all groovy dependencies to version {}.', groovyVersion)
project.configurations.configureEach { Configuration configuration ->
configuration.resolutionStrategy.eachDependency { DependencyResolveDetails details ->
String group = details.requested.group
@@ -384,8 +395,8 @@ class GrailsGradlePlugin extends GroovyPlugin {
}
protected GrailsExtension registerGrailsExtension(Project project) {
- if (project.extensions.findByName("grails") == null) {
- project.extensions.add("grails", new GrailsExtension(project))
+ if (project.extensions.findByName('grails') == null) {
+ project.extensions.add('grails', new GrailsExtension(project))
}
}
@@ -406,8 +417,8 @@ class GrailsGradlePlugin extends GroovyPlugin {
project.afterEvaluate {
FileCollection fileCollection = buildClasspath(project, project.configurations.runtimeClasspath, project.configurations.console)
for (ctxCommand in applicationContextCommands) {
- String taskName = GrailsNameUtils.getLogicalPropertyName(ctxCommand, "Command")
- String commandName = GrailsNameUtils.getScriptName(GrailsNameUtils.getLogicalName(ctxCommand, "Command"))
+ String taskName = GrailsNameUtils.getLogicalPropertyName(ctxCommand, 'Command')
+ String commandName = GrailsNameUtils.getScriptName(GrailsNameUtils.getLogicalName(ctxCommand, 'Command'))
if (project.tasks.findByName(taskName) == null) {
project.tasks.create(taskName, ApplicationContextCommandTask) {
classpath = fileCollection
@@ -438,7 +449,7 @@ class GrailsGradlePlugin extends GroovyPlugin {
@CompileStatic
protected List resolveGrailsResourceDirs(Project project) {
- List grailsResourceDirs = [project.file("src/main/resources")]
+ List grailsResourceDirs = [project.file('src/main/resources')]
for (String f in grailsAppResourceDirs) {
grailsResourceDirs.add(project.file("grails-app/${f}"))
}
@@ -448,7 +459,7 @@ class GrailsGradlePlugin extends GroovyPlugin {
@CompileStatic
protected List resolveGrailsSourceDirs(Project project) {
List grailsSourceDirs = []
- File grailsApp = project.file("grails-app")
+ File grailsApp = project.file('grails-app')
if (grailsApp.exists()) {
grailsApp.eachDir { File subdir ->
if (isGrailsSourceDirectory(subdir)) {
@@ -456,14 +467,14 @@ class GrailsGradlePlugin extends GroovyPlugin {
}
}
}
- grailsSourceDirs.add(project.file("src/main/groovy"))
+ grailsSourceDirs.add(project.file('src/main/groovy'))
grailsSourceDirs
}
@CompileStatic
protected boolean isGrailsSourceDirectory(File subdir) {
def dirName = subdir.name
- !subdir.hidden && !dirName.startsWith(".") && !excludedGrailsAppSourceDirs.contains(dirName) && !grailsAppResourceDirs.contains(dirName)
+ !subdir.hidden && !dirName.startsWith('.') && !excludedGrailsAppSourceDirs.contains(dirName) && !grailsAppResourceDirs.contains(dirName)
}
protected String resolveGrailsVersion(Project project) {
@@ -490,7 +501,7 @@ class GrailsGradlePlugin extends GroovyPlugin {
def systemPropertyConfigurer = { String defaultGrailsEnv, JavaForkOptions task ->
def map = System.properties.findAll { entry ->
- entry.key?.toString()?.startsWith("grails.")
+ entry.key?.toString()?.startsWith('grails.')
}
for (key in map.keySet()) {
def value = map.get(key)
@@ -504,14 +515,14 @@ class GrailsGradlePlugin extends GroovyPlugin {
task.systemProperty Metadata.APPLICATION_VERSION, (project.version instanceof Serializable ? project.version : project.version.toString())
task.systemProperty Metadata.APPLICATION_GRAILS_VERSION, grailsVersion
task.systemProperty Environment.KEY, defaultGrailsEnv
- task.systemProperty Environment.FULL_STACKTRACE, System.getProperty(Environment.FULL_STACKTRACE) ?: ""
+ task.systemProperty Environment.FULL_STACKTRACE, System.getProperty(Environment.FULL_STACKTRACE) ?: ''
if (task.minHeapSize == null) {
- task.minHeapSize = "768m"
+ task.minHeapSize = '768m'
}
if (task.maxHeapSize == null) {
- task.maxHeapSize = "768m"
+ task.maxHeapSize = '768m'
}
- task.jvmArgs "-XX:+TieredCompilation", "-XX:TieredStopAtLevel=1", "-XX:CICompilerCount=3"
+ task.jvmArgs '-XX:+TieredCompilation', '-XX:TieredStopAtLevel=1', '-XX:CICompilerCount=3'
// Copy GRAILS_FORK_OPTS into the fork. Or use GRAILS_OPTS if no fork options provided
// This allows run-app etc. to run using appropriate settings and allows users to provided
@@ -533,13 +544,22 @@ class GrailsGradlePlugin extends GroovyPlugin {
protected void configureConsoleTask(Project project) {
TaskContainer tasks = project.tasks
if (!project.configurations.names.contains('console')) {
+ if (!tasks.names.contains('findMainClass')) {
+ project.logger.info('Project {} does not contain the findMainClass task so the console & shell tasks will not be created.', project.name)
+ return
+ }
+
NamedDomainObjectProvider consoleConfiguration = project.configurations.register('console')
def consoleTask = createConsoleTask(project, tasks, consoleConfiguration)
def shellTask = createShellTask(project, tasks, consoleConfiguration)
tasks.named('findMainClass').configure {
it.doLast {
- ExtraPropertiesExtension extraProperties = (ExtraPropertiesExtension) project.getExtensions().getByName("ext")
+ def extraProperties = project.getExtensions().getByType(ExtraPropertiesExtension)
+ if (!extraProperties.has('mainClassName')) {
+ return // disabled because we don't expect to run a grails app (likely a plugin)
+ }
+
def mainClassName = extraProperties.get('mainClassName')
if (mainClassName) {
consoleTask.get().args mainClassName
@@ -566,20 +586,20 @@ class GrailsGradlePlugin extends GroovyPlugin {
@CompileDynamic
protected TaskProvider createConsoleTask(Project project, TaskContainer tasks, NamedDomainObjectProvider configuration) {
- def consoleTask = tasks.register("console", JavaExec)
+ def consoleTask = tasks.register('console', JavaExec)
consoleTask.configure {
it.classpath = project.sourceSets.main.runtimeClasspath + configuration.get()
- it.mainClass.set("grails.ui.console.GrailsSwingConsole")
+ it.mainClass.set('grails.ui.console.GrailsSwingConsole')
}
consoleTask
}
@CompileDynamic
protected TaskProvider createShellTask(Project project, TaskContainer tasks, NamedDomainObjectProvider configuration) {
- def shellTask = tasks.register("shell", JavaExec)
+ def shellTask = tasks.register('shell', JavaExec)
shellTask.configure {
it.classpath = project.sourceSets.main.runtimeClasspath + configuration.get()
- it.mainClass.set("grails.ui.shell.GrailsShell")
+ it.mainClass.set('grails.ui.shell.GrailsShell')
it.standardInput = System.in
}
shellTask
@@ -597,14 +617,34 @@ class GrailsGradlePlugin extends GroovyPlugin {
protected void registerFindMainClassTask(Project project) {
TaskContainer taskContainer = project.tasks
- def findMainClassTask = taskContainer.findByName("findMainClass")
- if (findMainClassTask == null) {
- findMainClassTask = project.tasks.register("findMainClass", FindMainClassTask).get()
- findMainClassTask.mustRunAfter(project.tasks.withType(GroovyCompile))
- } else if (!FindMainClassTask.class.isAssignableFrom(findMainClassTask.class)) {
- def grailsFindMainClass = project.tasks.register("grailsFindMainClass", FindMainClassTask).get()
- grailsFindMainClass.dependsOn(findMainClassTask)
- findMainClassTask.finalizedBy(grailsFindMainClass)
+
+ def existingTask = taskContainer.findByName('findMainClass')
+ if (existingTask == null) {
+ def findMainClassTask = project.tasks.register('findMainClass', FindMainClassTask)
+
+ def mainClassFileContainer = project.layout.buildDirectory.file('resolvedMainClassName')
+ def mainClassProvider = project.providers.fileContents(mainClassFileContainer).asText.map {
+ it.trim()
+ }
+ project.tasks.withType(BootArchive).configureEach { BootArchive bootTask ->
+ bootTask.dependsOn(findMainClassTask)
+ bootTask.inputs.file(mainClassFileContainer)
+ bootTask.mainClass.convention(mainClassProvider)
+ }
+ project.tasks.withType(BootRun).configureEach { BootRun it ->
+ it.dependsOn(findMainClassTask)
+ it.inputs.file(mainClassFileContainer)
+ it.mainClass.convention(mainClassProvider)
+ }
+
+ findMainClassTask.configure {
+ it.mustRunAfter(project.tasks.withType(GroovyCompile))
+ }
+ project.tasks.withType(ResolveMainClassName).configureEach {
+ it.dependsOn(findMainClassTask)
+ }
+ } else if (!FindMainClassTask.class.isAssignableFrom(existingTask.class)) {
+ project.logger.warn('Grails Projects typically register a findMainClass task to force the MainClass resolution for Spring Boot. This task already exists so this will not occur.')
}
}
@@ -634,8 +674,8 @@ class GrailsGradlePlugin extends GroovyPlugin {
'info.app.grailsVersion': grailsVersion
]
- task.from(project.relativePath("src/main/templates")) { spec ->
- spec.into("META-INF/templates")
+ task.from(project.relativePath('src/main/templates')) { spec ->
+ spec.into('META-INF/templates')
}
if (!native2ascii) {
@@ -672,7 +712,7 @@ class GrailsGradlePlugin extends GroovyPlugin {
TaskProvider native2asciiTask = tasks.register('native2ascii').configure {
it.doLast {
it.ant.native2ascii(src: src, dest: dest,
- includes: "**/*.properties", encoding: "UTF-8")
+ includes: '**/*.properties', encoding: 'UTF-8')
}
it.inputs.dir(src)
it.outputs.dir(dest)
@@ -684,7 +724,7 @@ class GrailsGradlePlugin extends GroovyPlugin {
@CompileDynamic
protected void configureRunScript(Project project) {
if(!project.tasks.names.contains('runScript')) {
- project.tasks.register("runScript", ApplicationContextScriptTask).configure {
+ project.tasks.register('runScript', ApplicationContextScriptTask).configure {
SourceSet mainSourceSet = SourceSets.findMainSourceSet(project)
it.classpath = mainSourceSet.runtimeClasspath + project.configurations.getByName('console')
it.systemProperty Environment.KEY, System.getProperty(Environment.KEY, Environment.DEVELOPMENT.getName())
@@ -699,7 +739,7 @@ class GrailsGradlePlugin extends GroovyPlugin {
@CompileDynamic
protected void configureRunCommand(Project project) {
if(!project.tasks.names.contains('runCommand')) {
- project.tasks.register("runCommand", ApplicationContextCommandTask).configure {
+ project.tasks.register('runCommand', ApplicationContextCommandTask).configure {
SourceSet mainSourceSet = SourceSets.findMainSourceSet(project)
it.classpath = mainSourceSet.runtimeClasspath + project.configurations.getByName('console')
it.systemProperty Environment.KEY, System.getProperty(Environment.KEY, Environment.DEVELOPMENT.getName())
@@ -712,16 +752,16 @@ class GrailsGradlePlugin extends GroovyPlugin {
}
protected FileCollection resolveClassesDirs(SourceSetOutput output, Project project) {
- output?.classesDirs ?: project.files(new File(project.buildDir, "classes/main"))
+ output?.classesDirs ?: project.files(project.layout.buildDirectory.dir('classes/main'))
}
protected FileCollection buildClasspath(Project project, Configuration... configurations) {
SourceSet mainSourceSet = SourceSets.findMainSourceSet(project)
SourceSetOutput output = mainSourceSet?.output
FileCollection mainFiles = resolveClassesDirs(output, project)
- FileCollection fileCollection = project.files("${project.buildDir}/resources/main", "${project.projectDir}/gsp-classes") + mainFiles
+ FileCollection fileCollection = project.files(project.layout.buildDirectory.dir('resources/main'), project.layout.buildDirectory.dir('gsp-classes')) + mainFiles
configurations.each {
- fileCollection = fileCollection + it.filter({ File file -> !file.name.startsWith("spring-boot-devtools") })
+ fileCollection = fileCollection + it.filter({ File file -> !file.name.startsWith('spring-boot-devtools') })
}
fileCollection
}
diff --git a/grails-gradle/plugins/src/main/groovy/org/grails/gradle/plugin/publishing/GrailsPublishGradlePlugin.groovy b/grails-gradle/plugins/src/main/groovy/org/grails/gradle/plugin/publishing/GrailsPublishGradlePlugin.groovy
index 2b3b30aa391..8b6366528fd 100644
--- a/grails-gradle/plugins/src/main/groovy/org/grails/gradle/plugin/publishing/GrailsPublishGradlePlugin.groovy
+++ b/grails-gradle/plugins/src/main/groovy/org/grails/gradle/plugin/publishing/GrailsPublishGradlePlugin.groovy
@@ -1,18 +1,20 @@
/*
- * 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
+ * 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
+ * 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.
+ * 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.
*/
package org.grails.gradle.plugin.publishing
@@ -136,40 +138,40 @@ Note: if project properties are used, the properties must be defined prior to ap
isRelease = Boolean.parseBoolean(System.getenv(ENVIRONMENT_VARIABLE_BASED_RELEASE))
isSnapshot = !isRelease
- project.rootProject.logger.lifecycle("Environment Variable `$ENVIRONMENT_VARIABLE_BASED_RELEASE` detected - using variable instead of project version.")
+ project.rootProject.logger.lifecycle('Environment Variable `{}` detected - using variable instead of project version.', ENVIRONMENT_VARIABLE_BASED_RELEASE)
} else {
String detectedVersion = (project.version == Project.DEFAULT_VERSION ? (project.findProperty('projectVersion') ?: Project.DEFAULT_VERSION) : project.version) as String
if (detectedVersion == Project.DEFAULT_VERSION) {
throw new IllegalStateException("Project ${project.name} has an unspecified version (neither `version` or the property `projectVersion` is defined). Release state cannot be determined.")
}
- project.rootProject.logger.info("Version $detectedVersion detected for project ${project.name}")
+ project.rootProject.logger.info('Version {} detected for project {}', detectedVersion, project.name)
isSnapshot = detectedVersion.endsWith('SNAPSHOT')
isRelease = !isSnapshot
if (project.version == Project.DEFAULT_VERSION) {
if (isRelease) {
- project.rootProject.logger.warn("Project ${project.name} does not have a version defined. Using the gradle property `projectVersion` to assume version is ${detectedVersion}.")
+ project.rootProject.logger.warn('Project {} does not have a version defined. Using the gradle property `projectVersion` to assume version is {}.', project.name, detectedVersion)
} else {
- project.rootProject.logger.info("Project ${project.name} does not have a version defined. Using the gradle property `projectVersion` to assume version is ${detectedVersion}.")
+ project.rootProject.logger.info('Project {} does not have a version defined. Using the gradle property `projectVersion` to assume version is {}.', project.name, detectedVersion)
}
}
}
if (isSnapshot) {
- project.rootProject.logger.info("Project ${project.name} will be a snapshot.")
+ project.rootProject.logger.info('Project {} will be a snapshot.', project.name)
}
if (isRelease) {
- project.rootProject.logger.info("Project ${project.name} will be a release.")
+ project.rootProject.logger.info('Project {} will be a release.', project.name)
}
boolean useMavenPublish = (isSnapshot && snapshotPublishType == PublishType.MAVEN_PUBLISH) || (isRelease && releasePublishType == PublishType.MAVEN_PUBLISH)
if (useMavenPublish) {
- project.rootProject.logger.info("Maven Publish is enabled for project ${project.name}")
+ project.rootProject.logger.info('Maven Publish is enabled for project {}', project.name)
}
boolean useNexusPublish = (isSnapshot && snapshotPublishType == PublishType.NEXUS_PUBLISH) || (isRelease && releasePublishType == PublishType.NEXUS_PUBLISH)
if (useNexusPublish) {
- project.rootProject.logger.info("Nexus Publish is enabled for project ${project.name}")
+ project.rootProject.logger.info('Nexus Publish is enabled for project {}', project.name)
}
// Required for the pom always
@@ -178,7 +180,7 @@ Note: if project properties are used, the properties must be defined prior to ap
if (isRelease || useNexusPublish) {
if (project.pluginManager.hasPlugin(SIGNING_PLUGIN_ID)) {
- project.rootProject.logger.debug("Signing Plugin already applied to project {}", project.name)
+ project.rootProject.logger.debug('Signing Plugin already applied to project {}', project.name)
} else {
projectPluginManager.apply(SigningPlugin)
}
@@ -194,7 +196,7 @@ Note: if project properties are used, the properties must be defined prior to ap
final PluginManager rootProjectPluginManager = project.rootProject.pluginManager
boolean hasNexusPublishApplied = rootProjectPluginManager.hasPlugin(NEXUS_PUBLISH_PLUGIN_ID)
if (hasNexusPublishApplied) {
- project.rootProject.logger.debug("Nexus Publish Plugin already applied to root project")
+ project.rootProject.logger.debug('Nexus Publish Plugin already applied to root project')
} else {
rootProjectPluginManager.apply(NexusPublishPlugin)
}
@@ -435,7 +437,7 @@ Note: if project properties are used, the properties must be defined prior to ap
protected void registerValidationTask(Project project, String taskName, Closure c) {
project.plugins.withId(MAVEN_PUBLISH_PLUGIN_ID) {
- TaskProvider extends Task> publishTask = project.tasks.named("publish")
+ TaskProvider extends Task> publishTask = project.tasks.named('publish')
TaskProvider validateTask = project.tasks.register(taskName, c)
publishTask.configure {
@@ -450,7 +452,7 @@ Note: if project properties are used, the properties must be defined prior to ap
publication.from project.components.javaPlatform
if (gpe.publishTestSources) {
- throw new RuntimeException("BOM publishes may only contain dependencies.")
+ throw new RuntimeException('BOM publishes may only contain dependencies.')
}
return
@@ -490,10 +492,10 @@ Note: if project properties are used, the properties must be defined prior to ap
if (!hasJavaPlugin && !hasJavaPlatform) {
if (!hasJavaPlugin) {
- throw new RuntimeException("Grails Publish Plugin requires the Java Plugin to be applied to the project.")
+ throw new RuntimeException('Grails Publish Plugin requires the Java Plugin to be applied to the project.')
}
- throw new RuntimeException("Grails Publish Plugin requires the Java Platform Plugin to be applied to the project.")
+ throw new RuntimeException('Grails Publish Plugin requires the Java Platform Plugin to be applied to the project.')
}
if (hasJavaPlatform) {
@@ -509,7 +511,7 @@ Note: if project properties are used, the properties must be defined prior to ap
tasks.named('javadoc').configure {
Task groovyDocTask = tasks.findByName('groovydoc')
if (groovyDocTask) {
- project.rootProject.logger.info("Configuring javadocJar task for project {} to include groovydoc", project.name)
+ project.rootProject.logger.info('Configuring javadocJar task for project {} to include groovydoc', project.name)
it.enabled = false
}
}
@@ -578,11 +580,11 @@ Note: if project properties are used, the properties must be defined prior to ap
// throw new RuntimeException("Cannot apply Grails Publish Plugin. Project ${project.name} does not have anything to publish.")
// }
- registerValidationTask(project, "grailsPublishValidation") {
+ registerValidationTask(project, 'grailsPublishValidation') {
Task groovyDocTask = project.tasks.findByName('groovydoc')
if (groovyDocTask) {
if (!groovyDocTask.enabled) {
- throw new RuntimeException("Groovydoc task is disabled. Please enable it to ensure javadoc can be published correctly with the Grails Publish Plugin.")
+ throw new RuntimeException('Groovydoc task is disabled. Please enable it to ensure javadoc can be published correctly with the Grails Publish Plugin.')
}
}
}
diff --git a/grails-gradle/plugins/src/main/groovy/org/grails/gradle/plugin/run/FindMainClassTask.groovy b/grails-gradle/plugins/src/main/groovy/org/grails/gradle/plugin/run/FindMainClassTask.groovy
index 1e42fd99612..b4adeba9ffe 100644
--- a/grails-gradle/plugins/src/main/groovy/org/grails/gradle/plugin/run/FindMainClassTask.groovy
+++ b/grails-gradle/plugins/src/main/groovy/org/grails/gradle/plugin/run/FindMainClassTask.groovy
@@ -25,10 +25,19 @@ import org.gradle.api.file.FileCollection
import org.gradle.api.file.RegularFile
import org.gradle.api.plugins.ExtraPropertiesExtension
import org.gradle.api.provider.Provider
-import org.gradle.api.tasks.*
+import org.gradle.api.tasks.CacheableTask
+import org.gradle.api.tasks.InputFiles
+import org.gradle.api.tasks.OutputFile
+import org.gradle.api.tasks.PathSensitive
+import org.gradle.api.tasks.PathSensitivity
+import org.gradle.api.tasks.SourceSet
+import org.gradle.api.tasks.SourceSetOutput
+import org.gradle.api.tasks.TaskAction
+import org.grails.gradle.plugin.core.GrailsPluginGradlePlugin
import org.grails.gradle.plugin.util.SourceSets
import org.grails.io.support.MainClassFinder
-import org.springframework.boot.gradle.tasks.run.BootRun
+import org.springframework.boot.gradle.dsl.SpringBootExtension
+import org.springframework.boot.gradle.plugin.SpringBootPlugin
/**
* A task that finds the main task, differs slightly from Boot's version as expects a subclass of GrailsConfiguration
@@ -43,14 +52,29 @@ class FindMainClassTask extends DefaultTask {
@TaskAction
void setMainClassProperty() {
Project project = this.project
- if(project.tasks.names.contains('bootRun')) {
- BootRun bootRun = project.tasks.named("bootRun", BootRun).get()
- String mainClass = findMainClass()
- if (mainClass != null) {
- bootRun.mainClass.set(mainClass)
- ExtraPropertiesExtension extraProperties = (ExtraPropertiesExtension) project.getExtensions().getByName("ext")
- extraProperties.set("mainClassName", mainClass)
- }
+
+ def bootRunTask = project.tasks.findByName('bootRun')
+ if (!bootRunTask || !bootRunTask.enabled) {
+ project.logger.info('The bootRun task does not exist or is disabled, so this must not be a runnable grails application. Skipping finding main class.')
+ return
+ }
+
+ def bootJarTask = project.tasks.findByName(SpringBootPlugin.BOOT_JAR_TASK_NAME)
+ def bootWarTask = project.tasks.findByName(SpringBootPlugin.BOOT_WAR_TASK_NAME)
+ if ((!bootJarTask || !bootJarTask.enabled) && (!bootWarTask || !bootWarTask.enabled)) {
+ project.logger.info('There is neither a {} or {} task that will run. Skipping finding main Application class.', SpringBootPlugin.BOOT_JAR_TASK_NAME, SpringBootPlugin.BOOT_WAR_TASK_NAME)
+ return
+ }
+
+ String mainClass = findMainClass()
+ if (mainClass) {
+ def extraProperties = project.extensions.getByType(ExtraPropertiesExtension)
+ extraProperties.set('mainClassName', mainClass)
+
+ def springBootExtension = project.extensions.getByType(SpringBootExtension)
+ springBootExtension.mainClass.convention(mainClass)
+ } else {
+ project.logger.warn('No main class found. Please set \'springBoot.mainClass\'.')
}
}
@@ -67,7 +91,7 @@ class FindMainClassTask extends DefaultTask {
@OutputFile
Provider getMainClassCacheFile() {
- project.layout.buildDirectory.file('.mainClass')
+ project.layout.buildDirectory.file('resolvedMainClassName')
}
protected String findMainClass() {
@@ -103,7 +127,13 @@ class FindMainClassTask extends DefaultTask {
if (mainClass != null) {
mainClassFile.text = mainClass
} else {
- throw new RuntimeException("Could not find Application main class. Please set 'springBoot.mainClass'.")
+ if (project.plugins.hasPlugin(GrailsPluginGradlePlugin)) {
+ // this is ok if the project is a plugin because it's likely not going to be a runnable grails app
+ project.logger.lifecycle('WARNING: this plugin project does not have an Application.class and thus the bootJar / bootRun will be invalid.')
+ return null
+ }
+
+ throw new RuntimeException('Could not find Application main class. Please set \'springBoot.mainClass\' or disable BootJar & BootArchive tasks.')
}
}
return mainClass
@@ -111,7 +141,7 @@ class FindMainClassTask extends DefaultTask {
}
protected FileCollection resolveClassesDirs(SourceSetOutput output, Project project) {
- output?.classesDirs ?: project.files(new File(project.buildDir, "classes/main"))
+ output?.classesDirs ?: project.files(project.layout.buildDirectory.dir('classes/main'))
}
protected MainClassFinder createMainClassFinder() {
diff --git a/grails-gradle/plugins/src/main/groovy/org/grails/gradle/plugin/views/AbstractGroovyTemplatePlugin.groovy b/grails-gradle/plugins/src/main/groovy/org/grails/gradle/plugin/views/AbstractGroovyTemplatePlugin.groovy
index 44c7844421c..a37776f576f 100644
--- a/grails-gradle/plugins/src/main/groovy/org/grails/gradle/plugin/views/AbstractGroovyTemplatePlugin.groovy
+++ b/grails-gradle/plugins/src/main/groovy/org/grails/gradle/plugin/views/AbstractGroovyTemplatePlugin.groovy
@@ -22,18 +22,15 @@ package org.grails.gradle.plugin.views
import grails.util.GrailsNameUtils
import groovy.transform.CompileDynamic
import groovy.transform.CompileStatic
-import org.apache.tools.ant.taskdefs.condition.Os
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.api.Task
-import org.gradle.api.file.ConfigurableFileCollection
import org.gradle.api.file.Directory
import org.gradle.api.file.FileCollection
import org.gradle.api.provider.Provider
import org.gradle.api.tasks.SourceSetOutput
import org.gradle.api.tasks.TaskContainer
import org.gradle.api.tasks.bundling.Jar
-import org.grails.gradle.plugin.core.GrailsExtension
import org.grails.gradle.plugin.core.IntegrationTestGradlePlugin
import org.grails.gradle.plugin.util.SourceSets
@@ -75,20 +72,6 @@ class AbstractGroovyTemplatePlugin implements Plugin {
FileCollection classesDir = resolveClassesDirs(output, project)
Provider destDir = project.layout.buildDirectory.dir("${templateCompileTask.fileExtension.get()}-classes/main")
output?.dir(destDir)
- project.afterEvaluate {
- GrailsExtension grailsExt = project.extensions.getByType(GrailsExtension)
- if (grailsExt?.pathingJar && Os.isFamily(Os.FAMILY_WINDOWS)) {
- Jar pathingJar = tasks.named('pathingJar', Jar).get()
- ConfigurableFileCollection allClasspath = project.files(
- project.layout.buildDirectory.dir('classes/groovy/main'),
- project.layout.buildDirectory.dir('resources/main'),
- destDir,
- pathingJar.archiveFile
- )
- templateCompileTask.dependsOn(pathingJar)
- templateCompileTask.classpath = allClasspath
- }
- }
def allClasspath = classesDir + project.configurations.named('compileClasspath').get()
templateCompileTask.destinationDirectory.set(destDir)
templateCompileTask.classpath = allClasspath
diff --git a/grails-gradle/plugins/src/main/groovy/org/grails/gradle/plugin/views/gsp/GroovyPagePlugin.groovy b/grails-gradle/plugins/src/main/groovy/org/grails/gradle/plugin/views/gsp/GroovyPagePlugin.groovy
index 770f88f5347..641d024dadf 100644
--- a/grails-gradle/plugins/src/main/groovy/org/grails/gradle/plugin/views/gsp/GroovyPagePlugin.groovy
+++ b/grails-gradle/plugins/src/main/groovy/org/grails/gradle/plugin/views/gsp/GroovyPagePlugin.groovy
@@ -19,10 +19,9 @@
package org.grails.gradle.plugin.views.gsp
import groovy.transform.CompileStatic
-import org.apache.tools.ant.taskdefs.condition.Os
import org.gradle.api.Plugin
import org.gradle.api.Project
-import org.gradle.api.file.ConfigurableFileCollection
+import org.gradle.api.file.CopySpec
import org.gradle.api.file.Directory
import org.gradle.api.file.DuplicatesStrategy
import org.gradle.api.file.FileCollection
@@ -32,7 +31,6 @@ import org.gradle.api.tasks.SourceSetOutput
import org.gradle.api.tasks.TaskContainer
import org.gradle.api.tasks.bundling.Jar
import org.gradle.api.tasks.bundling.War
-import org.grails.gradle.plugin.core.GrailsExtension
import org.grails.gradle.plugin.util.SourceSets
/**
@@ -55,7 +53,7 @@ class GroovyPagePlugin implements Plugin {
SourceSetOutput output = mainSourceSet?.output
FileCollection classesDirs = resolveClassesDirs(output, project)
Provider destDir = project.layout.buildDirectory.dir('gsp-classes/main')
- output?.dir("gsp-classes")
+ output?.dir('gsp-classes')
FileCollection allClasspath = project.getObjects().fileCollection().from(
[
@@ -66,44 +64,22 @@ class GroovyPagePlugin implements Plugin {
].findAll { it }
)
- def compileGroovyPages = tasks.register("compileGroovyPages", GroovyPageForkCompileTask) {
+ def compileGroovyPages = tasks.register('compileGroovyPages', GroovyPageForkCompileTask) {
it.destinationDirectory.set(destDir)
it.tmpDirPath = getTmpDirPath(project)
it.source = project.layout.projectDirectory.dir('grails-app/views')
- it.serverpath.set("/WEB-INF/grails-app/views/")
+ it.serverpath.set('/WEB-INF/grails-app/views/')
it.classpath = allClasspath
}
- def compileWebappGroovyPages = tasks.register("compileWebappGroovyPages", GroovyPageForkCompileTask) {
+ def compileWebappGroovyPages = tasks.register('compileWebappGroovyPages', GroovyPageForkCompileTask) {
it.destinationDirectory.set(destDir)
it.source = project.layout.projectDirectory.dir('src/main/webapp')
it.tmpDirPath = getTmpDirPath(project)
- it.serverpath.set("/")
+ it.serverpath.set('/')
it.classpath = allClasspath
}
- registerGrailsExtension(project)
- project.afterEvaluate {
- GrailsExtension grailsExt = project.extensions.getByType(GrailsExtension)
- if (grailsExt.pathingJar && Os.isFamily(Os.FAMILY_WINDOWS)) {
- Jar pathingJar = tasks.named('pathingJar', Jar).get()
- ConfigurableFileCollection withPathingJarClasspath = project.files(
- project.layout.buildDirectory.dir('classes/groovy/main'),
- project.layout.buildDirectory.dir('resources/main'),
- destDir,
- pathingJar.archiveFile
- )
- compileGroovyPages.configure {
- it.dependsOn(pathingJar)
- it.classpath = withPathingJarClasspath.asFileTree
- }
- compileWebappGroovyPages.configure {
- it.dependsOn(pathingJar)
- it.classpath = withPathingJarClasspath.asFileTree
- }
- }
- }
-
compileGroovyPages.configure {
it.dependsOn(
tasks.named('classes'),
@@ -115,8 +91,9 @@ class GroovyPagePlugin implements Plugin {
war.dependsOn compileGroovyPages
war.duplicatesStrategy = DuplicatesStrategy.EXCLUDE
if (war.name == 'bootWar') {
- war.from(destDir)
- war.into("WEB-INF/classes")
+ war.from(destDir) { CopySpec it ->
+ it.into('WEB-INF/classes')
+ }
} else if (war.name == 'war') {
war.from destDir
}
@@ -133,8 +110,9 @@ class GroovyPagePlugin implements Plugin {
jar.duplicatesStrategy = DuplicatesStrategy.EXCLUDE
if (!(jar instanceof War)) {
if (jar.name == 'bootJar') {
- jar.from(destDir)
- jar.into("BOOT-INF/classes")
+ jar.from(destDir) { CopySpec it ->
+ it.into('BOOT-INF/classes')
+ }
} else if (jar.name == 'jar') {
jar.from destDir
}
@@ -142,12 +120,6 @@ class GroovyPagePlugin implements Plugin {
}
}
- protected GrailsExtension registerGrailsExtension(Project project) {
- if (project.extensions.findByName("grails") == null) {
- project.extensions.add("grails", new GrailsExtension(project))
- }
- }
-
protected FileCollection resolveClassesDirs(SourceSetOutput output, Project project) {
output?.classesDirs ?: project.files(project.layout.buildDirectory.dir('classes/main'))
}
diff --git a/grails-gsp/plugin/src/test/groovy/org/grails/web/taglib/AbstractGrailsTagTests.groovy b/grails-gsp/plugin/src/test/groovy/org/grails/web/taglib/AbstractGrailsTagTests.groovy
index a26736f4965..7229adaff00 100644
--- a/grails-gsp/plugin/src/test/groovy/org/grails/web/taglib/AbstractGrailsTagTests.groovy
+++ b/grails-gsp/plugin/src/test/groovy/org/grails/web/taglib/AbstractGrailsTagTests.groovy
@@ -84,7 +84,10 @@ import javax.xml.xpath.XPath
import javax.xml.xpath.XPathConstants
import javax.xml.xpath.XPathFactory
-import static org.junit.jupiter.api.Assertions.*
+import static org.junit.jupiter.api.Assertions.assertEquals
+import static org.junit.jupiter.api.Assertions.assertFalse
+import static org.junit.jupiter.api.Assertions.assertTrue
+import static org.junit.jupiter.api.Assertions.fail
abstract class AbstractGrailsTagTests {
@@ -300,7 +303,7 @@ abstract class AbstractGrailsTagTests {
def dependantPluginClasses = []
dependantPluginClasses << gcl.loadClass('org.grails.plugins.CoreGrailsPlugin')
- dependantPluginClasses << gcl.loadClass('org.grails.plugins.CodecsGrailsPlugin')
+ dependantPluginClasses << gcl.loadClass('org.grails.plugins.codecs.CodecsGrailsPlugin')
dependantPluginClasses << gcl.loadClass('org.grails.plugins.domain.DomainClassGrailsPlugin')
dependantPluginClasses << gcl.loadClass('org.grails.plugins.i18n.I18nGrailsPlugin')
dependantPluginClasses << gcl.loadClass('org.grails.plugins.web.mapping.UrlMappingsGrailsPlugin')
diff --git a/grails-i18n/src/main/resources/META-INF/grails-plugin.xml b/grails-i18n/src/main/resources/META-INF/grails-plugin.xml
deleted file mode 100644
index 23cfc1be622..00000000000
--- a/grails-i18n/src/main/resources/META-INF/grails-plugin.xml
+++ /dev/null
@@ -1,3 +0,0 @@
-
- org.grails.plugins.i18n.I18nGrailsPlugin
-
\ No newline at end of file
diff --git a/grails-rest-transforms/src/main/resources/META-INF/grails-plugin.xml b/grails-rest-transforms/src/main/resources/META-INF/grails-plugin.xml
deleted file mode 100644
index b624e1207fd..00000000000
--- a/grails-rest-transforms/src/main/resources/META-INF/grails-plugin.xml
+++ /dev/null
@@ -1,3 +0,0 @@
-
- org.grails.plugins.web.rest.plugin.RestResponderGrailsPlugin
-
\ No newline at end of file
diff --git a/grails-rest-transforms/src/main/resources/META-INF/grails.factories b/grails-rest-transforms/src/main/resources/META-INF/grails.factories
deleted file mode 100644
index 6a5af32b8e1..00000000000
--- a/grails-rest-transforms/src/main/resources/META-INF/grails.factories
+++ /dev/null
@@ -1 +0,0 @@
-grails.compiler.traits.TraitInjector=grails.compiler.traits.RestResponderTraitInjector
diff --git a/grails-services/src/main/resources/META-INF/grails-plugin.xml b/grails-services/src/main/resources/META-INF/grails-plugin.xml
deleted file mode 100644
index dcbf53863b9..00000000000
--- a/grails-services/src/main/resources/META-INF/grails-plugin.xml
+++ /dev/null
@@ -1,3 +0,0 @@
-
- org.grails.plugins.services.ServicesGrailsPlugin
-
\ No newline at end of file
diff --git a/grails-test-examples/app2/build.gradle b/grails-test-examples/app2/build.gradle
index a97a48e251c..a0e44af4d82 100644
--- a/grails-test-examples/app2/build.gradle
+++ b/grails-test-examples/app2/build.gradle
@@ -59,4 +59,8 @@ apply {
from rootProject.layout.projectDirectory.file('gradle/functional-test-config.gradle')
from rootProject.layout.projectDirectory.file('gradle/java-config.gradle')
from rootProject.layout.projectDirectory.file('gradle/test-webjar-asset-config.gradle')
-}
\ No newline at end of file
+}
+
+//bootRun {
+// jvmArgs("-Xdebug", "-Xnoagent", "-Djava.compiler=NONE", "-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005")
+//}
\ No newline at end of file
diff --git a/grails-test-examples/app2/grails-app/controllers/UrlMappings.groovy b/grails-test-examples/app2/grails-app/controllers/UrlMappings.groovy
index 25e64ab8d54..367787543ad 100644
--- a/grails-test-examples/app2/grails-app/controllers/UrlMappings.groovy
+++ b/grails-test-examples/app2/grails-app/controllers/UrlMappings.groovy
@@ -26,6 +26,7 @@ class UrlMappings {
}
}
+ "/favicon.ico"(uri: "/assets/favicon.ico")
"/"(view:"/index")
"404"(view:'/notFound')
"500"(controller:'errors', action:"index")
diff --git a/grails-test-examples/app2/grails-app/controllers/app2/ErrorsController.groovy b/grails-test-examples/app2/grails-app/controllers/app2/ErrorsController.groovy
index 3567faebd68..92a44792936 100644
--- a/grails-test-examples/app2/grails-app/controllers/app2/ErrorsController.groovy
+++ b/grails-test-examples/app2/grails-app/controllers/app2/ErrorsController.groovy
@@ -22,6 +22,6 @@ package app2
class ErrorsController {
def index() {
- render "error occured"
+ render 'my error occurred'
}
}
diff --git a/grails-test-examples/app2/src/integration-test/groovy/app2/ErrorsControllerSpec.groovy b/grails-test-examples/app2/src/integration-test/groovy/app2/ErrorsControllerSpec.groovy
index 4706ed2402d..e18f9dfe6f0 100644
--- a/grails-test-examples/app2/src/integration-test/groovy/app2/ErrorsControllerSpec.groovy
+++ b/grails-test-examples/app2/src/integration-test/groovy/app2/ErrorsControllerSpec.groovy
@@ -22,7 +22,6 @@ package app2
import grails.gorm.transactions.Rollback
import grails.plugin.geb.ContainerGebSpec
import grails.testing.mixin.integration.Integration
-import spock.lang.PendingFeature
/**
*/
@@ -31,11 +30,11 @@ import spock.lang.PendingFeature
class ErrorsControllerSpec extends ContainerGebSpec {
void "Test a global 500 mapping that maps to another controller"() {
- when:"An action that throws a error that is handled by a 500 mapping in UrlMappings.groovy"
- go '/test/throwGeneralError'
+ when: "An action that throws a error that is handled by a 500 mapping in UrlMappings.groovy"
+ go '/test/throwGeneralError'
- then:"The correct action is executed"
- driver.pageSource.contains 'error occured'
+ then: "The correct action is executed"
+ driver.pageSource.contains 'my error occurred'
}
}
diff --git a/grails-test-examples/external-configuration/build.gradle b/grails-test-examples/external-configuration/build.gradle
index e66e5638954..cbb2c2f28fc 100644
--- a/grails-test-examples/external-configuration/build.gradle
+++ b/grails-test-examples/external-configuration/build.gradle
@@ -20,12 +20,6 @@
apply plugin: 'groovy'
apply plugin: 'org.apache.grails.gradle.grails-web'
-repositories {
- maven { url = 'https://repo.grails.org/grails/restricted' }
- maven { url = 'https://repository.apache.org/content/groups/snapshots' }
- mavenCentral()
-}
-
version = '0.1'
group = 'test.app'
diff --git a/grails-test-examples/geb/build.gradle b/grails-test-examples/geb/build.gradle
index 463de3be01f..1644a5fb3ef 100644
--- a/grails-test-examples/geb/build.gradle
+++ b/grails-test-examples/geb/build.gradle
@@ -25,12 +25,6 @@ apply plugin: 'asset-pipeline'
group = 'org.demo.spock'
version = projectVersion
-repositories {
- maven { url = 'https://repo.grails.org/grails/restricted' }
- maven { url = 'https://repository.apache.org/content/groups/snapshots' }
- mavenCentral()
-}
-
dependencies {
implementation platform(project(':grails-bom'))
diff --git a/grails-testing-support-web/src/main/groovy/org/grails/testing/spock/WebSetupSpecInterceptor.groovy b/grails-testing-support-web/src/main/groovy/org/grails/testing/spock/WebSetupSpecInterceptor.groovy
index ec55aeaa77a..449f34a3346 100644
--- a/grails-testing-support-web/src/main/groovy/org/grails/testing/spock/WebSetupSpecInterceptor.groovy
+++ b/grails-testing-support-web/src/main/groovy/org/grails/testing/spock/WebSetupSpecInterceptor.groovy
@@ -33,7 +33,7 @@ import org.grails.datastore.gorm.validation.constraints.registry.DefaultConstrai
import org.grails.datastore.mapping.keyvalue.mapping.config.KeyValueMappingContext
import org.grails.gsp.GroovyPagesTemplateEngine
import org.grails.gsp.jsp.TagLibraryResolverImpl
-import org.grails.plugins.CodecsGrailsPlugin
+import org.grails.plugins.codecs.CodecsGrailsPlugin
import org.grails.plugins.codecs.DefaultCodecLookup
import org.grails.plugins.converters.ConvertersGrailsPlugin
import org.grails.plugins.web.rest.render.DefaultRendererRegistry
diff --git a/grails-url-mappings/src/main/resources/META-INF/grails-plugin.xml b/grails-url-mappings/src/main/resources/META-INF/grails-plugin.xml
deleted file mode 100644
index c592ade31d9..00000000000
--- a/grails-url-mappings/src/main/resources/META-INF/grails-plugin.xml
+++ /dev/null
@@ -1,3 +0,0 @@
-
- org.grails.plugins.web.mapping.UrlMappingsGrailsPlugin
-
\ No newline at end of file
diff --git a/grails-web-databinding/src/main/groovy/grails/web/databinding/DataBindingUtils.java b/grails-web-databinding/src/main/groovy/grails/web/databinding/DataBindingUtils.java
index 72da7d2bfac..f45424747a6 100644
--- a/grails-web-databinding/src/main/groovy/grails/web/databinding/DataBindingUtils.java
+++ b/grails-web-databinding/src/main/groovy/grails/web/databinding/DataBindingUtils.java
@@ -168,7 +168,7 @@ public static void bindToCollection(final Class targetType, final Collect
PersistentEntity entity = null;
if (application != null) {
try {
- entity = application.getMappingContext().getPersistentEntity(targetType.getClass().getName());
+ entity = application.getMappingContext().getPersistentEntity(targetType.getName());
} catch (GrailsConfigurationException e) {
//no-op
}
diff --git a/grails-web-databinding/src/main/resources/META-INF/grails.factories b/grails-web-databinding/src/main/resources/META-INF/grails.factories
deleted file mode 100644
index 69fbad2cfc4..00000000000
--- a/grails-web-databinding/src/main/resources/META-INF/grails.factories
+++ /dev/null
@@ -1 +0,0 @@
-grails.compiler.traits.TraitInjector=grails.compiler.traits.WebDataBindingTraitInjector
\ No newline at end of file