Author: lehmi
Date: Thu Dec  7 06:48:03 2023
New Revision: 1914418

URL: http://svn.apache.org/viewvc?rev=1914418&view=rev
Log:
PDFBOX-5695: use maven-shade-plugin to build app subprojects as proposed by 
Axel Howind

Modified:
    pdfbox/trunk/app/pom.xml
    pdfbox/trunk/benchmark/pom.xml
    pdfbox/trunk/debugger-app/pom.xml
    pdfbox/trunk/debugger/pom.xml
    pdfbox/trunk/pom.xml

Modified: pdfbox/trunk/app/pom.xml
URL: 
http://svn.apache.org/viewvc/pdfbox/trunk/app/pom.xml?rev=1914418&r1=1914417&r2=1914418&view=diff
==============================================================================
--- pdfbox/trunk/app/pom.xml (original)
+++ pdfbox/trunk/app/pom.xml Thu Dec  7 06:48:03 2023
@@ -28,7 +28,7 @@
   </parent>
 
   <artifactId>pdfbox-app</artifactId>
-  <packaging>bundle</packaging>
+  <packaging>jar</packaging>
   <name>Apache PDFBox application</name>
   <url>http://pdfbox.apache.org/</url>
 
@@ -37,50 +37,65 @@
       <groupId>${project.groupId}</groupId>
       <artifactId>pdfbox-tools</artifactId>
       <version>${project.version}</version>
-      <scope>provided</scope>
+      <scope>compile</scope>
     </dependency>
     <dependency>
       <groupId>org.bouncycastle</groupId>
       <artifactId>bcpkix-jdk18on</artifactId>
       <version>${bouncycastle.version}</version>
-      <scope>provided</scope>
+      <scope>compile</scope>
     </dependency>
     <dependency>
       <groupId>org.bouncycastle</groupId>
       <artifactId>bcprov-jdk18on</artifactId>
       <version>${bouncycastle.version}</version>
-      <scope>provided</scope>
+      <scope>compile</scope>
     </dependency>
      <dependency>
       <groupId>commons-io</groupId>
       <artifactId>commons-io</artifactId>
       <version>${commons-io.version}</version>
-      <scope>provided</scope>
+      <scope>compile</scope>
     </dependency>
     <dependency>
       <groupId>org.apache.pdfbox</groupId>
       <artifactId>jbig2-imageio</artifactId>
       <version>${jbig2.version}</version>
-      <scope>provided</scope>
+      <scope>compile</scope>
     </dependency> 
   </dependencies>
 
   <build>
     <plugins>
       <plugin>
