You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@grails.apache.org by ma...@apache.org on 2026/09/24 18:35:29 UTC
(grails-core) 01/01: Rely on the grails-bom for the Forge grails-quartz version
This is an automated email from the ASF dual-hosted git repository.
matrei pushed a commit to branch fix/forge-quartz-bom-version
in repository https://gitbox.apache.org/repos/asf/grails-core.git
commit 97642a1328bdcd5d1e061b179a403508c506b769
Author: Mattias Reichel <ma...@gmail.com>
AuthorDate: Thu Sep 24 20:35:11 2026 +0200
Rely on the grails-bom for the Forge grails-quartz version
The grails-quartz feature looked up an explicit version from the Forge
feature pom, so generated applications pinned grails-quartz to 4.0.0
even though the grails-bom already manages it. Declare the dependency
without a version and drop the stale lookup entry.
---
.../grails/forge/api/PreviewControllerSpec.groovy | 2 +-
.../grails/forge/feature/other/GrailsQuartz.java | 2 +-
.../grails-forge-core/src/main/resources/pom.xml | 5 --
.../forge/feature/other/GrailsQuartzSpec.groovy | 60 ++++++++++++++++++++++
4 files changed, 62 insertions(+), 7 deletions(-)
diff --git a/grails-forge/grails-forge-api/src/test/groovy/org/grails/forge/api/PreviewControllerSpec.groovy b/grails-forge/grails-forge-api/src/test/groovy/org/grails/forge/api/PreviewControllerSpec.groovy
index 1330ed5828..ac2d343d4b 100644
--- a/grails-forge/grails-forge-api/src/test/groovy/org/grails/forge/api/PreviewControllerSpec.groovy
+++ b/grails-forge/grails-forge-api/src/test/groovy/org/grails/forge/api/PreviewControllerSpec.groovy
@@ -47,7 +47,7 @@ class PreviewControllerSpec extends Specification {
def map = client.previewApp(ApplicationType.DEFAULT_OPTION, "test", [GrailsQuartz.FEATURE_NAME], null, null, null)
then:
- map.contents['build.gradle'].contains('org.apache.grails:grails-quartz')
+ map.contents['build.gradle'].contains('implementation "org.apache.grails:grails-quartz"')
}
void "test preview - bad feature"() {
diff --git a/grails-forge/grails-forge-core/src/main/java/org/grails/forge/feature/other/GrailsQuartz.java b/grails-forge/grails-forge-core/src/main/java/org/grails/forge/feature/other/GrailsQuartz.java
index bcc607cca8..98a1d25d75 100644
--- a/grails-forge/grails-forge-core/src/main/java/org/grails/forge/feature/other/GrailsQuartz.java
+++ b/grails-forge/grails-forge-core/src/main/java/org/grails/forge/feature/other/GrailsQuartz.java
@@ -50,7 +50,7 @@ public class GrailsQuartz implements Feature {
generatorContext.getConfiguration().put("quartz.autoStartup", true);
generatorContext.addDependency(Dependency.builder()
.groupId("org.apache.grails")
- .lookupArtifactId("grails-quartz")
+ .artifactId("grails-quartz")
.implementation());
}
diff --git a/grails-forge/grails-forge-core/src/main/resources/pom.xml b/grails-forge/grails-forge-core/src/main/resources/pom.xml
index db049da432..2ce6321e44 100644
--- a/grails-forge/grails-forge-core/src/main/resources/pom.xml
+++ b/grails-forge/grails-forge-core/src/main/resources/pom.xml
@@ -43,11 +43,6 @@
<artifactId>grails-web-console</artifactId>
<version>7.0.0</version>
</dependency>
- <dependency>
- <groupId>org.apache.grails</groupId>
- <artifactId>grails-quartz</artifactId>
- <version>4.0.0</version>
- </dependency>
<dependency>
<!-- Last released Feb 24, 2021 -->
<groupId>org.grails.plugins</groupId>
diff --git a/grails-forge/grails-forge-core/src/test/groovy/org/grails/forge/feature/other/GrailsQuartzSpec.groovy b/grails-forge/grails-forge-core/src/test/groovy/org/grails/forge/feature/other/GrailsQuartzSpec.groovy
new file mode 100644
index 0000000000..dee32af44c
--- /dev/null
+++ b/grails-forge/grails-forge-core/src/test/groovy/org/grails/forge/feature/other/GrailsQuartzSpec.groovy
@@ -0,0 +1,60 @@
+/*
+ * 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.forge.feature.other
+
+import groovy.yaml.YamlSlurper
+import org.grails.forge.ApplicationContextSpec
+import org.grails.forge.BuildBuilder
+import org.grails.forge.application.ApplicationType
+import org.grails.forge.feature.Features
+import org.grails.forge.fixture.CommandOutputFixture
+import org.grails.forge.options.DevelopmentReloading
+import org.grails.forge.options.Options
+
+class GrailsQuartzSpec extends ApplicationContextSpec implements CommandOutputFixture {
+
+ void "test grails-quartz feature"() {
+ when:
+ final Features features = getFeatures([GrailsQuartz.FEATURE_NAME])
+
+ then:
+ features.contains(GrailsQuartz.FEATURE_NAME)
+ }
+
+ void "test grails-quartz dependency version is managed by the grails-bom"() {
+ when:
+ final String template = new BuildBuilder(beanContext)
+ .features([GrailsQuartz.FEATURE_NAME])
+ .render()
+
+ then:
+ template.contains('implementation "org.apache.grails:grails-quartz"')
+ !template.contains('org.apache.grails:grails-quartz:')
+ }
+
+ void "test grails-quartz enables quartz auto startup"() {
+ when:
+ final def output = generate(ApplicationType.WEB, new Options(DevelopmentReloading.DEVTOOLS), [GrailsQuartz.FEATURE_NAME])
+ final def config = new YamlSlurper().parseText(output["grails-app/conf/application.yml"])
+
+ then:
+ config['quartz.autoStartup'] == true
+ }
+}