请问这个报错如何解决
[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
正在回答
你好!把之前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>
祝学习愉快!
可以打包成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]
还是不行就是报下面的错误不知道是怎么回事。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
<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>
相似问题
登录后可查看更多问答,登录/注册
- 参与学习 人
- 提交作业 357 份
- 解答问题 8016 个
本阶段将带你学习MySQL数据库,JDBC接口,MyBatis框架等,带你掌握的数据的存放和管理。
了解课程
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星