readthefuckingmanual.net

[SOLVED] Including org.bouncycastle:bcprov-jdk16:jar:1.46 in the shaded jar.

Error added: 2013-12-07T14:26:10Z

0 people waiting for the answer...

1 answers found.

Answer 2201 (0.0% helpful)

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-shade-plugin</artifactId>
				<version>2.1</version>
				<executions>
					<execution>
						<phase>package</phase>
						<goals>
							<goal>shade</goal>
						</goals>
						<configuration>
							<transformers>
								<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
									<manifestEntries>
										<Main-Class>your.package.Main</Main-Class>
										<Class-Path>lib-signed/bcprov-jdk16.jar</Class-Path>
									</manifestEntries>
								</transformer>
							</transformers>
							<filters>
								<filter>
									<artifact>*:*</artifact>
									<excludes>
										<exclude>META-INF/*.SF</exclude>
										<exclude>META-INF/*.DSA</exclude>
										<exclude>META-INF/*.RSA</exclude>
									</excludes>
								</filter>
							</filters>
							<artifactSet>
								<!-- We have to do this, because we can't include BouncyCastle with maven shade -->
								<excludes>
									<exclude>org.bouncycastle:*</exclude>
								</excludes>
							</artifactSet>
						</configuration>
					</execution>
				</executions>
			</plugin>

			<plugin>
				<!-- We have to do this, because we can't include BouncyCastle with maven shade -->
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-dependency-plugin</artifactId>
				<version>2.8</version>
				<executions>
					<execution>
						<id>copy</id>
						<phase>package</phase>
						<goals>
							<goal>copy-dependencies</goal>
						</goals>
						<configuration>
							<outputDirectory>${project.build.directory}/lib-signed</outputDirectory>
							<includeArtifactIds>bcprov-jdk16</includeArtifactIds>
							<stripVersion>true</stripVersion>
						</configuration>
					</execution>
				</executions>
			</plugin>
Permalink

Add an answer/solution

If you know the answer, please add your own solution below.
If you don't know, but find out later, please come back and share your answer - there will be other people struggling with this too.


Please enter 61948 here

If you want to be notified via email when this is solved, enter your email address here: