博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
使用maven打包项目遇到错误: http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException...
阅读量:4550 次
发布时间:2019-06-08

本文共 1230 字,大约阅读时间需要 4 分钟。

 

今天在使用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]  
我使用的是 
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” 
直接从eclipse里面打包会报错可以尝试使用: 
1、在eclipse里面右键项目-run as-maven build-在弹出框Goals里面直接输入clean进行清理 ,然后输入package进行打包,不用加mvn前缀(PS:估计是maven版本问题吧!) 
2、在硬盘里找到你的项目,然后按住shift右键选择‘在此处打开命令窗口’,然后输入mvn clean清理,再输入mvn package进行打包。

我是使用第二种方法进行打包的,打包完成之后发现在eclipse里面重新打包居然可以了 ,很是神奇有木有!!!

 

转载于:https://www.cnblogs.com/qlqwjy/p/8908808.html

你可能感兴趣的文章
机器学习梯度下降法的数学原理(非常易懂)
查看>>
数据归一化Scaler-机器学习算法
查看>>
机器学习线性回归算法的评价指标(简单线性回归问题)
查看>>
教你如何剖析源码(转)
查看>>
proxy和proxy-no的策略取值区别
查看>>
Silverlight代码编写对控件的PlaneProjection.RotationY属性控制动画
查看>>
AFNetworking
查看>>
unity3d Start执行不同时问题
查看>>
session
查看>>
JS只能输入数字
查看>>
Laravel 数据库连接, 数据库名,配置文件修改
查看>>
屌丝接盘侠们,孩子可能不是你们亲生的!
查看>>
BZOJ 1854 【SCOI2010】 游戏
查看>>
JavaScript - 匿名函数和闭包
查看>>
负载均衡下的资源文件配置/多站点下的资源文件夹共享(Windows IIS)
查看>>
MySQL firstmatch strategy
查看>>
MS SQL server 2014 创建用户及权限
查看>>
php文件下载
查看>>
asp.net core 读取Appsettings.json 配置文件
查看>>
python 写代码笔记 2017.6.15
查看>>