[OPENJPA-2896] automatic module name is set for bundles (#92)

* [OPENJPA-2896] automatic module name is set for bundles

* Automatic-module-names for fat jars only

* 'org.apache.openjpa.jakarta' is dropped

* auto-module-name is dropped from openjpa-all
diff --git a/openjpa-all/pom.xml b/openjpa-all/pom.xml
index 26974e5..1c15072 100644
--- a/openjpa-all/pom.xml
+++ b/openjpa-all/pom.xml
@@ -35,9 +35,6 @@
     <packaging>jar</packaging>
     <name>OpenJPA Aggregate Jar with Dependencies</name>
 
-    <properties>
-        <automatic-module-name>org.apache.openjpa.all</automatic-module-name>
-    </properties>
     <build>
         <plugins>
             <!-- disable creating javadoc for this module -->
diff --git a/openjpa-examples/image-gallery/pom.xml b/openjpa-examples/image-gallery/pom.xml
index 4b3f159..6dd6a1f 100644
--- a/openjpa-examples/image-gallery/pom.xml
+++ b/openjpa-examples/image-gallery/pom.xml
@@ -42,7 +42,6 @@
     <test.jvm.maxheapsize>1024m</test.jvm.maxheapsize>
     <test.jvm.arguments>-Xmx${test.jvm.maxheapsize}</test.jvm.arguments>
     <surefire.jvm.args>${test.jvm.arguments}</surefire.jvm.args>
-    <automatic-module-name>org.apache.openjpa.examples.gallery</automatic-module-name>
     <checkstyle.suppressions.location>${project.basedir}${file.separator}..${file.separator}..${file.separator}openjpa-project${file.separator}suppressions.xml</checkstyle.suppressions.location>
   </properties>
 
diff --git a/openjpa-examples/openbooks/pom.xml b/openjpa-examples/openbooks/pom.xml
index d4ef913..c24a191 100644
--- a/openjpa-examples/openbooks/pom.xml
+++ b/openjpa-examples/openbooks/pom.xml
@@ -41,7 +41,6 @@
 
     <properties>
         <checkstyle.suppressions.location>${project.basedir}${file.separator}..${file.separator}..${file.separator}openjpa-project${file.separator}suppressions.xml</checkstyle.suppressions.location>
-        <automatic-module-name>org.apache.openjpa.examples.openbooks</automatic-module-name>
     </properties>
     <dependencies>
         <dependency>
diff --git a/openjpa-examples/simple/pom.xml b/openjpa-examples/simple/pom.xml
index 836cf53..9a3ca4f 100644
--- a/openjpa-examples/simple/pom.xml
+++ b/openjpa-examples/simple/pom.xml
@@ -48,7 +48,6 @@
 
     <properties>
         <checkstyle.suppressions.location>${project.basedir}${file.separator}..${file.separator}..${file.separator}openjpa-project${file.separator}suppressions.xml</checkstyle.suppressions.location>
-        <automatic-module-name>org.apache.openjpa.examples.simple</automatic-module-name>
     </properties>
     <build>
         <plugins>
diff --git a/openjpa-integration/daytrader/pom.xml b/openjpa-integration/daytrader/pom.xml
index 063d4d0..2b913b7 100644
--- a/openjpa-integration/daytrader/pom.xml
+++ b/openjpa-integration/daytrader/pom.xml
@@ -42,7 +42,6 @@
         <dbcp.minIdle>2</dbcp.minIdle>
         <dbcp.maxWait>10000</dbcp.maxWait>
         <dbcp.args>MaxTotal=${dbcp.maxTotal},MaxIdle=${dbcp.maxIdle},MinIdle=${dbcp.minIdle},MaxWait=${dbcp.maxWait}</dbcp.args>
-        <automatic-module-name>org.apache.openjpa.integration.daytrader</automatic-module-name>
     </properties>
 
     <dependencies>
diff --git a/openjpa-integration/jmx/pom.xml b/openjpa-integration/jmx/pom.xml
index 9c04341..25d309a 100644
--- a/openjpa-integration/jmx/pom.xml
+++ b/openjpa-integration/jmx/pom.xml
@@ -43,7 +43,6 @@
     <test.jvm.jmxauth>com.sun.management.jmxremote.authenticate=false</test.jvm.jmxauth>
     <test.jvm.arguments>-Xmx${test.jvm.maxheapsize} -D${test.jvm.jmxprovider} -D${test.jvm.jmxauth}</test.jvm.arguments>
     <surefire.jvm.args>${test.jvm.arguments}</surefire.jvm.args>
-    <automatic-module-name>org.apache.openjpa.integration.jmx</automatic-module-name>
   </properties>
 
   <dependencies>
diff --git a/openjpa-integration/slf4j/pom.xml b/openjpa-integration/slf4j/pom.xml
index d056e8d..fa53569 100644
--- a/openjpa-integration/slf4j/pom.xml
+++ b/openjpa-integration/slf4j/pom.xml
@@ -38,7 +38,6 @@
     <properties>
         <!-- use SLF4JLogFactory for logging -->
         <openjpa.Log>slf4j</openjpa.Log>
-        <automatic-module-name>org.apache.openjpa.integration.slf4j</automatic-module-name>
     </properties>
 
     <dependencies>
diff --git a/openjpa-integration/validation/pom.xml b/openjpa-integration/validation/pom.xml
index 13f452c..30788d5 100644
--- a/openjpa-integration/validation/pom.xml
+++ b/openjpa-integration/validation/pom.xml
@@ -37,7 +37,6 @@
 
     <properties>
         <checkstyle.suppressions.location>${project.basedir}${file.separator}..${file.separator}..${file.separator}openjpa-project${file.separator}suppressions.xml</checkstyle.suppressions.location>
-        <automatic-module-name>org.apache.openjpa.integration.validation</automatic-module-name>
     </properties>
 
     <profiles>
diff --git a/openjpa-jdbc/pom.xml b/openjpa-jdbc/pom.xml
index 2d5a2a2..96b6e58 100644
--- a/openjpa-jdbc/pom.xml
+++ b/openjpa-jdbc/pom.xml
@@ -35,9 +35,6 @@
     <name>OpenJPA JDBC</name>
     <description>OpenJPA JDBC</description>
 
-    <properties>
-        <automatic-module-name>org.apache.openjpa.jdbc</automatic-module-name>
-    </properties>
     <dependencies>
         <dependency>
             <groupId>org.apache.openjpa</groupId>
diff --git a/openjpa-jest/pom.xml b/openjpa-jest/pom.xml
index 0fa9565..ba331fe 100644
--- a/openjpa-jest/pom.xml
+++ b/openjpa-jest/pom.xml
@@ -35,9 +35,6 @@
     <packaging>jar</packaging>
     <name>OpenJPA JEST</name>
 
-    <properties>
-        <automatic-module-name>org.apache.openjpa.jest</automatic-module-name>
-    </properties>
     <dependencies>
         <dependency>
             <groupId>org.apache.openjpa</groupId>
diff --git a/openjpa-junit5/pom.xml b/openjpa-junit5/pom.xml
index f3738da..86fa971 100644
--- a/openjpa-junit5/pom.xml
+++ b/openjpa-junit5/pom.xml
@@ -32,10 +32,6 @@
     <name>OpenJPA JUnit 5</name>
     <description>OpenJPA JUnit 5</description>
 
-    <properties>
-        <automatic-module-name>org.apache.openjpa.junit5</automatic-module-name>
-    </properties>
-
     <dependencies>
         <dependency>
             <groupId>org.apache.geronimo.specs</groupId>
diff --git a/openjpa-kernel/pom.xml b/openjpa-kernel/pom.xml
index 9931e99..892157d 100644
--- a/openjpa-kernel/pom.xml
+++ b/openjpa-kernel/pom.xml
@@ -35,9 +35,6 @@
     <name>OpenJPA Kernel</name>
     <description>OpenJPA Kernel</description>
 
-    <properties>
-        <automatic-module-name>org.apache.openjpa.kernel</automatic-module-name>
-    </properties>
     <dependencies>
         <dependency>
             <groupId>org.apache.openjpa</groupId>
diff --git a/openjpa-lib/pom.xml b/openjpa-lib/pom.xml
index 8ef4e03..1077aba 100644
--- a/openjpa-lib/pom.xml
+++ b/openjpa-lib/pom.xml
@@ -35,9 +35,6 @@
     <name>OpenJPA Utilities Library</name>
     <description>OpenJPA Utilities Library</description>
 
-    <properties>
-        <automatic-module-name>org.apache.openjpa.lib</automatic-module-name>
-    </properties>
     <dependencies>
         <dependency>
             <groupId>jakarta-regexp</groupId>
diff --git a/openjpa-persistence-jdbc/pom.xml b/openjpa-persistence-jdbc/pom.xml
index ca93698..1cb2539 100644
--- a/openjpa-persistence-jdbc/pom.xml
+++ b/openjpa-persistence-jdbc/pom.xml
@@ -35,9 +35,6 @@
     <name>OpenJPA Persistence JDBC</name>
     <description>OpenJPA Persistence JDBC</description>
 
-    <properties>
-        <automatic-module-name>org.apache.openjpa.persistence.jdbc</automatic-module-name>
-    </properties>
     <profiles>
         <!-- Profile for testing with test-dynamic-enhancer -->
         <profile>
diff --git a/openjpa-persistence-locking/pom.xml b/openjpa-persistence-locking/pom.xml
index 8449b97..e6487f7 100644
--- a/openjpa-persistence-locking/pom.xml
+++ b/openjpa-persistence-locking/pom.xml
@@ -41,7 +41,6 @@
         <derby.locks.deadlockTimeout>5</derby.locks.deadlockTimeout>
         <!-- set this =** on cmdline to skip all tests -->
         <surefire.excludes.locking />
-        <automatic-module-name>org.apache.openjpa.persistence.locking</automatic-module-name>
     </properties>
 
     <profiles>
diff --git a/openjpa-persistence/pom.xml b/openjpa-persistence/pom.xml
index 481d334..3a9ac40 100644
--- a/openjpa-persistence/pom.xml
+++ b/openjpa-persistence/pom.xml
@@ -35,9 +35,6 @@
     <name>OpenJPA Persistence</name>
     <description>OpenJPA Persistence</description>
 
-    <properties>
-        <automatic-module-name>org.apache.openjpa.persistence</automatic-module-name>
-    </properties>
     <dependencies>
         <dependency>
             <groupId>org.apache.openjpa</groupId>
diff --git a/openjpa-slice/pom.xml b/openjpa-slice/pom.xml
index 9e9720a..36de045 100644
--- a/openjpa-slice/pom.xml
+++ b/openjpa-slice/pom.xml
@@ -35,9 +35,6 @@
     <name>OpenJPA Slice</name>
     <description>OpenJPA Slice</description>
 
-    <properties>
-        <automatic-module-name>org.apache.openjpa.slice</automatic-module-name>
-    </properties>
     <dependencies>
         <dependency>
             <groupId>org.apache.openjpa</groupId>
diff --git a/openjpa-tools/openjpa-fetch-statistics-was/pom.xml b/openjpa-tools/openjpa-fetch-statistics-was/pom.xml
index a968473..6f16546 100644
--- a/openjpa-tools/openjpa-fetch-statistics-was/pom.xml
+++ b/openjpa-tools/openjpa-fetch-statistics-was/pom.xml
@@ -29,7 +29,6 @@
 
     <properties>
         <checkstyle.suppressions.location>${project.basedir}${file.separator}..${file.separator}..${file.separator}openjpa-project${file.separator}suppressions.xml</checkstyle.suppressions.location>
-        <automatic-module-name>org.apache.openjpa.tools.statistics.was</automatic-module-name>
     </properties>
 
     <dependencies>
diff --git a/openjpa-tools/openjpa-fetch-statistics/pom.xml b/openjpa-tools/openjpa-fetch-statistics/pom.xml
index 3f735ec..01c8589 100644
--- a/openjpa-tools/openjpa-fetch-statistics/pom.xml
+++ b/openjpa-tools/openjpa-fetch-statistics/pom.xml
@@ -29,7 +29,6 @@
 
     <properties>
         <checkstyle.suppressions.location>${project.basedir}${file.separator}..${file.separator}..${file.separator}openjpa-project${file.separator}suppressions.xml</checkstyle.suppressions.location>
-        <automatic-module-name>org.apache.openjpa.tools.statistics</automatic-module-name>
     </properties>
 
     <dependencies>
diff --git a/openjpa-xmlstore/pom.xml b/openjpa-xmlstore/pom.xml
index 3b229a8..a144e95 100644
--- a/openjpa-xmlstore/pom.xml
+++ b/openjpa-xmlstore/pom.xml
@@ -35,9 +35,6 @@
     <name>OpenJPA XML Store</name>
     <description>OpenJPA XML Store</description>
 
-    <properties>
-        <automatic-module-name>org.apache.openjpa.xmlstore</automatic-module-name>
-    </properties>
     <dependencies>
         <dependency>
             <groupId>org.apache.openjpa</groupId>
diff --git a/openjpa/pom.xml b/openjpa/pom.xml
index 3df7d46..56ede87 100644
--- a/openjpa/pom.xml
+++ b/openjpa/pom.xml
@@ -109,6 +109,12 @@
                             <createSourcesJar>${createSources}</createSourcesJar>
                             <transformers>
                                 <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
+                                <!-- Need to add some MANIFEST.MF metadata -->
+                                <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
+                                    <manifestEntries>
+                                        <Automatic-Module-Name>org.apache.openjpa</Automatic-Module-Name>
+                                    </manifestEntries>
+                                </transformer>
                             </transformers>
                             <artifactSet>
                                 <includes>
@@ -223,6 +229,7 @@
                         <Specification-Title>JSR-338 Java Persistence</Specification-Title>
                         <Specification-Vendor>ORACLE, Inc.</Specification-Vendor>
                         <Specification-Version>2.2</Specification-Version>
+                        <Automatic-Module-Name>org.apache.openjpa</Automatic-Module-Name>
                         <!-- OSGi Bundle Metadata -->
                         <Bundle-DocURL>${project.url}</Bundle-DocURL>
                         <Bundle-Activator>org.apache.openjpa.persistence.osgi.PersistenceActivator</Bundle-Activator>
diff --git a/pom.xml b/pom.xml
index 95f259b..c1d3628 100644
--- a/pom.xml
+++ b/pom.xml
@@ -103,7 +103,6 @@
         <ant.version>1.10.9</ant.version>
 
         <jmock.version>2.9.0</jmock.version>
-        <automatic-module-name>-SUBMODULES-NEED-TO-OVERRIDE-THIS-</automatic-module-name>
         <dbcp2.version>2.8.0</dbcp2.version>
 	<pool2.version>2.9.0</pool2.version>
     </properties>
@@ -2160,7 +2159,6 @@
                                     <manifestEntries>
                                         <Implementation-Build>${buildNumber}</Implementation-Build>
                                         <Implementation-Date>${timestamp}</Implementation-Date>
-                                        <Automatic-Module-Name>${automatic-module-name}</Automatic-Module-Name>
                                     </manifestEntries>
                                 </archive>
                             </configuration>