You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by re...@apache.org on 2022/07/28 10:40:50 UTC

[uima-uimaj] 01/01: Issue #225: Improve deployment in OSGi environments

This is an automated email from the ASF dual-hosted git repository.

rec pushed a commit to branch feature/225-Improve-deployment-in-OSGi-environments
in repository https://gitbox.apache.org/repos/asf/uima-uimaj.git

commit 68a8e2831dcd7d9ede94abb186a9f4c570d9b5a4
Author: Richard Eckart de Castilho <ri...@averbis.com>
AuthorDate: Thu Jul 28 12:40:36 2022 +0200

    Issue #225: Improve deployment in OSGi environments
    
    - Update to UIMA Parent POM 16-SNAPSHOT
    - Add OSGi metadata to several modules using the maven-bundle-plugin
---
 jVinci/marker-file-identifying-osgi-bundle         |   0
 jVinci/pom.xml                                     |  64 +++++---
 .../marker-file-identifying-osgi-bundle            |   0
 uimaj-adapter-vinci/pom.xml                        |  30 +++-
 uimaj-core/marker-file-identifying-osgi-bundle     |   0
 uimaj-core/pom.xml                                 |  78 ++++------
 uimaj-cpe/marker-file-identifying-osgi-bundle      |   0
 uimaj-cpe/pom.xml                                  |  26 ++++
 uimaj-parent/pom.xml                               |  10 +-
 uimaj-tools/marker-file-identifying-osgi-bundle    |   0
 uimaj-tools/pom.xml                                | 171 ++++++++++++---------
 11 files changed, 239 insertions(+), 140 deletions(-)

diff --git a/jVinci/marker-file-identifying-osgi-bundle b/jVinci/marker-file-identifying-osgi-bundle
new file mode 100644
index 000000000..e69de29bb
diff --git a/jVinci/pom.xml b/jVinci/pom.xml
index dc773f297..e96e8f05f 100644
--- a/jVinci/pom.xml
+++ b/jVinci/pom.xml
@@ -17,29 +17,51 @@
    specific language governing permissions and limitations
    under the License.    
 -->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-  <modelVersion>4.0.0</modelVersion>
-
-  <parent>
-    <groupId>org.apache.uima</groupId>
-    <artifactId>uimaj-parent</artifactId>
-    <version>3.4.0-SNAPSHOT</version>
-    <relativePath>../uimaj-parent/pom.xml</relativePath>
-  </parent>
-
-  <artifactId>jVinci</artifactId>
-  <packaging>jar</packaging>
-  <name>Apache UIMA Base: ${project.artifactId}: Vinci Transport Library</name>
-  <description>This is a protocol used by the base UIMA Collection processing manager for supporting
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+
+	<parent>
+		<groupId>org.apache.uima</groupId>
+		<artifactId>uimaj-parent</artifactId>
+		<version>3.4.0-SNAPSHOT</version>
+		<relativePath>../uimaj-parent/pom.xml</relativePath>
+	</parent>
+
+	<artifactId>jVinci</artifactId>
+	<packaging>bundle</packaging>
+
+	<name>Apache UIMA Base: ${project.artifactId}: Vinci Transport Library</name>
+	<description>This is a protocol used by the base UIMA Collection processing manager for supporting
     networked deployment.  See UIMA-AS as a more modern alternative supporting
     more standard protocols.</description>
-  <url>${uimaWebsiteUrl}</url>
+	<url>${uimaWebsiteUrl}</url>
+
+	<properties>
+		<postNoticeText>${ibmNoticeText}</postNoticeText>
+	</properties>
 
-  <properties>
-    <postNoticeText>${ibmNoticeText}</postNoticeText>
-  </properties>
+	<build>
+		<finalName>jVinci</finalName>
 
-  <build>
-    <finalName>jVinci</finalName>
-  </build>
+		<plugins>
+			<plugin>
+				<groupId>org.apache.felix</groupId>
+				<artifactId>maven-bundle-plugin</artifactId>
+				<configuration>
+					<instructions>
+						<Bundle-RequiredExecutionEnvironment>JavaSE-1.8</Bundle-RequiredExecutionEnvironment>
+						<_dsannotations>*</_dsannotations>
+						<_metatypeannotations>*</_metatypeannotations>
+						<Export-Package>
+							org.apache.vinci.debug,
+							org.apache.vinci.transport,
+							org.apache.vinci.transport.*
+						</Export-Package>
+					</instructions>
+				</configuration>
+			</plugin>
+		</plugins>
+	</build>
 </project>
