java - Eclipse Maven 项目无法解析依赖项

标签 java eclipse maven svn dependencies

这是我在这个领域的第一个问题,因为我没有使用过Eclipse和Maven。所以,要宽容一点!我几周来一直在寻找解决方案,但没有成功,所以我希望它不是重复的。

我正在尝试在 Eclipse 中构建 Maven 项目。该项目是从 Subversion 存储库 check out 的。它具有自定义 pom.xml 文件,并且包含来自 VPN 远程存储库的多个依赖项。我有一个包含 jar 和所有必要文件的本地文件夹。如果远程文件不可用或不存在,则应从本地文件夹加载。我确信所有依赖项声明都是正确的,并且 Maven 设置指定了文件夹的正确路径。文件夹名称以“.”开头。并且 macOS 将这些文件处理为隐藏(我不认为这是问题),因为 Maven 找到了目录中的一些文件,除了 milyn/frude/1.3/frude-1.3.pom。我希望一切都清楚。 很抱歉这篇文章很长。

控制台日志更好地讲述了这个故事:

[INFO] Scanning for projects...
[INFO] ----------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO] 
[INFO] CTA main project
[INFO] cta-bom
[INFO] cta-common
[INFO] cta-model
[INFO] cta-birt
[INFO] cta-dto
[INFO] cta-business
[INFO] cta-web
[INFO] cta-test
[INFO]                                                                         
[INFO] ----------------------------------------------------------------
[INFO] Building CTA main project 1.0.10-SNAPSHOT
[INFO] ----------------------------------------------------------------
[INFO] --- properties-maven-plugin:1.0-alpha-2:read-project-properties                   (clean-properties) @ cta ---
[WARNING] Ignoring missing properties file: /Users/tothkristof/Documents/Programming/Java Projects/CTA Project/developer.properties
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ cta ---
[INFO] 
[INFO] --- properties-maven-plugin:1.0-alpha-2:read-project-properties (build-properties) @ cta ---
[WARNING] Ignoring missing properties file: /Users/tothkristof/Documents/Programming/Java Projects/CTA Project/developer.properties
[INFO] 
[INFO] --- buildnumber-maven-plugin:1.3:create (default) @ cta ---
[INFO] Executing: /bin/sh -c cd "/Users/tothkristof/Documents/Programming/Java Projects/CTA Project/cta" && svn --non-interactive info
[INFO] Working directory: /Users/tothkristof/Documents/Programming/Java Projects/CTA Project/cta
[INFO] Storing buildNumber: 1702 at timestamp: 1477050870632
[INFO] Executing: /bin/sh -c cd "/Users/tothkristof/Documents/Programming/Java Projects/CTA Project/cta" && svn --non-interactive info
[INFO] Working directory: /Users/tothkristof/Documents/Programming/Java Projects/CTA Project/cta
[INFO] Storing buildScmBranch: trunk
[INFO] 
[INFO] --- maven-install-plugin:2.4:install (default-install) @ cta ---
[INFO] Installing /Users/tothkristof/Documents/Programming/Java Projects/CTA Project/cta/pom.xml to /Users/tothkristof/.m2/repository/hu/innovitech/cta/cta/1.0.10-SNAPSHOT/cta-1.0.10-SNAPSHOT.pom
[INFO]                                                                         
[INFO] ----------------------------------------------------------------
[INFO] Building cta-bom 1.0.10-SNAPSHOT
[INFO] ----------------------------------------------------------------
[INFO] 
[INFO] --- properties-maven-plugin:1.0-alpha-2:read-project-properties (clean-properties) @ cta-bom ---
[WARNING] Ignoring missing properties file: /Users/tothkristof/Documents/Programming/Java Projects/CTA Project/cta/cta-bom/developer.properties
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ cta-bom ---
[INFO] 
[INFO] --- properties-maven-plugin:1.0-alpha-2:read-project-properties (build-properties) @ cta-bom ---
[WARNING] Ignoring missing properties file: /Users/tothkristof/Documents/Programming/Java Projects/CTA Project/cta/cta-bom/developer.properties
[INFO] 
[INFO] --- buildnumber-maven-plugin:1.3:create (default) @ cta-bom ---
[INFO] 
[INFO] --- maven-install-plugin:2.4:install (default-install) @ cta-bom ---
[INFO] Installing /Users/tothkristof/Documents/Programming/Java Projects/CTA Project/cta/cta-bom/pom.xml to /Users/tothkristof/.m2/repository/hu/innovitech/cta/cta-bom/1.0.10-SNAPSHOT/cta-bom-1.0.10-SNAPSHOT.pom
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building cta-common 1.0.10-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- properties-maven-plugin:1.0-alpha-2:read-project-properties (clean-properties) @ cta-common ---
[WARNING] Ignoring missing properties file: /Users/tothkristof/Documents/Programming/Java Projects/CTA Project/cta/cta-common/developer.properties
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ cta-common ---
[INFO] 
[INFO] --- properties-maven-plugin:1.0-alpha-2:read-project-properties     (build-properties) @ cta-common ---
[WARNING] Ignoring missing properties file: /Users/tothkristof/Documents/Programming/Java Projects/CTA Project/cta/cta-common/developer.properties
[INFO] 
[INFO] --- buildnumber-maven-plugin:1.3:create (default) @ cta-common ---
[INFO] 
[INFO] --- maven-resources-plugin:2.7:resources (default-resources) @ cta-common ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/tothkristof/Documents/Programming/Java Projects/CTA Project/cta/cta-common/src/main/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.3:compile (default-compile) @ cta-common ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 4 source files to /Users/tothkristof/Documents/Programming/Java Projects/CTA Project/cta/cta-common/target/classes
[INFO] 
[INFO] --- maven-resources-plugin:2.7:testResources (default-testResources) @ cta-common ---
[INFO] Not copying test resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.3:testCompile (default-testCompile) @ cta-common ---
[INFO] Not compiling test sources
[INFO] 
[INFO] --- maven-surefire-plugin:2.4.3:test (default-test) @ cta-common ---
[INFO] Tests are skipped.
[INFO] 
[INFO] --- maven-jar-plugin:2.6:jar (default-jar) @ cta-common ---
[INFO] Building jar: /Users/tothkristof/Documents/Programming/Java Projects/CTA Project/cta/cta-common/target/cta-common-1.0.10-SNAPSHOT.jar
[INFO] 
[INFO] --- maven-install-plugin:2.4:install (default-install) @ cta-common ---
[INFO] Installing /Users/tothkristof/Documents/Programming/Java Projects/CTA Project/cta/cta-common/target/cta-common-1.0.10-SNAPSHOT.jar to /Users/tothkristof/.m2/repository/hu/innovitech/cta/cta-common/1.0.10-SNAPSHOT/cta-common-1.0.10-SNAPSHOT.jar
[INFO] Installing /Users/tothkristof/Documents/Programming/Java Projects/CTA Project/cta/cta-common/pom.xml to /Users/tothkristof/.m2/repository/hu/innovitech/cta/cta-common/1.0.10-SNAPSHOT/cta-common-1.0.10-SNAPSHOT.pom
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building cta-model 1.0.10-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- properties-maven-plugin:1.0-alpha-2:read-project-properties     (clean-properties) @ cta-model ---
[WARNING] Ignoring missing properties file:     /Users/tothkristof/Documents/Programming/Java Projects/CTA Project/cta/cta-model/developer.properties
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ cta-model ---
[INFO] 
[INFO] --- properties-maven-plugin:1.0-alpha-2:read-project-properties (build-properties) @ cta-model ---
[WARNING] Ignoring missing properties file: /Users/tothkristof/Documents/Programming/Java Projects/CTA Project/cta/cta-model/developer.properties
[INFO] 
[INFO] --- buildnumber-maven-plugin:1.3:create (default) @ cta-model ---
[INFO] 
[INFO] --- maven-resources-plugin:2.7:resources (default-resources) @ cta-model ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 5 resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.3:compile (default-compile) @ cta-model ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 46 source files to /Users/tothkristof/Documents/Programming/Java Projects/CTA Project/cta/cta-model/target/classes
[INFO] 
[INFO] --- maven-resources-plugin:2.7:testResources (default-testResources) @ cta-model ---
[INFO] Not copying test resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.3:testCompile (default-testCompile) @ cta-model ---
[INFO] Not compiling test sources
[INFO] 
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ cta-model ---
[INFO] Tests are skipped.
[INFO] 
[INFO] --- maven-jar-plugin:2.6:jar (default-jar) @ cta-model ---
[INFO] Building jar: /Users/tothkristof/Documents/Programming/Java Projects/CTA Project/cta/cta-model/target/cta-model-1.0.10-SNAPSHOT.jar
[INFO] 
[INFO] --- maven-install-plugin:2.4:install (default-install) @ cta-model ---
[INFO] Installing /Users/tothkristof/Documents/Programming/Java Projects/CTA Project/cta/cta-model/target/cta-model-1.0.10-SNAPSHOT.jar to /Users/tothkristof/.m2/repository/hu/innovitech/cta/cta-model/1.0.10-SNAPSHOT/cta-model-1.0.10-SNAPSHOT.jar
[INFO] Installing /Users/tothkristof/Documents/Programming/Java Projects/CTA Project/cta/cta-model/pom.xml to /Users/tothkristof/.m2/repository/hu/innovitech/cta/cta-model/1.0.10-SNAPSHOT/cta-model-1.0.10-SNAPSHOT.pom
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building cta-birt 1.0.10-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] Downloading: https://maven.innovitech.internal/nexus/content/groups/public/milyn/flute/1.3/flute-1.3.pom
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] 
[INFO] CTA main project ................................... SUCCESS [  1.250 s]
[INFO] cta-bom ............................................ SUCCESS [  0.016 s]
[INFO] cta-common ......................................... SUCCESS [  2.854 s]
[INFO] cta-model .......................................... SUCCESS [  1.733 s]
[INFO] cta-birt ........................................... FAILURE [  6.206 s]
[INFO] cta-dto ............................................ SKIPPED
[INFO] cta-business ....................................... SKIPPED
[INFO] cta-web ............................................ SKIPPED
[INFO] cta-test ........................................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 12.792 s
[INFO] Finished at: 2016-10-21T13:54:41+02:00
[INFO] Final Memory: 35M/365M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project cta-birt: Could not resolve dependencies for project hu.innovitech.cta:cta-birt:jar:1.0.10-SNAPSHOT: Failed to collect dependencies at hu.ss.weld:weld-fw-birt:jar:1.0.3 -> org.eclipse.birt.runtime:org.eclipse.birt.runtime:jar:4.3.0 -> milyn:flute:jar:1.3: Failed to read artifact descriptor for milyn:flute:jar:1.3: Could not transfer artifact milyn:flute:pom:1.3 from/to innovitech-repository (https://maven.innovitech.internal/nexus/content/groups/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
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <goals> -rf :cta-birt

如果您需要更多信息文件或路径,我可以添加它们。

提前致谢,

克里斯托夫

最佳答案

当您在 HTTPS 站点上下载时,您需要在信任存储中添加服务器证书。 然后,当您运行 Maven 命令时,不要忘记添加此信任存储的环境属性。

以下是有关如何创建信任库的链接: Digital Certificate: How to import .cer file in to .truststore file using?

还有:

-Djavax.net.ssl.trustStore=/home/path/to/truststore

运行编译时使用信任库。

您还可以遵循 Maven 的指南:

http://maven.apache.org/guides/mini/guide-repository-ssl.html

关于java - Eclipse Maven 项目无法解析依赖项,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40177576/

相关文章:

java - 如何获取内部IP地址?

linux - GDB 在 Eclipse 中不显示某些值

java - Wildfly 9 中的部署顺序

java - spring 3.1 maven 依赖项和 pom.xml

java - 删除表单中断 Play Framework 中的输入(2.3)

java - while循环条件怎么写

java - Netbeans 中 WebStart 属性中的自签名复选框的含义是什么

java lang 类转换异常

java - 尝试在java中四舍五入到小数点后两位

java - Togglz 引发 IllegalStateException 错误