This is an automated email from the ASF dual-hosted git repository. jamesfredley pushed a commit to branch remove-embedded-mongodb-feature in repository https://gitbox.apache.org/repos/asf/grails-core.git
commit bcc429c7a9b1a6021cefc35550ef4b044ceaa8cf Author: James Fredley <[email protected]> AuthorDate: Thu Aug 21 18:57:36 2025 -0400 Remove embedded-mongodb feature and references Eliminated the embedded-mongodb feature, its documentation, implementation, tests, and dependencies from the project. Updated MongoDB feature configuration and related documentation to reflect this removal. --- .../src/en/guide/commandLine/creatingProject.adoc | 2 +- .../src/en/guide/commandLine/interactiveMode.adoc | 3 +- .../src/en/ref/Command Line/create-plugin.adoc | 2 +- .../src/en/ref/Command Line/create-restapi.adoc | 2 +- .../src/en/ref/Command Line/create-web-plugin.adoc | 2 +- grails-doc/src/en/ref/Command Line/help.adoc | 2 +- .../src/en/ref/Command Line/list-features.adoc | 1 - .../forge/feature/database/EmbeddedMongo.java | 91 ---------------------- .../grails-forge-core/src/main/resources/pom.xml | 6 -- .../feature/database/EmbeddedMongoSpec.groovy | 66 ---------------- .../forge/feature/database/MongoGormSpec.groovy | 14 +--- grails-profiles/base/features/mongodb/feature.yml | 4 +- 12 files changed, 8 insertions(+), 187 deletions(-) diff --git a/grails-doc/src/en/guide/commandLine/creatingProject.adoc b/grails-doc/src/en/guide/commandLine/creatingProject.adoc index 89bd0b4f88..73091f24d5 100644 --- a/grails-doc/src/en/guide/commandLine/creatingProject.adoc +++ b/grails-doc/src/en/guide/commandLine/creatingProject.adoc @@ -175,7 +175,7 @@ The "create-*" commands are used to produce a fundamental Grails project, allowi ---- | -f, --features -| The features to use. Possible values: h2, gorm-hibernate5, spring-boot-starter-jetty, micronaut-http-client, cache-ehcache, hibernate-validator, postgres, mysql, cache, database-migration, grails-gsp, hamcrest, gorm-mongodb, assertj, mockito, spring-boot-starter-undertow, github-workflow-java-ci, jrebel, testcontainers, sqlserver, grails-console, views-markup, views-json, gorm-neo4j, asciidoctor, embedded-mongodb, grails-web-console, logbackGroovy, mongo-sync, shade, properties +| The features to use. Possible values: h2, gorm-hibernate5, spring-boot-starter-jetty, micronaut-http-client, cache-ehcache, hibernate-validator, postgres, mysql, cache, database-migration, grails-gsp, hamcrest, gorm-mongodb, assertj, mockito, spring-boot-starter-undertow, github-workflow-java-ci, jrebel, testcontainers, sqlserver, grails-console, views-markup, views-json, gorm-neo4j, asciidoctor, grails-web-console, logbackGroovy, mongo-sync, shade, properties | [source,shell] ---- diff --git a/grails-doc/src/en/guide/commandLine/interactiveMode.adoc b/grails-doc/src/en/guide/commandLine/interactiveMode.adoc index 82b41e5b55..e111e0f25d 100644 --- a/grails-doc/src/en/guide/commandLine/interactiveMode.adoc +++ b/grails-doc/src/en/guide/commandLine/interactiveMode.adoc @@ -73,7 +73,7 @@ Creates an application assertj, mockito, spring-boot-starter-undertow, github-workflow-java-ci, jrebel, testcontainers, sqlserver, grails-console, views-markup, asset-pipeline-grails, views-json, - gorm-neo4j, asciidoctor, embedded-mongodb, grails-web-console, + gorm-neo4j, asciidoctor, grails-web-console, logbackGroovy, mongo-sync, shade, geb, properties -g, --gorm=GORM Implementation Which GORM Implementation to configure. Possible values: hibernate, @@ -116,7 +116,6 @@ Available Features Database database-migration Adds support for Liquibase database migrations. The Database Migration plugin helps you manage database changes while developing Grails applications. - embedded-mongodb Executes an embedded mongo database for integration or functional testing gorm-hibernate5 (+) Adds support for Hibernate5 using GORM gorm-mongodb Configures GORM for MongoDB for Groovy applications gorm-neo4j Configures GORM for Neo4j for Groovy applications diff --git a/grails-doc/src/en/ref/Command Line/create-plugin.adoc b/grails-doc/src/en/ref/Command Line/create-plugin.adoc index 0332164916..ee9f88f044 100644 --- a/grails-doc/src/en/ref/Command Line/create-plugin.adoc +++ b/grails-doc/src/en/ref/Command Line/create-plugin.adoc @@ -70,7 +70,7 @@ Options include specifying features, configuring the GORM implementation, select Here are the available options for the create-plugin command: -- -f, --features=FEATURE[,FEATURE...]: Specifies the features to include in the plugin. Available options include h2, gorm-hibernate5, spring-boot-starter-jetty, micronaut-http-client, cache-ehcache, hibernate-validator, postgres, mysql, cache, database-migration, grails-gsp, hamcrest, gorm-mongodb, assertj, mockito, spring-boot-starter-undertow, github-workflow-java-ci, jrebel, testcontainers, sqlserver, grails-console, views-markup, views-json, gorm-neo4j, asciidoctor, embedded-mongod [...] +- -f, --features=FEATURE[,FEATURE...]: Specifies the features to include in the plugin. Available options include h2, gorm-hibernate5, spring-boot-starter-jetty, micronaut-http-client, cache-ehcache, hibernate-validator, postgres, mysql, cache, database-migration, grails-gsp, hamcrest, gorm-mongodb, assertj, mockito, spring-boot-starter-undertow, github-workflow-java-ci, jrebel, testcontainers, sqlserver, grails-console, views-markup, views-json, gorm-neo4j, asciidoctor, grails-web-cons [...] - -g, --gorm=GORM Implementation: Specifies the GORM Implementation to configure for the plugin. Possible values are hibernate, mongodb, neo4j. - -h, --help: Displays the help message and exits. - -i, --inplace: Creates a service within the current directory. diff --git a/grails-doc/src/en/ref/Command Line/create-restapi.adoc b/grails-doc/src/en/ref/Command Line/create-restapi.adoc index d90abc816a..69c47c943c 100644 --- a/grails-doc/src/en/ref/Command Line/create-restapi.adoc +++ b/grails-doc/src/en/ref/Command Line/create-restapi.adoc @@ -40,7 +40,7 @@ The `create-restapi` command accepts the following options: - `NAME`: The desired name for the REST API application. -- `-f, --features=FEATURE[,FEATURE...]`: Specifies the features to include. Available options include h2, scaffolding, gorm-hibernate5, spring-boot-starter-jetty, spring-boot-starter-tomcat, micronaut-http-client, cache-ehcache, hibernate-validator, postgres, mysql, cache, database-migration, grails-gsp, hamcrest, gorm-mongodb, assertj, mockito, spring-boot-starter-undertow, github-workflow-java-ci, jrebel, testcontainers, sqlserver, grails-console, views-markup, asset-pipeline-grails, v [...] +- `-f, --features=FEATURE[,FEATURE...]`: Specifies the features to include. Available options include h2, scaffolding, gorm-hibernate5, spring-boot-starter-jetty, spring-boot-starter-tomcat, micronaut-http-client, cache-ehcache, hibernate-validator, postgres, mysql, cache, database-migration, grails-gsp, hamcrest, gorm-mongodb, assertj, mockito, spring-boot-starter-undertow, github-workflow-java-ci, jrebel, testcontainers, sqlserver, grails-console, views-markup, asset-pipeline-grails, v [...] - `-g, --gorm=GORM Implementation`: Specifies the GORM Implementation to configure, with options like hibernate, mongodb, neo4j. diff --git a/grails-doc/src/en/ref/Command Line/create-web-plugin.adoc b/grails-doc/src/en/ref/Command Line/create-web-plugin.adoc index 3348c5206e..02d3a48c91 100644 --- a/grails-doc/src/en/ref/Command Line/create-web-plugin.adoc +++ b/grails-doc/src/en/ref/Command Line/create-web-plugin.adoc @@ -38,7 +38,7 @@ grails create-web-plugin [OPTIONS] NAME Here are the available options for the `create-web-plugin` command: -- `-f, --features=FEATURE[,FEATURE...]`: Specifies the features to include in the plugin. Available options include h2, gorm-hibernate5, spring-boot-starter-jetty, micronaut-http-client, cache-ehcache, hibernate-validator, postgres, mysql, cache, database-migration, grails-gsp, hamcrest, gorm-mongodb, assertj, mockito, spring-boot-starter-undertow, github-workflow-java-ci, jrebel, testcontainers, sqlserver, grails-console, views-markup, views-json, gorm-neo4j, asciidoctor, embedded-mongo [...] +- `-f, --features=FEATURE[,FEATURE...]`: Specifies the features to include in the plugin. Available options include h2, gorm-hibernate5, spring-boot-starter-jetty, micronaut-http-client, cache-ehcache, hibernate-validator, postgres, mysql, cache, database-migration, grails-gsp, hamcrest, gorm-mongodb, assertj, mockito, spring-boot-starter-undertow, github-workflow-java-ci, jrebel, testcontainers, sqlserver, grails-console, views-markup, views-json, gorm-neo4j, asciidoctor, grails-web-con [...] - `-g, --gorm=GORM Implementation`: Specifies the GORM Implementation to configure for the plugin. Possible values are hibernate, mongodb, neo4j. diff --git a/grails-doc/src/en/ref/Command Line/help.adoc b/grails-doc/src/en/ref/Command Line/help.adoc index c29a670693..d4290d21ce 100644 --- a/grails-doc/src/en/ref/Command Line/help.adoc +++ b/grails-doc/src/en/ref/Command Line/help.adoc @@ -146,7 +146,7 @@ Creates an application assertj, mockito, spring-boot-starter-undertow, github-workflow-java-ci, jrebel, testcontainers, sqlserver, grails-console, views-markup, asset-pipeline-grails, views-json, - gorm-neo4j, asciidoctor, embedded-mongodb, grails-web-console, + gorm-neo4j, asciidoctor, grails-web-console, logbackGroovy, mongo-sync, shade, geb, properties -g, --gorm=GORM Implementation Which GORM Implementation to configure. Possible values: hibernate, diff --git a/grails-doc/src/en/ref/Command Line/list-features.adoc b/grails-doc/src/en/ref/Command Line/list-features.adoc index 00bf3d3f5e..807e011c02 100644 --- a/grails-doc/src/en/ref/Command Line/list-features.adoc +++ b/grails-doc/src/en/ref/Command Line/list-features.adoc @@ -65,7 +65,6 @@ Available Features Database database-migration Adds support for Liquibase database migrations. The Database Migration plugin helps you manage database changes while developing Grails applications. - embedded-mongodb Executes an embedded mongo database for integration or functional testing gorm-hibernate5 (+) Adds support for Hibernate5 using GORM gorm-mongodb Configures GORM for MongoDB for Groovy applications gorm-neo4j Configures GORM for Neo4j for Groovy applications diff --git a/grails-forge/grails-forge-core/src/main/java/org/grails/forge/feature/database/EmbeddedMongo.java b/grails-forge/grails-forge-core/src/main/java/org/grails/forge/feature/database/EmbeddedMongo.java deleted file mode 100644 index 922846c46e..0000000000 --- a/grails-forge/grails-forge-core/src/main/java/org/grails/forge/feature/database/EmbeddedMongo.java +++ /dev/null @@ -1,91 +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.forge.feature.database; - -import io.micronaut.core.annotation.Nullable; -import jakarta.inject.Singleton; -import org.grails.forge.application.ApplicationType; -import org.grails.forge.application.generator.GeneratorContext; -import org.grails.forge.build.dependencies.Dependency; -import org.grails.forge.build.dependencies.Scope; -import org.grails.forge.feature.Category; -import org.grails.forge.feature.Feature; -import org.grails.forge.feature.FeatureContext; - -import java.util.Map; - -@Singleton -public class EmbeddedMongo implements Feature { - - private MongoFeature mongoFeature; - - public EmbeddedMongo(MongoFeature mongoFeature) { - this.mongoFeature = mongoFeature; - } - - @Override - public String getName() { - return "embedded-mongodb"; - } - - @Override - public String getTitle() { - return "Embedded MongoDB Grails Plugin"; - } - - @Override - public String getDescription() { - return "Executes an embedded mongo database for integration or functional testing"; - } - - @Override - public boolean supports(ApplicationType applicationType) { - return true; - } - - @Override - public String getCategory() { - return Category.DATABASE; - } - - @Nullable - @Override - public String getThirdPartyDocumentation() { - return "https://grails-plugins.github.io/grails-embedded-mongodb/latest"; - } - - @Override - public void processSelectedFeatures(FeatureContext featureContext) { - if (!featureContext.isPresent(MongoFeature.class) && mongoFeature != null) { - featureContext.addFeature(mongoFeature); - } - } - - @Override - public void apply(GeneratorContext generatorContext) { - Map<String, Object> config = generatorContext.getConfiguration(); - config.put("environments.test.grails.mongodb.version", "${EMBEDDED_MONGO_VERSION:3.2.1}"); - config.put("environments.test.grails.mongodb.port", "${EMBEDDED_MONGO_PORT:27018}"); - generatorContext.getBuildProperties().put("embedded-mongo.version", "2.2.0"); - generatorContext.addDependency(Dependency.builder() - .groupId("org.grails.plugins") - .lookupArtifactId("embedded-mongodb") - .scope(Scope.TEST_RUNTIME_ONLY)); - } -} 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 caf28977c9..3dd8c70a66 100644 --- a/grails-forge/grails-forge-core/src/main/resources/pom.xml +++ b/grails-forge/grails-forge-core/src/main/resources/pom.xml @@ -48,12 +48,6 @@ <artifactId>cache-ehcache</artifactId> <version>3.0.0</version> </dependency> - <dependency> - <!-- Last released Oct 17, 2022 --> - <groupId>org.grails.plugins</groupId> - <artifactId>embedded-mongodb</artifactId> - <version>2.0.1</version> - </dependency> <dependency> <groupId>org.asciidoctor.jvm.convert</groupId> <artifactId>asciidoctor-gradle-jvm</artifactId> diff --git a/grails-forge/grails-forge-core/src/test/groovy/org/grails/forge/feature/database/EmbeddedMongoSpec.groovy b/grails-forge/grails-forge-core/src/test/groovy/org/grails/forge/feature/database/EmbeddedMongoSpec.groovy deleted file mode 100644 index 0c1b4b1011..0000000000 --- a/grails-forge/grails-forge-core/src/test/groovy/org/grails/forge/feature/database/EmbeddedMongoSpec.groovy +++ /dev/null @@ -1,66 +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.forge.feature.database - -import org.grails.forge.ApplicationContextSpec -import org.grails.forge.BuildBuilder -import org.grails.forge.application.generator.GeneratorContext -import org.grails.forge.feature.Features -import org.grails.forge.fixture.CommandOutputFixture - -class EmbeddedMongoSpec extends ApplicationContextSpec implements CommandOutputFixture { - - void "test embedded mongo feature"() { - when: - Features features = getFeatures(['embedded-mongodb']) - - then: - features.contains('embedded-mongodb') - } - - void "test dependencies are present for gradle"() { - when: - String template = new BuildBuilder(beanContext) - .features(["embedded-mongodb"]) - .render() - - then: - template.contains("testRuntimeOnly \"org.grails.plugins:embedded-mongodb:2.0.1\"") - } - - void "test config"() { - when: - GeneratorContext ctx = buildGeneratorContext(["embedded-mongodb"]) - - then: - ctx.getConfiguration().containsKey("environments.test.grails.mongodb.version") - ctx.getConfiguration().containsKey("environments.test.grails.mongodb.port") - } - - void "test gradle properties"() { - when: - def output = generate(["embedded-mongodb"]) - def properties = output["gradle.properties"] - - then: - properties - properties.contains("embedded-mongo.version=2.2.0") - } -} diff --git a/grails-forge/grails-forge-core/src/test/groovy/org/grails/forge/feature/database/MongoGormSpec.groovy b/grails-forge/grails-forge-core/src/test/groovy/org/grails/forge/feature/database/MongoGormSpec.groovy index cf3bd13096..bc7144bb36 100644 --- a/grails-forge/grails-forge-core/src/test/groovy/org/grails/forge/feature/database/MongoGormSpec.groovy +++ b/grails-forge/grails-forge-core/src/test/groovy/org/grails/forge/feature/database/MongoGormSpec.groovy @@ -37,11 +37,10 @@ class MongoGormSpec extends ApplicationContextSpec implements CommandOutputFixtu void "test Mongo gorm with Embedded MongoDB features "() { when: - Features features = getFeatures(['gorm-mongodb', 'embedded-mongodb']) + Features features = getFeatures(['gorm-mongodb']) then: features.contains("gorm-mongodb") - features.contains("embedded-mongodb") } void "test there can only be one of either MongoDB or Neo4j feature"() { @@ -63,17 +62,6 @@ class MongoGormSpec extends ApplicationContextSpec implements CommandOutputFixtu template.contains("implementation \"org.apache.grails:grails-data-mongodb\"") } - void "test gorm mongodb with embedded-mongodb feature"() { - when: - String template = new BuildBuilder(beanContext) - .features(["gorm-mongodb", "embedded-mongodb"]) - .render() - - then: - template.contains("implementation \"org.apache.grails:grails-data-mongodb\"") - template.contains("testRuntimeOnly \"org.grails.plugins:embedded-mongodb:2.0.1\"") - } - void "test config"() { when: GeneratorContext ctx = buildGeneratorContext(['gorm-mongodb']) diff --git a/grails-profiles/base/features/mongodb/feature.yml b/grails-profiles/base/features/mongodb/feature.yml index c265920c85..3b25783203 100644 --- a/grails-profiles/base/features/mongodb/feature.yml +++ b/grails-profiles/base/features/mongodb/feature.yml @@ -1,6 +1,4 @@ description: Adds GORM for MongoDB to the project dependencies: - scope: implementation - coords: 'org.apache.grails:grails-data-mongodb' - - scope: compileOnly - coords: 'org.grails.plugins:embedded-mongodb:2.0.1' \ No newline at end of file + coords: 'org.apache.grails:grails-data-mongodb' \ No newline at end of file
