I am creating a fat jar using maven shade plugin, which includes some bouncy castle jars too. But this creates the problem because of the unsigned version of Bouncy Castle.
java.lang.SecurityException: JCE cannot authenticate the provider BC
Now one of the solution is to have external folder of dependencies and define this class path in manifest file of fat jar.
For example:
<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>
<artifactSet>
<excludes>
<exclude>org.bouncycastle:*:*:*</exclude>
</excludes>
</artifactSet>
<finalName>Relay-S3-Monitor-jar-with-dependencies</finalName>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
</excludes>
</filter>
</filters>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>at.seresunit.lecturemanager_connector.App</mainClass>
</transformer>
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
<resource>META-INF/spring.handlers</resource>
</transformer>
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
<resource>META-INF/spring.schemas</resource>
</transformer>
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<manifestEntries>
<Main-Class>com.pb.relay.s3.CamelBoot</Main-Class>
<Class-Path>. bouncycastle_libs/bcpg-jdk15on-1.55.jar bouncycastle_libs/bcprov-jdk15on-1.55.jar bouncycastle_libs/bcprov-jdk16-1.45.jar</Class-Path>
</manifestEntries>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
</plugin
Now what I need: in the same pom.xml, I need to insert a section (plugin) which creates depencies folder(with only bouncy castle jar)