bingoohuang / blog

write blogs with issues
MIT License
178 stars 24 forks source link

玩转一下Maven #175

Open bingoohuang opened 4 years ago

bingoohuang commented 4 years ago

玩转一下Maven

独立测试某个包是否可以下载

maven-dependency-plugin usage

  1. mvn dependency:get -Dartifact=groupId:artifactId:version[:packaging][:classifier]

  2. `mvn dependency:get -DrepoUrl=http://.../ -Dartifact=com.foo.something:component:LATEST:jar -Dtransitive=false

  3. mvn dependency:get -Dartifact=junit:junit:4.12

  4. mvn dependency:get -Dartifact=junit:junit:4.12:jar:sources

🕙[2020-10-10 14:12:29.767] ❯ mvn dependency:get -Dartifact=com.github.gobars:aspectmeta:0.0.4
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------< org.apache.maven:standalone-pom >-------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] --------------------------------[ pom ]---------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:2.8:get (default-cli) @ standalone-pom ---
[INFO] Resolving com.github.gobars:aspectmeta:jar:0.0.4 with transitive dependencies
Downloading from releases: http://192.168.126.160:8088/nexus/content/repositories/releases/com/github/gobars/aspectmeta/0.0.4/aspectmeta-0.0.4.pom
Downloading from public: http://192.168.126.160:8088/nexus/content/repositories/public/com/github/gobars/aspectmeta/0.0.4/aspectmeta-0.0.4.pom
Downloaded from public: http://192.168.126.160:8088/nexus/content/repositories/public/com/github/gobars/aspectmeta/0.0.4/aspectmeta-0.0.4.pom (8.9 kB at 247 kB/s)
Downloading from releases: http://192.168.126.160:8088/nexus/content/repositories/releases/com/github/gobars/aspectmeta/0.0.4/aspectmeta-0.0.4.jar
Downloading from public: http://192.168.126.160:8088/nexus/content/repositories/public/com/github/gobars/aspectmeta/0.0.4/aspectmeta-0.0.4.jar
Downloaded from public: http://192.168.126.160:8088/nexus/content/repositories/public/com/github/gobars/aspectmeta/0.0.4/aspectmeta-0.0.4.jar (10 kB at 325 kB/s)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  1.236 s
[INFO] Finished at: 2020-10-10T14:12:33+08:00
[INFO] ------------------------------------------------------------------------

修复https错误 In service - Remote Automatically Blocked and Unavailable.

https://support.sonatype.com/hc/en-us/articles/213465038-Fix-https-repository-blocking-by-PKIX-path-building-failed

Symptoms
The Status of one or more of your repositories which have a remote URL starting with https is:
In service - Remote Automatically Blocked and Unavailable.
The repository was automatically blocked by Nexus because the error indicates:  
sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

参见

  1. How to use TLS 1.2 in Java 6 lvyong note
  2. How to use TLS 1.2 in Java 6 stackoverflow
bingoohuang commented 2 years ago
$ mvn dependency:tree -Dincludes=com.fasterxml.jackson.core::::
[INFO] Scanning for projects...
[INFO] 
[INFO] -----------------< com.github.bingoohuang:longpolling >-----------------
[INFO] Building longpolling 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ longpolling ---
[INFO] com.github.bingoohuang:longpolling:jar:0.0.1-SNAPSHOT
[INFO] \- com.fasterxml.jackson.core:jackson-databind:jar:2.13.3:compile
[INFO]    \- com.fasterxml.jackson.core:jackson-core:jar:2.13.3:compile
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  0.801 s
[INFO] Finished at: 2022-08-24T08:34:27+08:00
[INFO] ------------------------------------------------------------------------