老师,打包出错

老师,打包出错

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">

  <modelVersion>4.0.0</modelVersion>

  <groupId>com.imooc</groupId>

  <artifactId>maven-to</artifactId>

  <version>0.0.1-SNAPSHOT</version>

  <dependencies>

   <dependency>

  <groupId>mysql</groupId>

  <artifactId>mysql-connector-java</artifactId>

  <version>5.1.48</version>

 </dependency>

 <dependency>

  <groupId>com.belerweb</groupId>

  <artifactId>pinyin4j</artifactId>

  <version>2.5.1</version>

 </dependency>

 <dependency>

  <groupId>org.springframework</groupId>

  <artifactId>spring-webmvc</artifactId>

  <version>5.1.15.RELEASE</version>

</dependency>

  </dependencies>

  <build>

  <!-- 配置插件 -->

    <plugins>

     <plugin>

    <groupId>org.apache.maven.plugins</groupId>

    <artifactId>maven-assembly-plugin</artifactId>

    <version>2.5.5</version>

    <configuration>

       <archive>

         <manifest>

           <mainClass>com.imooc.maven.PinyinTestoor</mainClass>

           </manifest>

       </archive>

       <descriptorRefs>

       <!-- all in one,在打包时会将所有引用的jar合并到输出的jar文件中 -->

         <descriptorRef>jar-with-dependencies</descriptorRef>

       </descriptorRefs>

    </configuration>

    </plugin>

    </plugins>

  </build>

</project>


[INFO] Scanning for projects...

[INFO] 

[INFO] -------------------------< com.imooc:maven-to >-------------------------

[INFO] Building maven-to 0.0.1-SNAPSHOT

[INFO] --------------------------------[ jar ]---------------------------------

[INFO] 

[INFO] >>> maven-assembly-plugin:2.5.5:assembly (default-cli) > package @ maven-to >>>

[INFO] 

[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ maven-to ---

[WARNING] Using platform encoding (GBK actually) to copy filtered resources, i.e. build is platform dependent!

[INFO] Copying 0 resource

[INFO] 

[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ maven-to ---

[INFO] Nothing to compile - all classes are up to date

[INFO] 

[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ maven-to ---

[WARNING] Using platform encoding (GBK actually) to copy filtered resources, i.e. build is platform dependent!

[INFO] Copying 0 resource

[INFO] 

[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ maven-to ---

[INFO] Nothing to compile - all classes are up to date

[INFO] 

[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ maven-to ---

[INFO] 

[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ maven-to ---

[INFO] Building jar: D:\eclipse-workspace\maven-to\target\maven-to-0.0.1-SNAPSHOT.jar

[INFO] 

[INFO] <<< maven-assembly-plugin:2.5.5:assembly (default-cli) < package @ maven-to <<<

[INFO] 

[INFO] 

[INFO] --- maven-assembly-plugin:2.5.5:assembly (default-cli) @ maven-to ---

[INFO] Building jar: D:\eclipse-workspace\maven-to\target\maven-to-0.0.1-SNAPSHOT-jar-with-dependencies.jar

[INFO] ------------------------------------------------------------------------

[INFO] BUILD FAILURE

[INFO] ------------------------------------------------------------------------

[INFO] Total time:  7.848 s

[INFO] Finished at: 2020-05-23T17:08:38+08:00

[INFO] ------------------------------------------------------------------------

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-assembly-plugin:2.5.5:assembly (default-cli) on project maven-to: Failed to create assembly: Error creating assembly archive jar-with-dependencies: Problem creating output file for zip D:\eclipse-workspace\maven-to\target, D:\eclipse-workspace\maven-to\target\maven-to-0.0.1-SNAPSHOT-jar-with-dependencies.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


正在回答 回答被采纳积分+1

登陆购买课程后可参与讨论,去登陆

1回答
好帮手慕阿慧 2020-05-23 18:14:04

同学你好,同学可以关闭Tomcat,再打包试试。

祝学习愉快~

  • 提问者 射手流星jia #1
    我这个是jar包的
    2020-05-23 18:15:27
  • 提问者 射手流星jia #2
    我jdk是1.8的,maven是3.6,是版本问题吗?
    2020-05-23 18:18:15
  • 好帮手慕阿慧 回复 提问者 射手流星jia #3
    同学你好,不是版本问题。建议同学检查一下当前有没有应用正在使用target下maven-to-0.0.1-SNAPSHOT-jar-with-dependencies.jar文件。如果有,建议将其关闭,再打包试试。 祝学习愉快~
    2020-05-23 18:51:31
问题已解决,确定采纳
还有疑问,暂不采纳

恭喜解决一个难题,获得1积分~

来为老师/同学的回答评分吧

0 星

相似问题

登录后可查看更多问答,登录/注册

请稍等 ...
意见反馈 帮助中心 APP下载
官方微信

在线咨询

领取优惠

免费试听

领取大纲

扫描二维码,添加
你的专属老师