【问题标题】:Maven Build Failure due Plugin Dependency由于插件依赖,Maven 构建失败
【发布时间】:2017-08-14 00:44:29
【问题描述】:

我已阅读以下类似主题的先前答案,但没有一个对我有用。

这是我尝试过的: Plugin org.apache.maven.plugins:maven-clean-plugin:2.5 or one of its dependencies could not be resolved

Maven Build Failure - failure to find plugins

第一个链接实际上并不适用,因为我没有使用代理,但我确实检查了 settings.xml 文件以了解其他可能性。我可以直接去插件.jar文件下载。

第二个链接可能适用,但我不知道它们的意思是:“更改用户设置以指出正确的 settings.xml 和您的存储库文件夹应该存在于您的系统中。”我不知道该怎么做,也不确定他们指的是哪个存储库以及我是如何找到的。我只查看我的 Maven settings.xml 文件。

这是我的错误

    C:\cas-overlay-template-master>mvn package install
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building cas-overlay 1.0
[INFO] ------------------------------------------------------------------------
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-compiler-plugin/3.3/maven-compiler-plugin-3.3.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.965 s
[INFO] Finished at: 2017-03-21T23:42:13-04:00
[INFO] Final Memory: 7M/97M
[INFO] ------------------------------------------------------------------------
[ERROR] Plugin org.apache.maven.plugins:maven-compiler-plugin:3.3 or one of its dependencies could not be resolved: Could not transfer artifact org.apache.maven.plugins:maven-compiler-plugin:jar:3.3 from/to central (https://repo.maven.apache.org/maven2): java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty -> [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/PluginResolutionException

我的目标是让 CAS 5.0.4 为 Liferay 7.0ga3 工作,运行 Tomcat 8、JDK 1.8 和 Maven 3。我是一名学生,除了 JDK 1.8 之外从未使用过任何这些技术,所以我真的需要非常容易理解的答案。对于那些应该知道自己在做什么的人来说,这不是老手的答案。谢谢

【问题讨论】:

    标签: maven tomcat8 liferay-7


    【解决方案1】:

    这里的实际问题在于 Maven JVM 信任的证书:

    意外错误:java.security.InvalidAlgorithmParameterException: trustAnchors 参数必须为非空

    各种方法都可以解决,但this question 有很多解决方案(还有一个here)。

    【讨论】:

    • 我不知道如何只回复而不是评论,但我正在运行 WIndows 学生版。 Unix/Linux shell 命令对我没有帮助。什么是等效项: cd $(/usr/libexec/java_home -v 1.7)/jre/lib/security ln -fsh /System/Library/Java/Support/CoreDeploy.bundle/Contents/Home/lib/security/cacerts此外,当我查看我的settings.xml 时,我根本看不到对信任/密钥存储的任何引用。如何添加它,我是否只引用我的 JDK 1.8 /security/cacerts/*.jks 文件?
    • 我发现了这个:stackoverflow.com/questions/39788295/… 只是将 MAVEN_OPTS 指向我的 jdk1.8/security/cacerts 目录的解决方案吗?
    • 您是否有任何特殊证书需要您所在的位置(例如公司/大学代理)?
    • 无特殊证书。我是一名使用家用电脑工作的学生。
    • 我确实尝试在 JDK 中添加指向我的 cacerts 文件的 MAVEN_OPTS;但是,我收到一条错误消息:错误:无法找到或加载主类 C:\Program 我忘记启动 Liferay Tomcat,也许这就是原因;我现在正在这样做,但是加载 Tomcat 和加载 Lifray localhost 大约需要一个小时!我已在 Liferay 论坛上寻求有关启动速度非常慢的支持,但尚未取得任何成功。
    猜你喜欢
    • 2015-09-27
    • 1970-01-01
    • 2021-10-05
    • 2017-09-01
    • 2022-01-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多