From cb35a34e7a9ab78b29c21f2ab1df2c5516f9d961 Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Mon, 18 May 2026 23:53:14 +0000
Subject: [PATCH 1/5] Initial plan
From 4fdd8a1c7860fce4b5c84e0eea0c600c9ab7e982 Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Mon, 18 May 2026 23:57:40 +0000
Subject: [PATCH 2/5] Add Automatic-Module-Name metadata for core and kotlin
jars
Agent-Logs-Url: https://github.com/MorphiaOrg/morphia/sessions/84565e58-a094-40a0-9413-4ff40e4629d8
Co-authored-by: evanchooly <195021+evanchooly@users.noreply.github.com>
---
core/pom.xml | 7 +++++
.../dev/morphia/test/ModuleMetadataTest.java | 26 +++++++++++++++++++
kotlin/pom.xml | 18 ++++++++++++-
3 files changed, 50 insertions(+), 1 deletion(-)
create mode 100644 core/src/test/java/dev/morphia/test/ModuleMetadataTest.java
diff --git a/core/pom.xml b/core/pom.xml
index 7fbd1d7130c..ba39503eacf 100644
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -18,6 +18,13 @@
org.apache.maven.plugins
maven-jar-plugin
3.5.0
+
+
+
+ dev.morphia.core
+
+
+
test-jar
diff --git a/core/src/test/java/dev/morphia/test/ModuleMetadataTest.java b/core/src/test/java/dev/morphia/test/ModuleMetadataTest.java
new file mode 100644
index 00000000000..e1309525111
--- /dev/null
+++ b/core/src/test/java/dev/morphia/test/ModuleMetadataTest.java
@@ -0,0 +1,26 @@
+package dev.morphia.test;
+
+import java.io.File;
+import java.nio.file.Files;
+
+import org.testng.annotations.Test;
+
+import static dev.morphia.test.TestBase.GIT_ROOT;
+import static org.testng.Assert.assertTrue;
+
+public class ModuleMetadataTest {
+ @Test
+ public void coreJarDefinesAutomaticModuleName() throws Exception {
+ assertPomContains("core/pom.xml", "dev.morphia.core");
+ }
+
+ @Test
+ public void kotlinJarDefinesAutomaticModuleName() throws Exception {
+ assertPomContains("kotlin/pom.xml", "dev.morphia.kotlin");
+ }
+
+ private static void assertPomContains(String path, String value) throws Exception {
+ String pom = Files.readString(new File(GIT_ROOT, path).toPath());
+ assertTrue(pom.contains(value), "Expected " + path + " to contain " + value);
+ }
+}
diff --git a/kotlin/pom.xml b/kotlin/pom.xml
index 1554fef890b..012f0dec010 100644
--- a/kotlin/pom.xml
+++ b/kotlin/pom.xml
@@ -12,6 +12,23 @@
morphia-kotlin
+
+
+
+ org.apache.maven.plugins
+ maven-jar-plugin
+ 3.5.0
+
+
+
+ dev.morphia.kotlin
+
+
+
+
+
+
+
dev.morphia.morphia
@@ -47,4 +64,3 @@
-
From dcd8874dc9f1ef5c3833bb3801cdc71879db814f Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Tue, 19 May 2026 00:01:30 +0000
Subject: [PATCH 3/5] Refine module metadata checks and centralize jar plugin
version
Agent-Logs-Url: https://github.com/MorphiaOrg/morphia/sessions/84565e58-a094-40a0-9413-4ff40e4629d8
Co-authored-by: evanchooly <195021+evanchooly@users.noreply.github.com>
---
core/pom.xml | 1 -
.../dev/morphia/test/ModuleMetadataTest.java | 38 ++++++++++++++++---
kotlin/pom.xml | 1 -
pom.xml | 7 +++-
4 files changed, 38 insertions(+), 9 deletions(-)
diff --git a/core/pom.xml b/core/pom.xml
index ba39503eacf..b24f6420d2d 100644
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -17,7 +17,6 @@
org.apache.maven.plugins
maven-jar-plugin
- 3.5.0
diff --git a/core/src/test/java/dev/morphia/test/ModuleMetadataTest.java b/core/src/test/java/dev/morphia/test/ModuleMetadataTest.java
index e1309525111..cb0231c3d11 100644
--- a/core/src/test/java/dev/morphia/test/ModuleMetadataTest.java
+++ b/core/src/test/java/dev/morphia/test/ModuleMetadataTest.java
@@ -1,26 +1,52 @@
package dev.morphia.test;
import java.io.File;
-import java.nio.file.Files;
+import java.io.FileReader;
+import java.util.Optional;
+import org.apache.maven.model.Model;
+import org.apache.maven.model.Plugin;
+import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
+import org.codehaus.plexus.util.xml.Xpp3Dom;
import org.testng.annotations.Test;
import static dev.morphia.test.TestBase.GIT_ROOT;
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertNotNull;
import static org.testng.Assert.assertTrue;
public class ModuleMetadataTest {
@Test
public void coreJarDefinesAutomaticModuleName() throws Exception {
- assertPomContains("core/pom.xml", "dev.morphia.core");
+ assertAutomaticModuleName("core/pom.xml", "dev.morphia.core");
}
@Test
public void kotlinJarDefinesAutomaticModuleName() throws Exception {
- assertPomContains("kotlin/pom.xml", "dev.morphia.kotlin");
+ assertAutomaticModuleName("kotlin/pom.xml", "dev.morphia.kotlin");
}
- private static void assertPomContains(String path, String value) throws Exception {
- String pom = Files.readString(new File(GIT_ROOT, path).toPath());
- assertTrue(pom.contains(value), "Expected " + path + " to contain " + value);
+ private static void assertAutomaticModuleName(String path, String expectedValue) throws Exception {
+ MavenXpp3Reader reader = new MavenXpp3Reader();
+ Model model;
+ try (FileReader fileReader = new FileReader(new File(GIT_ROOT, path).getAbsoluteFile())) {
+ model = reader.read(fileReader);
+ }
+
+ Optional plugin = model.getBuild().getPlugins().stream()
+ .filter(p -> "maven-jar-plugin".equals(p.getArtifactId()))
+ .findFirst();
+
+ assertTrue(plugin.isPresent(), "Expected maven-jar-plugin in " + path);
+
+ Xpp3Dom configuration = (Xpp3Dom) plugin.get().getConfiguration();
+ assertNotNull(configuration, "Expected maven-jar-plugin configuration in " + path);
+ Xpp3Dom archive = configuration.getChild("archive");
+ assertNotNull(archive, "Expected archive configuration in " + path);
+ Xpp3Dom manifestEntries = archive.getChild("manifestEntries");
+ assertNotNull(manifestEntries, "Expected manifestEntries configuration in " + path);
+ Xpp3Dom automaticModuleName = manifestEntries.getChild("Automatic-Module-Name");
+ assertNotNull(automaticModuleName, "Expected Automatic-Module-Name entry in " + path);
+ assertEquals(automaticModuleName.getValue(), expectedValue);
}
}
diff --git a/kotlin/pom.xml b/kotlin/pom.xml
index 012f0dec010..9123058f7c3 100644
--- a/kotlin/pom.xml
+++ b/kotlin/pom.xml
@@ -17,7 +17,6 @@
org.apache.maven.plugins
maven-jar-plugin
- 3.5.0
diff --git a/pom.xml b/pom.xml
index ac8c7710da6..907ae8f36b6 100644
--- a/pom.xml
+++ b/pom.xml
@@ -94,7 +94,12 @@
-parameters
-
+
+
+
+ org.apache.maven.plugins
+ maven-jar-plugin
+ 3.5.0
org.revapi
From 12747f31d35908a1dbe1c7038ab70044411e3b13 Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Fri, 29 May 2026 01:53:15 +0000
Subject: [PATCH 4/5] Migrate module metadata test to JUnit
---
.../test/java/dev/morphia/test/ModuleMetadataTest.java | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/core/src/test/java/dev/morphia/test/ModuleMetadataTest.java b/core/src/test/java/dev/morphia/test/ModuleMetadataTest.java
index cb0231c3d11..d76c9c0d818 100644
--- a/core/src/test/java/dev/morphia/test/ModuleMetadataTest.java
+++ b/core/src/test/java/dev/morphia/test/ModuleMetadataTest.java
@@ -8,12 +8,12 @@
import org.apache.maven.model.Plugin;
import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
import org.codehaus.plexus.util.xml.Xpp3Dom;
-import org.testng.annotations.Test;
+import org.junit.jupiter.api.Test;
import static dev.morphia.test.TestBase.GIT_ROOT;
-import static org.testng.Assert.assertEquals;
-import static org.testng.Assert.assertNotNull;
-import static org.testng.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
public class ModuleMetadataTest {
@Test
From 6b59067642bda502b94fc998b5bdff2c05d3924a Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Fri, 29 May 2026 02:13:34 +0000
Subject: [PATCH 5/5] Add automatic module names to deployed modules
---
annotations/pom.xml | 16 +++++++++++++++
.../dev/morphia/test/ModuleMetadataTest.java | 20 +++++++++++++++++++
critter/critter-maven/pom.xml | 11 ++++++++++
rewrite/pom.xml | 11 ++++++++++
validation/pom.xml | 16 +++++++++++++++
5 files changed, 74 insertions(+)
diff --git a/annotations/pom.xml b/annotations/pom.xml
index bfcaf2d17ab..e1d0d1311c3 100644
--- a/annotations/pom.xml
+++ b/annotations/pom.xml
@@ -13,6 +13,22 @@
morphia-annotations
Morphia Annotations
+
+
+
+ org.apache.maven.plugins
+ maven-jar-plugin
+
+
+
+ dev.morphia.annotations
+
+
+
+
+
+
+
org.mongodb
diff --git a/core/src/test/java/dev/morphia/test/ModuleMetadataTest.java b/core/src/test/java/dev/morphia/test/ModuleMetadataTest.java
index d76c9c0d818..d3bb0581466 100644
--- a/core/src/test/java/dev/morphia/test/ModuleMetadataTest.java
+++ b/core/src/test/java/dev/morphia/test/ModuleMetadataTest.java
@@ -26,6 +26,26 @@ public void kotlinJarDefinesAutomaticModuleName() throws Exception {
assertAutomaticModuleName("kotlin/pom.xml", "dev.morphia.kotlin");
}
+ @Test
+ public void annotationsJarDefinesAutomaticModuleName() throws Exception {
+ assertAutomaticModuleName("annotations/pom.xml", "dev.morphia.annotations");
+ }
+
+ @Test
+ public void validationJarDefinesAutomaticModuleName() throws Exception {
+ assertAutomaticModuleName("validation/pom.xml", "dev.morphia.validation");
+ }
+
+ @Test
+ public void rewriteJarDefinesAutomaticModuleName() throws Exception {
+ assertAutomaticModuleName("rewrite/pom.xml", "dev.morphia.rewrite");
+ }
+
+ @Test
+ public void critterMavenJarDefinesAutomaticModuleName() throws Exception {
+ assertAutomaticModuleName("critter/critter-maven/pom.xml", "dev.morphia.critter.maven");
+ }
+
private static void assertAutomaticModuleName(String path, String expectedValue) throws Exception {
MavenXpp3Reader reader = new MavenXpp3Reader();
Model model;
diff --git a/critter/critter-maven/pom.xml b/critter/critter-maven/pom.xml
index 70cb029f28b..d876f8ec844 100644
--- a/critter/critter-maven/pom.xml
+++ b/critter/critter-maven/pom.xml
@@ -17,6 +17,17 @@
+
+ org.apache.maven.plugins
+ maven-jar-plugin
+
+
+
+ dev.morphia.critter.maven
+
+
+
+
org.jetbrains.kotlin
kotlin-maven-plugin
diff --git a/rewrite/pom.xml b/rewrite/pom.xml
index e77da8aee2f..813b7cce6a5 100644
--- a/rewrite/pom.xml
+++ b/rewrite/pom.xml
@@ -34,6 +34,17 @@
+
+ org.apache.maven.plugins
+ maven-jar-plugin
+
+
+
+ dev.morphia.rewrite
+
+
+
+
org.apache.maven.plugins
maven-compiler-plugin
diff --git a/validation/pom.xml b/validation/pom.xml
index ee1164b7d17..e566f39cc69 100644
--- a/validation/pom.xml
+++ b/validation/pom.xml
@@ -13,6 +13,22 @@
morphia-validation
Morphia Validation
+
+
+
+ org.apache.maven.plugins
+ maven-jar-plugin
+
+
+
+ dev.morphia.validation
+
+
+
+
+
+
+
dev.morphia.morphia