0

I am doing a maven build, but it gets an error related to one of the dependencies. If I (and other developers) build this on our local machines or on other linux servers, it builds with no problems. However, on one particular linux server, it gets the following error when building.

mvn clean install DskipTests=true -U

maven Build Error:

[ERROR] Failed to execute goal on project corporateInterface: Could not resolve dependencies for project com.travellinck:corporateInterface:war:3.10: Failed to collect dependencies at com.github.Cloudmersive:Cloudmersive.APIClient.Java:jar:v3.62: Failed to read artifact descriptor for com.github.Cloudmersive:Cloudmersive.APIClient.Java:jar:v3.62: Could not transfer artifact com.github.Cloudmersive:Cloudmersive.APIClient.Java:pom:v3.62 from/to jitpack.io (https://jitpack.io): Transfer failed for https://jitpack.io/com/github/Cloudmersive/Cloudmersive.APIClient.Java/v3.62/Cloudmersive.APIClient.Java-v3.62.pom: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty -> [Help 1] [ERROR]

So I think there must be something different on this server that is causing the dependency error. Any ideas please?

I see it gets a java.security.InvalidAlgorithmParameterException, so this suggests that there is probably some restriction configured on the server that is preventing the dependency being downloaded to the server.

More info:

pom.xml

    <dependency>
        <groupId>com.github.Cloudmersive</groupId>
        <artifactId>Cloudmersive.APIClient.Java</artifactId>
        <version>v3.62</version>
        <exclusions>
            <exclusion>
                <groupId>io.swagger</groupId>
                <artifactId>swagger-annotations</artifactId>
            </exclusion>
            <exclusion>
                <groupId>org.springframework</groupId>
                <artifactId>spring-web</artifactId>
            </exclusion>
            <exclusion>
                <groupId>org.springframework</groupId>
                <artifactId>spring-context</artifactId>
            </exclusion>
        </exclusions>
    </dependency>

Maven version on linux server with the error:

Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f) Maven home: /home/jboss/.sdkman/candidates/maven/current Java version: 1.7.0_95, vendor: Oracle Corporation, runtime: /usr/java/java-7-openjdk-amd64/jre Default locale: en_US, platform encoding: ANSI_X3.4-1968 OS name: "linux", version: "3.10.0-1160.15.2.el7.x86_64", arch: "amd64", family: "unix"

Maven version of linux server that has no error:

Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f) Maven home: /opt/apache-maven-3.6.3 Java version: 1.7.0_161, vendor: Oracle Corporation, runtime: /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.161-2.6.12.0.el7_4.x86_64/jre Default locale: en_US, platform encoding: ANSI_X3.4-1968 OS name: "linux", version: "3.10.0-957.21.3.el7.x86_64", arch: "amd64", family: "unix"

Maven version on localhost that has no error:

Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T18:41:47+02:00) Maven home: /Users/richardmarais/Development/java/Maven/apache-maven-3.3.9 Java version: 1.7.0_80, vendor: Oracle Corporation Java home: /Library/Java/JavaVirtualMachines/jdk1.7.0_80.jdk/Contents/Home/jre Default locale: en_GB, platform encoding: UTF-8 OS name: "mac os x", version: "10.16", arch: "x86_64", family: "mac"

Richard
  • 8,193
  • 28
  • 107
  • 228
  • I've seen something similar a year back, it was caused by different java build versions. Can you check that? – Pijotrek May 14 '21 at 09:07
  • this may be related: https://stackoverflow.com/questions/6784463/error-trustanchors-parameter-must-be-non-empty - it suggests to verify your truststore configurtion. – wemu May 14 '21 at 09:29
  • 1
    I assume you have to check fi your JDK 7 is able to support TLSv1.2 minimum ...because by default 1.7 was not able to do so ...in particular such old versions... What you can do is to use more recent versions of Java (JDK8+) and set target/source to the appropriate level (JDK9+ you could use --release 7).. also your linux version is very old (3.10 kernel?) ... – khmarbaise May 14 '21 at 10:38

1 Answers1

0

I fixed this issue. The problem was the Java version. I temporally build with Java 8 (to download the Cloudmersive api), then switched back to Java 7. Build is successful.

Richard
  • 8,193
  • 28
  • 107
  • 228