请问这个报错如何解决

请问这个报错如何解决

[INFO] Scanning for projects...

[INFO] 

[INFO] -------------------------< com.cyc:mavenfirst >-------------------------

[INFO] Building mavenfirst 0.0.1-RELEASE

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

[INFO] 

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

[INFO] 

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

[INFO] Using 'UTF-8' encoding to copy filtered resources.

[INFO] Copying 0 resource

[INFO] 

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

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

[INFO] 

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

[INFO] Using 'UTF-8' encoding to copy filtered resources.

[INFO] Copying 0 resource

[INFO] 

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

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

[INFO] 

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

[INFO] 

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

[INFO] 

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

[INFO] 

[INFO] 

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

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

[INFO] BUILD FAILURE

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

[INFO] Total time:  1.593 s

[INFO] Finished at: 2019-07-06T23:51:05+08:00

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

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-assembly-plugin:2.5.5:assembly (default-cli) on project mavenfirst: Error reading assemblies: Descriptor with ID 'jar-with-denpendencies' not found -> [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


正在回答

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

7回答

你好!把之前plugin的内容注释掉,换成下面的内容试一下。

<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.4</version>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<archive>
<manifest>
<mainClass>com.cyc.pinyintest.PinYinTest</mainClass>
</manifest>
</archive>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>

祝学习愉快!

提问者 gwtcyc 2019-07-07 19:55:29

http://img1.sycdn.imooc.com//climg/5d21dd5d0001964205320424.jpg

http://img1.sycdn.imooc.com//climg/5d21dd5d0001fbae08010452.jpg

可以打包成jar ,但是没法把所有jar打在一起,没有课程中的jar-with-dependencies的这个jar包



[ERROR] Failed to execute goal org.apache.maven.plugins:maven-assembly-plugin:2.5.5:assembly (default-cli) on project maventest: Error reading assemblies: Descriptor with ID 'jar-with-denpendencies' not found -> [Help 1] 



吃吃吃鱼的猫 2019-07-07 17:43:13

同学你好,点击右侧maven-》Dependencies,查看引入的依赖是否有报错。

http://img1.sycdn.imooc.com//climg/5d21b6b70001058006500309.jpg

如果我的回答解决了你的疑惑,请采纳。祝:学习愉快~

提问者 gwtcyc 2019-07-07 16:44:34

还是不行就是报下面的错误不知道是怎么回事。Descriptor with ID 'jar-with-denpendencies' not found 是不是这个导致的呢


[ERROR] Failed to execute goal org.apache.maven.plugins:maven-assembly-plugin:2.5.5:assembly (default-cli) on project ss: Error reading assemblies: Descriptor with ID 'jar-with-denpendencies' not found -> [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


吃吃吃鱼的猫 2019-07-07 11:21:29

同学先删除项目下的target文件夹,然后重新执行操作进行测试哦(无需再执行clean命令)~


如果我的回答解决了你的疑惑,请采纳。祝:学习愉快~


吃吃吃鱼的猫 2019-07-07 11:04:21

同学你好,问一下同学执行的什么操作呢?


建议同学先删除项目下的target文件夹,然后重新执行操作哦~


如果我的回答解决了你的疑惑,请采纳。祝:学习愉快~

  • 提问者 gwtcyc #1
    就是项目打包的时候,运行时候报的错
    2019-07-07 11:06:17
提问者 gwtcyc 2019-07-06 23:54:42

<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 http://maven.apache.org/xsd/maven-4.0.0.xsd">

  <modelVersion>4.0.0</modelVersion>

  <groupId>com.cyc</groupId>

  <artifactId>mavenfirst</artifactId>

  <version>0.0.1-RELEASE</version>

  <repositories>

   <repository>

   <!-- 创建私服的地址 -->

     <id>aliyun</id>

     <name>aliyun</name>

     <url>https://maven.aliyun.com/repository/public</url>

   </repository>

  </repositories>

  <dependencies>

   <dependency>

  <groupId>com.belerweb</groupId>

  <artifactId>pinyin4j</artifactId>

  <version>2.5.1</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.cyc.pinyintest.PinYinTest</mainClass>

             </manifest>

           </archive>

           <descriptorRefs>

            <descriptorRef>jar-with-denpendencies</descriptorRef>

           </descriptorRefs>

         </configuration>

        </plugin>

       </plugins>

     </build>

<properties>

    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

    <maven.compiler.source>12</maven.compiler.source>

    <maven.compiler.target>12</maven.compiler.target>

</properties>

</project>


问题已解决,确定采纳
还有疑问,暂不采纳

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

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

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

在线咨询

领取优惠

免费试听

领取大纲

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