\ No newline at end of file
diff --git a/uimaj-adapter-vinci/marker-file-identifying-osgi-bundle b/uimaj-adapter-vinci/marker-file-identifying-osgi-bundle
new file mode 100644
index 000000000..e69de29bb
diff --git a/uimaj-adapter-vinci/pom.xml b/uimaj-adapter-vinci/pom.xml
index e395edaa9..acb5883f0 100644
--- a/uimaj-adapter-vinci/pom.xml
+++ b/uimaj-adapter-vinci/pom.xml
@@ -28,7 +28,8 @@
   </parent>
 
   <artifactId>uimaj-adapter-vinci</artifactId>
-  <packaging>jar</packaging>
+  <packaging>bundle</packaging>
+  
   <name>Apache UIMA Base: ${project.artifactId}: Vinci Adapter</name>
   <description>Provides the capability to connect to a remote analysis
     engine, using the Vinci protocol</description>
@@ -71,5 +72,32 @@
   
   <build>
     <finalName>uima-adapter-vinci</finalName>
+    
+		<plugins>
+			<plugin>
+				<groupId>org.apache.felix</groupId>
+				<artifactId>maven-bundle-plugin</artifactId>
+				<configuration>
+					<instructions>
+						<Bundle-RequiredExecutionEnvironment>JavaSE-1.8</Bundle-RequiredExecutionEnvironment>
+						<_dsannotations>*</_dsannotations>
+						<_metatypeannotations>*</_metatypeannotations>
+						<Import-Package>
+							!org.apache.uima.adapter.vinci,
+							!org.apache.uima.adapter.vinci.*,
+							!com.apple.eio,
+							org.slf4j.impl;resolution:=optional,
+							org.apache.logging.log4j.*;resolution:=optional,
+							org.apache.logging.slf4j.*;resolution:=optional,
+							*
+						</Import-Package>
+						<Export-Package>
+							org.apache.uima.adapter.vinci,
+							org.apache.uima.adapter.vinci.*
+						</Export-Package>
+					</instructions>
+				</configuration>
+			</plugin>
+		</plugins>
   </build>
 </project>
\ No newline at end of file
diff --git a/uimaj-core/marker-file-identifying-osgi-bundle b/uimaj-core/marker-file-identifying-osgi-bundle
new file mode 100644
index 000000000..e69de29bb
diff --git a/uimaj-core/pom.xml b/uimaj-core/pom.xml
index 6d2652205..fdc9382bf 100644
--- a/uimaj-core/pom.xml
+++ b/uimaj-core/pom.xml
@@ -28,7 +28,8 @@
   </parent>
 
   <artifactId>uimaj-core</artifactId>
-  <packaging>jar</packaging>
+  <packaging>bundle</packaging>
+  
   <name>Apache UIMA Base: ${project.artifactId}</name>
   <description>The core implementation of the UIMA Java Framework</description>
   <url>${uimaWebsiteUrl}</url>
@@ -151,7 +152,6 @@
           5 work when run separately or by mvn, but fail when running all tests from Eclipse:
               Caused by: org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the declaration of element '....'
       -->
-
    <!--
     <dependency>
       <groupId>net.sf.saxon</groupId>
@@ -163,55 +163,18 @@
  
     <dependency>
       <groupId>net.sf.saxon</groupId>
-        <artifactId>saxon</artifactId>
-        <version>8.7</version>
-        <scope>test</scope>
+      <artifactId>saxon</artifactId>
+      <version>8.7</version>
+      <scope>test</scope>
     </dependency>
     <dependency>
       <groupId>net.sf.saxon</groupId>
-        <artifactId>saxon-dom</artifactId>
-        <version>8.7</version>
-        <scope>test</scope>
+      <artifactId>saxon-dom</artifactId>
+      <version>8.7</version>
+      <scope>test</scope>
     </dependency>
   -->
     
