0

My project use maven wrapper

$ ./mvnw -v                       
Apache Maven 3.8.6 (84538c9988a25aec085021c365c560670ad80f63)
Maven home: /home/xxx/.m2/wrapper/dists/apache-maven-3.8.6-bin/67568434/apache-maven-3.8.6
Java version: 1.8.0_332, vendor: Temurin, runtime: /home/xxx/.jdks/temurin-1.8.0/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "5.19.0-26-generic", arch: "amd64", family: "unix"

but when I type ./mvnw package,I got

Failed to execute goal on project insight-scheduler: Could not resolve dependencies for project io.xxx:insight-s:jar:1.0-SNAPSHOT: Failed to collect dependencies at io.xxx.g:g-client:jar:2.0: Failed to read artifact descriptor for io.xxx.g:g-client:jar:2.0: Could not transfer artifact io.xxx.g:g-client:pom:2.0 from/to maven-default-http-blocker (http://0.0.0.0/): Blocked mirror for repositories: [priv-xxx-libs-release

How do I

I first thought it was a private repository authentication problem, but then I found this is the new version of maven does not allow http by default, you can configure it inside settings.xml, but I used the maven wrapper, this configuration did not take effect. What do I need to do

Chaofan
  • 53
  • 4
  • 1. use `mvn -v`, if version is same as `./mvnw -v` 2. show your `pom.xml` – life888888 Dec 19 '22 at 03:39
  • My `mvn` and `./mvnw` are the same version. – Chaofan Dec 19 '22 at 04:41
  • `pom.xml` In addition to the usual configuration I have added the following configuration: - - – Chaofan Dec 19 '22 at 04:42
  • Quick guess is http problem, check pom.xml repositories , is use `http` or `https`? maven 3.8.6 does not allow use http. try to change `http` to `https` or reference How to tell Maven to disregard SSL errors (and trusting all certs)? ( https://stackoverflow.com/questions/21252800/how-to-tell-maven-to-disregard-ssl-errors-and-trusting-all-certs ) – life888888 Dec 19 '22 at 05:07
  • 1. create `~/.mavenrc` content is `MAVEN_OPTS="-Dmaven.wagon.http.ssl.insecure=true -Dmaven.wagon.http.ssl.allowall=true -Dmaven.wagon.http.ssl.ignore.validity.dates=true"` 2. or add parameter `-Dmaven.wagon.http.ssl.insecure=true -Dmaven.wagon.http.ssl.allowall=true -Dmaven.wagon.http.ssl.ignore.validity.dates=true` COPY FROM `https://stackoverflow.com/questions/21252800/how-to-tell-maven-to-disregard-ssl-errors-and-trusting-all-certs` – life888888 Dec 19 '22 at 05:10
  • Please check the release notes: https://maven.apache.org/docs/3.8.1/release-notes.html (since 3.8.1) – khmarbaise Dec 19 '22 at 06:55

0 Answers0