请问这个报错如何解决

来源:1-6 项目打包

gwtcyc

2019-07-06 23:54:05

[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回答

好帮手慕珊

2019-07-08

你好!把之前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>

祝学习愉快!

0

gwtcyc

提问者

2019-07-07

http://img.mukewang.com/climg/5d21dd5d0001964205320424.jpg

http://img.mukewang.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] 



0

吃吃吃鱼的猫

2019-07-07

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

http://img.mukewang.com/climg/5d21b6b70001058006500309.jpg

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

0

gwtcyc

提问者

2019-07-07

还是不行就是报下面的错误不知道是怎么回事。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


0

吃吃吃鱼的猫

2019-07-07

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


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


0

吃吃吃鱼的猫

2019-07-07

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


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


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

0
hwtcyc
h 就是项目打包的时候,运行时候报的错
h019-07-07
共1条回复

gwtcyc

提问者

2019-07-06

<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>


0

0 学习 · 8016 问题

查看课程