-    <!-- For decompiling recompiling jcas experiments -->
-    <!--
-    <dependency>
-      <groupId>org.eclipse.jdt.core.compiler</groupId>
-      <artifactId>ecj</artifactId>
-      <version>4.4.2</version>
-    </dependency>
-    -->
-    
-    <!-- needed for UimaDecompiler class-->
-    <dependency>  <!-- Apache v2 license  2016 checked -->
-      <groupId>org.bitbucket.mstrobel</groupId>
-      <artifactId>procyon-compilertools</artifactId>
-      <version>0.5.32</version>
-    </dependency>
-    
-    <!-- Apache v2 license  2016 checked. Also transitive include from above, 
-         listed here so that binary assembly for distribution includes the jar -->
-    <dependency>
-      <groupId>org.bitbucket.mstrobel</groupId>
-      <artifactId>procyon-core</artifactId>
-      <version>0.5.32</version>
-    </dependency>
-    
-    <!-- for reading / transforming / generating JCas cover classes -->
-<!--     <dependency>
-      <groupId>org.ow2.asm</groupId>
-      <artifactId>asm</artifactId>
-      <version>5.0.4</version>
-    </dependency>
-
-    <dependency>
-      <groupId>org.ow2.asm</groupId>
-      <artifactId>asm-tree</artifactId>
-      <version>5.0.4</version>
-    </dependency>
- -->
   </dependencies>
 
   <build>
@@ -290,6 +253,31 @@
     </pluginManagement>
 
     <plugins>
+      <plugin>
+        <groupId>org.apache.felix</groupId>
+        <artifactId>maven-bundle-plugin</artifactId>
+        <configuration>
+          <instructions>
+            <Bundle-RequiredExecutionEnvironment>JavaSE-1.8</Bundle-RequiredExecutionEnvironment>
+            <_dsannotations>*</_dsannotations>
+            <_metatypeannotations>*</_metatypeannotations>
+            <Import-Package>
+              !org.apache.uima,
+              !org.apache.uima.*,
+              !com.apple.eio,
+              org.slf4j.impl;resolution:=optional,
+              org.apache.logging.log4j.*;resolution:=optional,
+              org.apache.logging.slf4j.*;resolution:=optional,
+              *
+            </Import-Package>
+            <Export-Package>
+              org.apache.uima,
+              org.apache.uima.*
+            </Export-Package>
+          </instructions>
+        </configuration>
+      </plugin>
+    
       <!-- experiment with CLIRR
         gets fatal error: 
         
diff --git a/uimaj-cpe/marker-file-identifying-osgi-bundle b/uimaj-cpe/marker-file-identifying-osgi-bundle
new file mode 100644
index 000000000..e69de29bb
diff --git a/uimaj-cpe/pom.xml b/uimaj-cpe/pom.xml
index 99b388728..a23b7e208 100644
--- a/uimaj-cpe/pom.xml
+++ b/uimaj-cpe/pom.xml
@@ -28,6 +28,8 @@
   </parent>
 
   <artifactId>uimaj-cpe</artifactId>
+	<packaging>bundle</packaging>
+  
   <name>Apache UIMA Base: ${project.artifactId}: Collection Processing Engine</name>
   <description>The implementation of a simple scaleout capability, called
     the Collection Processing Engine.  New implementations may find 
@@ -92,5 +94,29 @@
         </plugin>
       </plugins>
     </pluginManagement>
+		<plugins>
+			<plugin>
+				<groupId>org.apache.felix</groupId>
+				<artifactId>maven-bundle-plugin</artifactId>
+				<configuration>
+					<instructions>
+						<Bundle-RequiredExecutionEnvironment>JavaSE-1.8</Bundle-RequiredExecutionEnvironment>
+						<_dsannotations>*</_dsannotations>
+						<_metatypeannotations>*</_metatypeannotations>
+						<Import-Package>
+							!org.apache.uima.collection.impl.metadata.cpe,
+							!com.apple.eio,
+							org.slf4j.impl;resolution:=optional,
+							org.apache.logging.log4j.*;resolution:=optional,
+							org.apache.logging.slf4j.*;resolution:=optional,
+							*
+						</Import-Package>
+						<Export-Package>
+							org.apache.uima.collection.impl.metadata.cpe
+						</Export-Package>
+					</instructions>
+				</configuration>
+			</plugin>
+		</plugins>
   </build>
 </project>
\ No newline at end of file
diff --git a/uimaj-parent/pom.xml b/uimaj-parent/pom.xml
index f1363343b..d969d685a 100644
--- a/uimaj-parent/pom.xml
+++ b/uimaj-parent/pom.xml
@@ -34,7 +34,7 @@
     <groupId>org.apache.uima</groupId>
     <artifactId>parent-pom</artifactId>
     <relativePath />
-    <version>15</version>
+    <version>16-SNAPSHOT</version>
   </parent>
 
   <artifactId>uimaj-parent</artifactId>
@@ -270,10 +270,16 @@
         <!-- See: https://issues.apache.org/jira/browse/UIMA-6349 -->
         <groupId>com.github.siom79.japicmp</groupId>
         <artifactId>japicmp-maven-plugin</artifactId>
-        <version>0.15.3</version>
+        <version>0.15.7</version>
         <configuration>
+          <newVersion>
+            <file>
+              <path>${project.build.directory}/${project.build.finalName}.jar</path>
+            </file>
+          </newVersion>
           <parameter>
             <ignoreMissingClassesByRegularExpressions>
+              <ignoreMissingClassesByRegularExpression>com\.strobel\..*</ignoreMissingClassesByRegularExpression>
               <ignoreMissingClassesByRegularExpression>org\.apache\.logging\.log4j\..*</ignoreMissingClassesByRegularExpression>
             </ignoreMissingClassesByRegularExpressions>
           </parameter>
diff --git a/uimaj-tools/marker-file-identifying-osgi-bundle b/uimaj-tools/marker-file-identifying-osgi-bundle
new file mode 100644
index 000000000..e69de29bb
diff --git a/uimaj-tools/pom.xml b/uimaj-tools/pom.xml
index 3d0de13c2..19e4a7bbe 100644
--- a/uimaj-tools/pom.xml
+++ b/uimaj-tools/pom.xml
@@ -17,80 +17,109 @@
    specific language governing permissions and limitations
    under the License.    
 -->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-  <modelVersion>4.0.0</modelVersion>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+	<modelVersion>4.0.0</modelVersion>
 
-  <parent>
-    <groupId>org.apache.uima</groupId>
-    <artifactId>uimaj-parent</artifactId>
-    <version>3.4.0-SNAPSHOT</version>
-    <relativePath>../uimaj-parent/pom.xml</relativePath>
-  </parent>
+	<parent>
+		<groupId>org.apache.uima</groupId>
+		<artifactId>uimaj-parent</artifactId>
+		<version>3.4.0-SNAPSHOT</version>
+		<relativePath>../uimaj-parent/pom.xml</relativePath>
+	</parent>
 
-  <artifactId>uimaj-tools</artifactId>
-  <packaging>jar</packaging>
-  <name>Apache UIMA Base: ${project.artifactId}: Tools</name>
-  <description>Tooling supporting UIMA use</description>
-  <url>${uimaWebsiteUrl}</url>
+	<artifactId>uimaj-tools</artifactId>
+	<packaging>bundle</packaging>
 
-  <properties>
-    <postNoticeText>${ibmNoticeText}</postNoticeText>
-  </properties>
+	<name>Apache UIMA Base: ${project.artifactId}: Tools</name>
+	<description>Tooling supporting UIMA use</description>
+	<url>${uimaWebsiteUrl}</url>
 
-  <dependencies>
-    <dependency>
-      <groupId>org.apache.uima</groupId>
-      <artifactId>uimaj-core</artifactId>
-      <version>${project.parent.version}</version>
-      <scope>compile</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.uima</groupId>
-      <artifactId>uimaj-cpe</artifactId>
-      <version>${project.parent.version}</version>
-      <scope>compile</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.uima</groupId>
-      <artifactId>uimaj-test-util</artifactId>
-      <version>${project.parent.version}</version>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.slf4j</groupId>
-      <artifactId>slf4j-jdk14</artifactId>
-      <scope>test</scope>
-    </dependency>
+	<properties>
+		<postNoticeText>${ibmNoticeText}</postNoticeText>
+	</properties>
 
