【问题标题】:Eclipse Maven Project could not resolve dependenciesEclipse Maven 项目无法解析依赖项
【发布时间】:2017-03-03 19:40:45
【问题描述】:

这是我在这个领域的第一个问题,因为我没有使用过 Eclipse 和 Maven。所以,放纵一点!我一直在寻找解决方案数周没有运气,所以我希望它不是重复的。

我正在尝试在 Eclipse 中构建一个 Maven 项目。该项目已从 Subversion 存储库中签出。它有自定义的 pom.xml 文件,它们包含来自 VPN 远程存储库的几个依赖项。我有一个带有罐子和所有必要文件的本地文件夹。如果远程文件不可用或不存在,则应从本地文件夹加载。我真的确定所有依赖项声明都是正确的,并且 Maven 设置指定了文件夹的正确路径。文件夹名称以“.”开头并且 macOS 将这些文件处理为隐藏(我认为这不是问题),因为 Maven 在目录中找到了一些文件,除了 milyn/flute/1.3/flute-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

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

提前致谢,

克里斯托夫

【问题讨论】:

标签: java eclipse maven svn dependencies


【解决方案1】:

当您在 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

【讨论】:

  • 感谢您的回答。我希望这能解决问题!
  • 我已按照 Maven 的指南将受信任的证书添加到密钥库中。信任库和密钥库有什么区别?
  • 信任库和密钥库之间的区别是:信任库定义了您可以信任的证书(即,可信任的服务器证书) 密钥库定义了您可以用来在服务器上验证自己的证书。您可以在这里获得更多信息:stackoverflow.com/questions/318441/…
猜你喜欢
  • 2017-05-06
  • 1970-01-01
  • 1970-01-01
  • 2012-01-26
  • 1970-01-01
  • 1970-01-01
  • 2021-12-25
  • 2014-05-03
  • 2020-09-09
相关资源
最近更新 更多