老师这个报错是什么原因

来源:1-6 项目打包

hejunmiao

2019-09-05 11:52:46

[ERROR] Could not find goal 'assembly' in plugin org.apache.maven.plugins:maven-assembly-plugin:3.1.1 among available goals help, single -> [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/MojoNotFoundException
<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.imooc</groupId>
	<artifactId>maven-first</artifactId>
	<version>1.0.0-RELEASE</version>
	<repositories>
		<repository>
			<!-- 创建私服的地址 -->
			<id>aliyun</id>
			<name>aliyun</name>
			<url>https://maven.aliyun.com/repository/public</url>
		</repository>
	</repositories>
	<dependencies>
		<!-- 数据库 -->
		<dependency>
			<groupId>mysql</groupId>
			<artifactId>mysql-connector-java</artifactId>
			<version>8.0.17</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.9.RELEASE</version>
		</dependency>
	</dependencies>
	<build>
		<!-- 配置插件 -->
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-assembly-plugin</artifactId>
				<version>3.1.1</version>
				<configuration>
					<archive>
						<manifest>
							<mainClass>maven.PinyinTest</mainClass>
						</manifest>
					</archive>
					<descriptorRefs>
						<!-- all in one,在打包时会将所有引用的jar合并到输出到jar文件中 -->
						<descriptorRef>jar-with-dependencies</descriptorRef>
					</descriptorRefs>
				</configuration>
			</plugin>
		</plugins>
	</build>
</project>


写回答

2回答

好帮手慕柯南

2019-09-05

同学你好!

在报错信息中有一个提示的帮助文档:

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

着这个链接文档中可以看到这样的提示:意思是使用的目标仅在插件的更高版本中可用。

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

也就是说同学目前使用的插件的版本有点高。所以会报错

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


0

hejunmiao

提问者

2019-09-05

我测试了下 2.6 后的版本就会出现这样的问题这是怎么回事

0

0 学习 · 8016 问题

查看课程