简体   繁体   English

mvn install 在 Eclipse 中不起作用,但在命令行中工作正常

[英]mvn install is not working in eclipse but works fine from command line

I am unable to build a project through eclipse but it works fine when I run mvn clean install.我无法通过 eclipse 构建项目,但是当我运行 mvn clean install 时它工作正常。 I am getting the following issue.我遇到以下问题。

Failed to execute goal org.apache.maven.plugins:maven-install-plugin:2.4:install (default-install) on project abc-xxx: Execution default-
install of goal org.apache.maven.plugins:maven-install-plugin:2.4:install 
failed: Plugin org.apache.maven.plugins:maven-install-plugin:2.4 or one of its 
dependencies could not be resolved: Failed to collect dependencies at 
org.apache.maven.plugins:maven-install-plugin:jar:2.4 -> 
org.codehaus.plexus:plexus-utils:jar:3.0.5: Failed to read artifact descriptor 
for org.codehaus.plexus:plexus-utils:jar:3.0.5: Could not transfer artifact 
org.codehaus.plexus:plexus-utils:pom:3.0.5 from/to anonymous 
(https://nexus.xxx.xxx.xxx/nexus/content/groups/xxx):     
sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: 
unable to find valid  certification path to requested target

Make sure the JDK you are using in the command line is the same that you are using in your IDE .确保您在命令行中使用的JDK与您在IDE中使用的相同。

In the command line type:在命令行输入:

java -version

Then inside eclipse:然后在日食里面:

 windows -> preferences -> Installed JREs

The same goes for maven : Maven 也是如此

In the command line type:在命令行输入:

mvn -version

In eclipse:在日食中:

 windows -> preferences -> Maven -> User settings
 windows -> preferences -> Maven -> Installations

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 尝试从 mvn 全新安装时,wiremock 抛出 Nullpointer,但与 Eclipse JunitTest 一起工作正常 - wiremock is throwing Nullpointer when trying from the mvn clean install but working fine with eclipse JunitTest mvn install命令可在Mac终端上运行,但无法从Eclipse Maven插件运行 - mvn install command working on mac terminal but not working from eclipse maven plugin 测试在Eclipse中运行正常,但在mvn命令中失败 - Tests Run fine in Eclipse but failed in mvn command 从命令行运行 mvn install 时出现 Jacoco 错误 - Jacoco Error when running mvn install from command line 如何从命令行运行 java 项目(在 eclipse 中正常工作,gradle) - How to run java project from command line (works fine in eclipse, gradle) 从 src/main/resources 读取会在命令行上给出 java.nio.file.InvalidPathException (但在 Eclipse 中工作正常) - Reading from src/main/resources gives java.nio.file.InvalidPathException on command line (but works fine in Eclipse) Maven项目可以在Eclipse中运行,但不能从命令行运行 - Maven project works in eclipse but not from command line 从命令行或jar文件执行应用程序时,JTable无法正确显示Unicode。 虽然它在日食中工作正常 - JTable won't display Unicode correctly when the application is executed from the command line or a jar file. It works fine in eclipse, though HttpsURLConnection.getInputStream 在 Eclipse 中工作正常,但在导出代码并从命令行运行后服务器返回响应代码 503 - HttpsURLConnection.getInputStream works fine in Eclipse but server returns response code 503 after code is exported and run from command line UnsatisfiedLInkError Eclipse JNI(可从命令行运行,但不能在Eclipse中使用)软件包名称 - UnsatisfiedLInkError Eclipse JNI (works from command line but not in Eclipse) package names
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM