Home > OS >  Could not resolve JADE dependency
Could not resolve JADE dependency

Time:12-20

I'm trying to add JADE as a maven dependecy.

I added the repository and the property.

<repositories>
    <repository>
        <id>tilab</id>
        <url>https://jade.tilab.com/maven/</url>
    </repository>
</repositories>

<dependencies>
    <dependency>
        <groupId>com.tilab.jade</groupId>
        <artifactId>jade</artifactId>
        <version>4.6.0</version>
    </dependency>
</dependencies>

Failed to execute goal on project jade: Could not resolve dependencies for project org.example:jade:jar:1.0-SNAPSHOT: Cannot access tilab (https://jade.tilab.com/maven/) in offline mode and the artifact com.tilab.jade:jade:j ar:4.6.0 has not been downloaded from it before

When I try to import the dependency, maven returns me:

unable to find valid certification path to requested target

CodePudding user response:

Quick fix

create ~/.mavenrc

MAVEN_OPTS="-Dmaven.wagon.http.ssl.insecure=true -Dmaven.wagon.http.ssl.allowall=true -Dmaven.wagon.http.ssl.ignore.validity.dates=true"

Open Terminal

  • Change to project folder.
  • Run mvn clean package
  • You will find download message

My Test Code

├── pom.xml
└── src
    └── main
        └── java
            └── org
                └── example
                    └── Main.java

Main.java is not important

package org.example;

public class Main {
    public static void main(String[] args) {
        System.out.println("Hello world!");
    }
}

pom.xml

<?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>org.example</groupId>
    <artifactId>tmpmaven</artifactId>
    <version>1.0-SNAPSHOT</version>

    <properties>
        <maven.compiler.source>17</maven.compiler.source>
        <maven.compiler.target>17</maven.compiler.target>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>
    <repositories>
        <repository>
            <id>tilab</id>
            <url>https://jade.tilab.com/maven/</url>
        </repository>
    </repositories>
    <dependencies>
        <dependency>
           <groupId>com.tilab.jade</groupId>
           <artifactId>jade</artifactId>
           <version>4.3.3</version>
        </dependency>
    </dependencies>
</project>

Open Terminal

mvn clean ackage

$ mvn clean package
[INFO] Scanning for projects...
[INFO] 
[INFO] ------------------------< org.example:tmpmaven >------------------------
[INFO] Building tmpmaven 1.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
Downloading from tilab: https://jade.tilab.com/maven/com/tilab/jade/jade/4.3.3/jade-4.3.3.jar
Downloaded from tilab: https://jade.tilab.com/maven/com/tilab/jade/jade/4.3.3/jade-4.3.3.jar (2.7 MB at 317 kB/s)
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ tmpmaven ---
[INFO] 
[INFO] --- maven-

How to find this answer?

Try to use curl download jade-4.6.0.pom

$ curl https://jade.tilab.com/maven/com/tilab/jade/jade/4.6.0/jade-4.6.0.pom
curl: (60) SSL certificate problem: unable to get local issuer certificate
...

Fail, Error message SSL certificate problem

curl add -k skipping ssl problems

$ curl -k https://jade.tilab.com/maven/com/tilab/jade/jade/4.6.0/jade-4.6.0.pom
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
...

Add -k, to ignore SSL, it can success access.

Then find How to tell Maven to disregard SSL errors (and trusting all certs)?

How to tell Maven to disregard SSL errors (and trusting all certs)?

Find answer.

  • create ~/.mavenrc
  • or add parameter after mvn command -Dmaven.wagon.http.ssl.insecure=true -Dmaven.wagon.http.ssl.allowall=true -Dmaven.wagon.http.ssl.ignore.validity.dates=true

This is quick fix

I don't care why ssl have error, just skip ssl

  • Related