You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@grails.apache.org by jd...@apache.org on 2025/09/24 17:17:50 UTC
(grails-core) branch removeSpringLoaded created (now 705f5410d8)
This is an automated email from the ASF dual-hosted git repository.
jdaugherty pushed a change to branch removeSpringLoaded
in repository https://gitbox.apache.org/repos/asf/grails-core.git
at 705f5410d8 14993 - remove springloaded
This branch includes the following new commits:
new 705f5410d8 14993 - remove springloaded
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
(grails-core) 01/01: 14993 - remove springloaded
Posted by jd...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
jdaugherty pushed a commit to branch removeSpringLoaded
in repository https://gitbox.apache.org/repos/asf/grails-core.git
commit 705f5410d8782ff85094c8e7901e45cad0daa3c5
Author: James Daugherty <jd...@jdresources.net>
AuthorDate: Wed Sep 24 13:17:24 2025 -0400
14993 - remove springloaded
---
dependencies.gradle | 2 -
.../tools/ClassRelativeClassLoaderSpec.groovy | 2 +-
.../src/main/groovy/grails/util/Environment.groovy | 9 ---
.../gradle/plugin/agent/AgentTasksEnhancer.groovy | 88 ----------------------
.../gradle/plugin/core/GrailsExtension.groovy | 32 --------
.../gradle/plugin/core/GrailsGradlePlugin.groovy | 19 -----
6 files changed, 1 insertion(+), 151 deletions(-)
diff --git a/dependencies.gradle b/dependencies.gradle
index 82b6bf7766..e24cbec7be 100644
--- a/dependencies.gradle
+++ b/dependencies.gradle
@@ -40,7 +40,6 @@ ext {
'objenesis.version' : '3.4',
'gradle-spock.version' : '2.3-groovy-3.0',
'spring-boot.version' : '3.5.6',
- 'springloaded.version' : '1.2.8.RELEASE',
]
// Note: the name of the dependency must be the prefix of the property name so properties in the pom are resolved correctly
@@ -68,7 +67,6 @@ ext {
'objenesis' : "org.objenesis:objenesis:${gradleBomDependencyVersions['objenesis.version']}",
'spring-boot-cli' : "org.springframework.boot:spring-boot-cli:${gradleBomDependencyVersions['spring-boot.version']}",
'spring-boot-gradle' : "org.springframework.boot:spring-boot-gradle-plugin:${gradleBomDependencyVersions['spring-boot.version']}",
- 'springloaded' : "org.springframework:springloaded:${gradleBomDependencyVersions['springloaded.version']}",
]
bomDependencyVersions = [
diff --git a/grails-core/src/test/groovy/org/grails/core/support/internal/tools/ClassRelativeClassLoaderSpec.groovy b/grails-core/src/test/groovy/org/grails/core/support/internal/tools/ClassRelativeClassLoaderSpec.groovy
index 034897cb38..ff3b693fcb 100644
--- a/grails-core/src/test/groovy/org/grails/core/support/internal/tools/ClassRelativeClassLoaderSpec.groovy
+++ b/grails-core/src/test/groovy/org/grails/core/support/internal/tools/ClassRelativeClassLoaderSpec.groovy
@@ -34,6 +34,6 @@ class ClassRelativeClassLoaderSpec extends Specification {
classLoader.getResource('org/grails/core/support/internal/tools/ClassRelativeClassLoaderSpec.class')
and:"other classpath resources are not found"
- !classLoader.getResource('springloaded.properties')
+ !classLoader.getResource('NOTICE')
}
}
diff --git a/grails-gradle/model/src/main/groovy/grails/util/Environment.groovy b/grails-gradle/model/src/main/groovy/grails/util/Environment.groovy
index bfe7d265a1..f022420d0c 100644
--- a/grails-gradle/model/src/main/groovy/grails/util/Environment.groovy
+++ b/grails-gradle/model/src/main/groovy/grails/util/Environment.groovy
@@ -638,15 +638,6 @@ enum Environment {
}
catch (ClassNotFoundException e) {
RELOADING_AGENT_ENABLED = false
- try {
- Class.forName('org.springsource.loaded.TypeRegistry')
- String jvmVersion = System.getProperty('java.specification.version')
- LOG.get().debug('Found spring-loaded on the class path')
- RELOADING_AGENT_ENABLED = getCurrent().isReloadEnabled()
- }
- catch (ClassNotFoundException e1) {
- RELOADING_AGENT_ENABLED = false
- }
}
return RELOADING_AGENT_ENABLED
}
diff --git a/grails-gradle/plugins/src/main/groovy/org/grails/gradle/plugin/agent/AgentTasksEnhancer.groovy b/grails-gradle/plugins/src/main/groovy/org/grails/gradle/plugin/agent/AgentTasksEnhancer.groovy
deleted file mode 100644
index 0e15ca4120..0000000000
--- a/grails-gradle/plugins/src/main/groovy/org/grails/gradle/plugin/agent/AgentTasksEnhancer.groovy
+++ /dev/null
@@ -1,88 +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.gradle.plugin.agent
-
-import groovy.transform.CompileStatic
-
-import org.gradle.api.Action
-import org.gradle.api.Project
-import org.gradle.api.Task
-import org.gradle.api.artifacts.ResolvedArtifact
-import org.gradle.api.tasks.JavaExec
-
-import org.grails.gradle.plugin.core.GrailsExtension
-
-/**
- * Sets up the reloading agent based on the agent configuration after the project has been configured
- *
- * @author Graeme Rocher
- */
-@CompileStatic
-class AgentTasksEnhancer implements Action<Project> {
-
- @Override
- void execute(Project project) {
- try {
- Set<ResolvedArtifact> agentJars = project.getConfigurations().getByName('agent').resolvedConfiguration.resolvedArtifacts
-
- if (agentJars) {
- File agentJar = agentJars.iterator().next().file
- for (Task task : project.getTasks()) {
- if (task instanceof JavaExec) {
- addAgent(project, (JavaExec) task, agentJar)
- }
- }
- }
- } catch (Throwable e) {
- project.logger.warn("Cannot resolve reloading agent JAR: ${e.message}")
- }
- }
-
- private void addAgent(Project project, JavaExec exec, File agent) {
-
- GrailsExtension.Agent agentConfig = project.extensions.findByType(GrailsExtension)?.agent ?: new GrailsExtension.Agent()
- if (agentConfig.enabled) {
- exec.jvmArgs("-javaagent:${agentConfig.path?.absolutePath ?: agent.absolutePath}")
-
- for (String arg in agentConfig.jvmArgs) {
- exec.jvmArgs(arg)
- }
- for (Map.Entry<String, String> entry in agentConfig.systemProperties) {
- exec.systemProperty(entry.key, entry.value)
- }
-
- Map<String, String> agentArgs = [
- inclusions: agentConfig.inclusions,
- synchronize: String.valueOf(agentConfig.synchronize),
- allowSplitPackages: String.valueOf(agentConfig.allowSplitPackages),
- cacheDir: agentConfig.cacheDir ? project.mkdir(agentConfig.cacheDir) : project.mkdir('build/springloaded')
- ] as Map<String, String>
- if (agentConfig.logging != null) {
- agentArgs.put('logging', String.valueOf(agentConfig.logging))
- }
- if (agentConfig.exclusions) {
- agentArgs.put('exclusions', agentConfig.exclusions)
- }
- agentArgs.put('profile', 'grails')
- agentArgs.put('caching', 'true')
- exec.systemProperty('springloaded', agentArgs.collect { entry -> "$entry.key=$entry.value" }.join(';'))
- }
-
- }
-}
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 d345847087..75a6c80297 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
@@ -76,21 +76,6 @@ class GrailsExtension {
*/
boolean micronautAutoSetup = true
- /**
- * Configure the reloading agent
- */
- Agent agent = new Agent()
-
- /**
- * Configure the reloading agent
- */
- Agent agent(@DelegatesTo(Agent) Closure configurer) {
- configurer.delegate = agent
- configurer.resolveStrategy = Closure.DELEGATE_FIRST
- configurer.call()
- return agent
- }
-
DependencyHandler getPlugins() {
if (pluginDefiner == null) {
pluginDefiner = new PluginDefiner(project)
@@ -110,23 +95,6 @@ class GrailsExtension {
ConfigureUtil.configure(configureClosure, plugins)
}
- /**
- * Configuration for the reloading agent
- */
- static class Agent {
- boolean enabled = true
- File path
- String inclusions = 'grails.plugins..*'
- String exclusions
- Boolean logging
- boolean synchronize = true
- boolean allowSplitPackages = true
- File cacheDir = new File('build/springloaded')
-
- Map<String, String> systemProperties = ['jdk.reflect.allowGetCallerClass': 'true']
- List<String> jvmArgs = ['-Xverify:none']
- }
-
boolean isDevelopmentRun() {
boolean devMode = Environment.developmentEnvironmentAvailable && Environment.developmentMode
if (!devMode) {
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 a640b93977..8d740d22f3 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
@@ -68,7 +68,6 @@ import grails.util.GrailsNameUtils
import grails.util.Metadata
import org.apache.grails.gradle.common.PropertyFileUtils
import org.grails.build.parsing.CommandLineParser
-import org.grails.gradle.plugin.agent.AgentTasksEnhancer
import org.grails.gradle.plugin.commands.ApplicationContextCommandTask
import org.grails.gradle.plugin.commands.ApplicationContextScriptTask
import org.grails.gradle.plugin.exploded.ExplodedCompatibilityRule
@@ -135,8 +134,6 @@ class GrailsGradlePlugin extends GroovyPlugin {
configureGrailsBuildSettings(project)
- configureFileWatch(project)
-
String grailsVersion = resolveGrailsVersion(project)
enableNative2Ascii(project, grailsVersion)
@@ -426,12 +423,6 @@ class GrailsGradlePlugin extends GroovyPlugin {
}
}
- @CompileStatic
- protected void configureFileWatch(Project project) {
- def environment = Environment.getCurrent()
- enableFileWatch(environment, project)
- }
-
@CompileStatic
protected String configureGrailsBuildSettings(Project project) {
System.setProperty(BuildSettings.APP_BASE_DIR, project.projectDir.absolutePath)
@@ -631,16 +622,6 @@ class GrailsGradlePlugin extends GroovyPlugin {
shellTask
}
- @CompileDynamic
- protected void enableFileWatch(Environment environment, Project project) {
- if (environment.isReloadEnabled()) {
- project.configurations {
- agent
- }
- project.afterEvaluate(new AgentTasksEnhancer())
- }
- }
-
@CompileDynamic
protected void registerFindMainClassTask(Project project) {
TaskContainer taskContainer = project.tasks