-        <groupId>org.apache.felix</groupId>
-        <artifactId>maven-bundle-plugin</artifactId>
-        <extensions>true</extensions>
-        <configuration>
-          <instructions>
-            <Export-Package>org.apache.pdfbox.*</Export-Package>
-            <Embed-Transitive>true</Embed-Transitive>
-            
<Embed-Dependency>*;scope=provided;inline=org/apache/**|org/bouncycastle/**|picocli/**|META-INF/services/**</Embed-Dependency>
-            <Bundle-DocURL>${project.url}</Bundle-DocURL>
-            
<Import-Package>!org.junit.jupiter,javax.*;resolution:=optional</Import-Package>
-            <Main-Class>org.apache.pdfbox.tools.PDFBox</Main-Class>
-            </instructions>
-        </configuration>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-shade-plugin</artifactId>
+        <executions>
+          <execution>
+            <phase>package</phase>
+            <goals>
+              <goal>shade</goal>
+            </goals>
+            <configuration>
+              <transformers>
+                <transformer 
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
+                  <mainClass>org.apache.pdfbox.tools.PDFBox</mainClass>
+                </transformer>
+              </transformers>
+              <filters>
+                <filter>
+                  <!-- Exclude META-INF directories that might conflict -->
+                  <artifact>*:*</artifact>
+                  <excludes>
+                    <exclude>META-INF/*.SF</exclude>
+                    <exclude>META-INF/*.DSA</exclude>
+                    <exclude>META-INF/*.RSA</exclude>
+                  </excludes>
+                </filter>
+              </filters>
+            </configuration>
+          </execution>
+        </executions>
       </plugin>
     </plugins>
   </build>

Modified: pdfbox/trunk/benchmark/pom.xml
URL: 
http://svn.apache.org/viewvc/pdfbox/trunk/benchmark/pom.xml?rev=1914418&r1=1914417&r2=1914418&view=diff
==============================================================================
--- pdfbox/trunk/benchmark/pom.xml (original)
+++ pdfbox/trunk/benchmark/pom.xml Thu Dec  7 06:48:03 2023
@@ -73,7 +73,6 @@
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-shade-plugin</artifactId>
-                <version>3.5.1</version>
                 <executions>
                     <execution>
                         <phase>package</phase>

Modified: pdfbox/trunk/debugger-app/pom.xml
URL: 
http://svn.apache.org/viewvc/pdfbox/trunk/debugger-app/pom.xml?rev=1914418&r1=1914417&r2=1914418&view=diff
==============================================================================
--- pdfbox/trunk/debugger-app/pom.xml (original)
+++ pdfbox/trunk/debugger-app/pom.xml Thu Dec  7 06:48:03 2023
@@ -28,7 +28,7 @@
   </parent>
 
   <artifactId>debugger-app</artifactId>
-  <packaging>bundle</packaging>
+  <packaging>jar</packaging>
   <name>Apache PDFBox Debugger application</name>
   <url>http://pdfbox.apache.org/</url>
 
@@ -37,7 +37,7 @@
       <groupId>${project.groupId}</groupId>
       <artifactId>pdfbox-debugger</artifactId>
       <version>${project.version}</version>
-      <scope>provided</scope>
+      <scope>compile</scope>
     </dependency>
     <dependency>
       <groupId>org.apache.logging.log4j</groupId>
@@ -49,37 +49,63 @@
       <groupId>org.bouncycastle</groupId>
       <artifactId>bcpkix-jdk18on</artifactId>
       <version>${bouncycastle.version}</version>
-      <scope>provided</scope>
+      <scope>compile</scope>
     </dependency>
     <dependency>
       <groupId>org.bouncycastle</groupId>
       <artifactId>bcprov-jdk18on</artifactId>
       <version>${bouncycastle.version}</version>
-      <scope>provided</scope>
+      <scope>compile</scope>
     </dependency>
     <dependency>
       <groupId>org.apache.pdfbox</groupId>
       <artifactId>jbig2-imageio</artifactId>
       <version>${jbig2.version}</version>
-      <scope>provided</scope>
+      <scope>compile</scope>
     </dependency> 
   </dependencies>
 
   <build>
     <plugins>
       <plugin>
-        <groupId>org.apache.felix</groupId>
-        <artifactId>maven-bundle-plugin</artifactId>
-        <extensions>true</extensions>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-shade-plugin</artifactId>
+        <dependencies>
+          <dependency>
+            <groupId>org.apache.logging.log4j</groupId>
+            
<artifactId>log4j-transform-maven-shade-plugin-extensions</artifactId>
+            <version>0.1.0</version>
+          </dependency>
+        </dependencies>
+        <executions>
+          <execution>
+            <phase>package</phase>
+            <goals>
+              <goal>shade</goal>
+            </goals>
+          </execution>
+        </executions>
         <configuration>
-          <instructions>
-            <Export-Package>org.apache.pdfbox.*</Export-Package>
-            <Embed-Transitive>true</Embed-Transitive>
-            
<Embed-Dependency>*;scope=provided;inline=org/apache/**|org/bouncycastle/**|picocli/**|META-INF/services/**</Embed-Dependency>
-            <Bundle-DocURL>${project.url}</Bundle-DocURL>
-            
<Import-Package>!org.junit.jupiter,javax.*;resolution:=optional;</Import-Package>
-            <Main-Class>org.apache.pdfbox.debugger.PDFDebugger</Main-Class>
-          </instructions>
+          <transformers>
+            <transformer 
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
+              <mainClass>org.apache.pdfbox.debugger.PDFDebugger</mainClass>
+              <manifestEntries>
+                <Multi-Release>true</Multi-Release>
+              </manifestEntries>
+            </transformer>
+            <transformer 
implementation="org.apache.logging.log4j.maven.plugins.shade.transformer.Log4j2PluginCacheFileTransformer"/>
+          </transformers>
+          <filters>
+            <filter>
+              <!-- Exclude META-INF directories that might conflict -->
+              <artifact>*:*</artifact>
+              <excludes>
+                <exclude>META-INF/*.SF</exclude>
+                <exclude>META-INF/*.DSA</exclude>
+                <exclude>META-INF/*.RSA</exclude>
+              </excludes>
+            </filter>
+          </filters>
         </configuration>
       </plugin>
     </plugins>

Modified: pdfbox/trunk/debugger/pom.xml
URL: 
http://svn.apache.org/viewvc/pdfbox/trunk/debugger/pom.xml?rev=1914418&r1=1914417&r2=1914418&view=diff
==============================================================================
--- pdfbox/trunk/debugger/pom.xml (original)
+++ pdfbox/trunk/debugger/pom.xml Thu Dec  7 06:48:03 2023
@@ -57,7 +57,7 @@
       <groupId>org.apache.logging.log4j</groupId>
       <artifactId>log4j-core</artifactId>
       <version>${log4j2.version}</version>
-      <scope>provided</scope>
+      <scope>compile</scope>
     </dependency>
     <dependency>
         <groupId>org.apache.pdfbox</groupId>

Modified: pdfbox/trunk/pom.xml
URL: 
http://svn.apache.org/viewvc/pdfbox/trunk/pom.xml?rev=1914418&r1=1914417&r2=1914418&view=diff
==============================================================================
--- pdfbox/trunk/pom.xml (original)
+++ pdfbox/trunk/pom.xml Thu Dec  7 06:48:03 2023
@@ -234,6 +234,11 @@
                     <artifactId>maven-bundle-plugin</artifactId>
                     <version>5.1.9</version>
                 </plugin>
+                <plugin>
+                    <groupId>org.apache.maven.plugins</groupId>
+                    <artifactId>maven-shade-plugin</artifactId>
+                    <version>3.5.1</version>
+                </plugin>
             </plugins>
         </pluginManagement>
   </build>


Reply via email to