-  </dependencies>
-  <build>
-    <finalName>uima-tools</finalName>
-    <resources>
-      <resource>
-        <directory>src/main/resources</directory>
-        <filtering>true</filtering>
-      </resource>
-    </resources>
-    <pluginManagement>
-      <plugins>
-        <plugin>
-          <groupId>org.apache.rat</groupId>
-          <artifactId>apache-rat-plugin</artifactId>
-          <executions>
-            <execution>
-              <id>default-cli</id>
-              <configuration>
-                <excludes combine.children="append">
-                  <exclude>release.properties</exclude> <!-- release generated artifact -->
-                  <exclude>src/main/resources/org/apache/uima/tools/migration/*</exclude> <!-- data for migration code -->
-                  <exclude>src/main/resources/org/apache/uima/tools/util/gui/about.txt</exclude>
-                  <exclude>src/test/resources/pearTests/pearMergerTests/*.pear</exclude> <!-- test data -->
-                </excludes>
-              </configuration>
-            </execution>
-          </executions>
-        </plugin>
-      </plugins>
-    </pluginManagement>
-  </build>
+	<dependencies>
+		<dependency>
+			<groupId>org.apache.uima</groupId>
+			<artifactId>uimaj-core</artifactId>
+			<version>${project.parent.version}</version>
+			<scope>compile</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.uima</groupId>
+			<artifactId>uimaj-cpe</artifactId>
+			<version>${project.parent.version}</version>
+			<scope>compile</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.uima</groupId>
+			<artifactId>uimaj-test-util</artifactId>
+			<version>${project.parent.version}</version>
+			<scope>test</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.slf4j</groupId>
+			<artifactId>slf4j-jdk14</artifactId>
+			<scope>test</scope>
+		</dependency>
+
+	</dependencies>
+	<build>
+		<finalName>uima-tools</finalName>
+		<resources>
+			<resource>
+				<directory>src/main/resources</directory>
+				<filtering>true</filtering>
+			</resource>
+		</resources>
+		<pluginManagement>
+			<plugins>
+				<plugin>
+					<groupId>org.apache.rat</groupId>
+					<artifactId>apache-rat-plugin</artifactId>
+					<executions>
+						<execution>
+							<id>default-cli</id>
+							<configuration>
+								<excludes combine.children="append">
+									<exclude>release.properties</exclude> <!-- release generated artifact -->
+									<exclude>src/main/resources/org/apache/uima/tools/migration/*</exclude> <!-- data for migration code -->
+									<exclude>src/main/resources/org/apache/uima/tools/util/gui/about.txt</exclude>
+									<exclude>src/test/resources/pearTests/pearMergerTests/*.pear</exclude> <!-- test data -->
+								</excludes>
+							</configuration>
+						</execution>
+					</executions>
+				</plugin>
+			</plugins>
+		</pluginManagement>
+		<plugins>
+			<plugin>
+				<groupId>org.apache.felix</groupId>
+				<artifactId>maven-bundle-plugin</artifactId>
+				<configuration>
+					<instructions>
+						<Bundle-RequiredExecutionEnvironment>JavaSE-1.8</Bundle-RequiredExecutionEnvironment>
+						<_dsannotations>*</_dsannotations>
+						<_metatypeannotations>*</_metatypeannotations>
+						<Import-Package>
+							!org.apache.uima.tools,
+							!org.apache.uima.tools.*,
+							!com.apple.eio,
+							org.slf4j.impl;resolution:=optional,
+							org.apache.logging.log4j.*;resolution:=optional,
+							org.apache.logging.slf4j.*;resolution:=optional,
+							*
+						</Import-Package>
+						<Export-Package>
+							org.apache.uima.tools,
+							org.apache.uima.tools.*
+						</Export-Package>
+					</instructions>
+				</configuration>
+			</plugin>
+		</plugins>
+	</build>
 </project>
\ No newline at end of file