此异常是在idea中执行打包时报的异常,该异常时由于我再进行项目本地打包时,抛出的异常,因为刚才进行了clean 和package 都没有出问题,但是在后来的时候却跑出了异常,经过一番寻找,终于发现了该异常,的原因,因为我在部署项目是用secureCRT在上传jar包是,打开了项目中编译好的target文件,所以后来在进行maven clean 和 package时便出现了该异常。
F:\develop\jdk1.8\bin\java -Dmaven.multiModuleProjectDirectory=D:\AAAgongzuo\sciencedb\casearth-service\dataset-version-service -Dmaven.home=F:\develop\maven\apache-maven-3.5.2-bin\apache-maven-3.5.2 -Dclassworlds.conf=F:\develop\maven\apache-maven-3.5.2-bin\apache-maven-3.5.2\bin\m2.conf "-javaagent:H:\Program Files\JetBrains\IntelliJ IDEA 2017.1.5\lib\idea_rt.jar=51320:H:\Program Files\JetBrains\IntelliJ IDEA 2017.1.5\bin" -Dfile.encoding=UTF-8 -classpath F:\develop\maven\apache-maven-3.5.2-bin\apache-maven-3.5.2\boot\plexus-classworlds-2.5.2.jar org.codehaus.classworlds.Launcher -Didea.version=2017.1.5 -s F:\develop\maven\apache-maven-3.5.2-bin\apache-maven-3.5.2\conf\settings.xml -DskipTests=true clean
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building dataset-version-service 1.0.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:3.0.0:clean (default-clean) @ dataset-version-service ---
[INFO] Deleting D:\AAAgongzuo\sciencedb\casearth-service\dataset-version-service\target
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.401 s
[INFO] Finished at: 2018-11-26T11:26:31+08:00
[INFO] Final Memory: 14M/220M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:3.0.0:clean (default-clean) on project dataset-version-service: Failed to clean project: Failed to delete D:\AAAgongzuo\sciencedb\casearth-service\dataset-version-service\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/MojoExecutionException
解决问题:在进行maven clean 和 package时要看target文件是否被占用,如果被占用是打包不成功的,所以我们在进行package是要先把占用的target关闭掉。