Error packaging project with maven: http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

 

今天在使用maven打包项目时遇到一个错误: 
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.4:compile (default-compile) on project zjydpt: Fatal error compiling: tools.jar not found: D:\Java\jre7..\lib\tools.jar -> [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/MojoExecutionException 
我使用的是 
C:\Users\Administrator>mvn -v 
Apache Maven 3.0.5 (r01de14724cdef164cd33c7c8c2fe155faf9602da; 2013-02-19 21:51: 
28+0800) 
Maven home: D:\apache-maven-3.0.5-bin\apache-maven-3.0.5\bin.. 
Java version : 1.7.0_67, vendor: Oracle Corporation 
Java home: D:\Java\jdk1.7.0_67\jre 
Default locale: zh_CN, platform encoding: GBK 
OS name: “windows 7”, version: “6.1”, arch: “amd64 ”, family: “windows” 
packaging directly from eclipse will report an error. You can try to use: 
1. Right-click the project in eclipse-run as-maven build-in the pop-up box Goals, directly enter clean to clean up, and then enter package to package, no need Add mvn prefix (PS: it is estimated to be a maven version problem!) 
2. Find your project in the hard disk, then hold down shift and right-click to select 'Open command window here', then enter mvn clean to clean up, and then enter mvn package to perform Pack.

I used the second method for packaging. After the packaging was completed, I found that it was possible to repackage it in eclipse. It was amazing! ! !

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324733676&siteId=291194637