This is the first time I am setting up a java project and I have almost understood the problem. I am facing bouncycastle
not found issue while building the project with maven build
. I need to extract a .war file out of it.
While running maven build - clean install I got :
[ERROR] /home/.../CrlServlet.java:[36,34] package org.bouncycastle.asn1.x509 does not exist
[ERROR] /home/.../CrlServlet.java:[37,29] package org.bouncycastle.cert does not exist
[ERROR] /home/.../CrlServlet.java:[38,29] package org.bouncycastle.cert does not exist
[ERROR] /home/.../CrlServlet.java:[39,29] package org.bouncycastle.cert does not exist
[ERROR] /home/.../CrlServlet.java:[40,36] package org.bouncycastle.cert.jcajce does not exist
[ERROR] /home/.../CrlServlet.java:[41,39] package org.bouncycastle.openssl.jcajce does not exist
[ERROR] /home/.../CrlServlet.java:[42,33] package org.bouncycastle.operator does not exist
[ERROR] /home/.../CrlServlet.java:[43,40] package org.bouncycastle.operator.jcajce does not exist
[ERROR] /home/.../LocalCertificateAdapter.java:[12,29] package org.bouncycastle.cert does not exist
[ERROR] /home/.../LocalCertificateAdapter.java:[13,36] package org.bouncycastle.cert.jcajce does not exist
[ERROR] /home/.../LocalCertificateAdapter.java:[14,32] package org.bouncycastle.openssl does not exist
[ERROR] /home/.../LocalCertificateAdapter.java:[15,39] package org.bouncycastle.openssl.jcajce does not exist
I checked my project documentation, there it's written - bcprov-jdkXXon-XXX.jar into the lib/ext
.
I looked into the openjdk path in my ubuntu machine and there is no ext folder inside /usr/lib/jvm/java-11-openjdk-amd64/lib
. I got one security folder tho.
Since I have openjdk java 11 version installed, I have a doubt as the project doc is old as per this.
openjdk version "11.0.15" 2022-04-19
OpenJDK Runtime Environment (build 11.0.15+10-Ubuntu-0ubuntu0.20.04.1)
OpenJDK 64-Bit Server VM (build 11.0.15+10-Ubuntu-0ubuntu0.20.04.1, mixed mode, sharing)
Also, when I am dockering the app ,I found extracted war is not working may be of this compilation failure. While checking the docker file it was bcprov-jdk15on-155.jar
used.
So my question is :
- How to resolve this compilation failure ?
- Where I can download the exact version of bouncycastle jar file ?
- How and where I can put the jar library to make it work ? Do I need to downgrade the openjdk package to 7-8 ?
EDIT:- added pom file
<modelVersion>4.0.0</modelVersion>
<groupId>serv.back</groupId>
<artifactId>xxxx</artifactId>
<version>0.1.6</version>
<packaging>war</packaging>
<name>xxxx</name>
<dependencies>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.5</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.0</version>
</dependency>
<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>eclipselink</artifactId>
<version>2.5.2</version>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>9.4.1212.jre7</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.22</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>4.0.0-b01</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-dbcp</artifactId>
<version>9.0.0.M15</version>
</dependency>
<dependency>
<groupId>commons-digester</groupId>
<artifactId>commons-digester</artifactId>
<version>2.1</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpmime</artifactId>
<version>4.5.3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.5</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<sourceDirectory>src</sourceDirectory>
<resources>
<resource>
<directory>src</directory>
<excludes>
<exclude>**/*.java</exclude>
</excludes>
</resource>
</resources>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.5.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
<debug>true</debug>
</configuration>
</plugin>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>3.3.1</version>
<configuration>
<warSourceDirectory>WebContent</warSourceDirectory>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>tomcat-maven-plugin</artifactId>
<configuration>
<url>http://localhost:8080/manager/text</url>
<path>/xxxx</path>
<username>tomcat</username>
<password>xxxx</password>
</configuration>
</plugin>
</plugins>
</build>