-
Notifications
You must be signed in to change notification settings - Fork 10
Closed
Description
在Mac上,执行mvn install 遇到如下错误
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building sample 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
Downloading: https://nexus.chatopera.com/repository/maven-public/com/chatopera/bot/sdk/1.0.1/sdk-1.0.1.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.024 s
[INFO] Finished at: 2018-11-06T18:15:08+08:00
[INFO] Final Memory: 10M/165M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project sample: Could not resolve dependencies for project com.chatopera.bot:sample:jar:1.0-SNAPSHOT: Failed to collect dependencies at com.chatopera.bot:sdk:jar:1.0.1: Failed to read artifact descriptor for com.chatopera.bot:sdk:jar:1.0.1: Could not transfer artifact com.chatopera.bot:sdk:pom:1.0.1 from/to public (https://nexus.chatopera.com/repository/maven-public): sun.security.validator.ValidatorException: PKIX path building failed:
sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
解决办法
-
安装最新的Java SDK
下载地址 -
查看Java 安装路径
Mac上的路径为
/Library/Java/JavaVirtualMachines/jdk_xxx.jdk/Contents/Home
xxx为该虚拟机版本,比如目前最新版本为
/Library/Java/JavaVirtualMachines/jdk1.8.0_191.jdk/Contents/Home
- 设置JAVA_HOME
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_191.jdk/Contents/Home
export PATH=$PATH:$JAVA_HOME/bin
- 测试Java版本
java -version
java version "1.8.0_191"
Java(TM) SE Runtime Environment (build 1.8.0_191-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.191-b12, mixed mode)
- 执行mvn install
下载成功
Metadata
Metadata
Assignees
Labels
No labels
