- Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>nl.rechtspraak.services</groupId>
<artifactId>DocxUtils</artifactId>
<version>1.0.1628.1</version>
<packaging>jar</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.6</maven.compiler.source>
<maven.compiler.target>1.6</maven.compiler.target>
<mainClass>nl.rechtspraak.services.docxutils.DocxUtils</mainClass>
</properties>
<name>DocxUtils</name>
<dependencies>
<dependency>
<groupId>org.docx4j</groupId>
<artifactId>docx4j</artifactId>
<version>3.3.0</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>3.13</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-core</artifactId>
<version>1.3</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<!-- <plugin><groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.0.1</version>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<classpathPrefix>lib</classpathPrefix>
</manifest>
<manifestEntries>
<Class-Path>lib/</Class-Path>
</manifestEntries>
</archive>
</configuration>
</plugin>-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.4.3</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<!-- <filters>
<filter>
<artifact>docx4j:docx4j</artifact>
<includes>
<include>**</include>
</includes>
</filter>
</filters>-->
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>${mainClass}</mainClass>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
<resources>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>log4j.properties</include>
</includes>
<targetPath>nl/rechtspraak/services/docxutils</targetPath>
</resource>
</resources>
</build>
</project>
The project builds find and the unit tests are successful. When using the compiled jar as a Spring Bean in an Oracle BPEL composite i get the following Exception;
- Code: Select all
[2016-07-13T15:19:55.330+02:00] [esb_soa_server1] [ERROR] [OWS-04086] [oracle.webservices.service] [tid: [ACTIVE].ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'] [userId: <anonymous>] [ecid: 370c1c2d426a9f58:14d40f5b:155e27aa52a:-8000-000000000000126f,0:2] [APP: soa-infra] [composite_instance_id: 4710159] [composite_name: docxdemo] [component_name: docxprotect_client_ep] javax.xml.rpc.soap.SOAPFaultException: oracle.fabric.common.FabricInvocationException: weblogic.sca.api.ScaException: java.lang.NoClassDefFoundError: org/docx4j/XmlUtils[[
at oracle.integration.platform.blocks.soap.WebServiceEntryBindingComponent.generateSoapFaultException(WebServiceEntryBindingComponent.java:1280)
at oracle.integration.platform.blocks.soap.WebServiceEntryBindingComponent.processIncomingMessage(WebServiceEntryBindingComponent.java:1053)
at oracle.integration.platform.blocks.soap.FabricProvider.processMessage(FabricProvider.java:113)
at oracle.j2ee.ws.server.provider.ProviderProcessor.doEndpointProcessing(ProviderProcessor.java:1187)
at oracle.j2ee.ws.server.WebServiceProcessor.invokeEndpointImplementation(WebServiceProcessor.java:1123)
at oracle.j2ee.ws.server.provider.ProviderProcessor.doRequestProcessing(ProviderProcessor.java:581)
at oracle.j2ee.ws.server.WebServiceProcessor.processRequest(WebServiceProcessor.java:235)
at oracle.j2ee.ws.server.WebServiceProcessor.doService(WebServiceProcessor.java:196)
at oracle.j2ee.ws.server.WebServiceServlet.doPost(WebServiceServlet.java:487)
Inspecting the jar, the class is indeed not available in the build jar. The downloaded version of docx4j-3.3.0.jar from docx4j.org does contain this class in org.docx4j.
How to modify to also get these classes in the target jar?