沒能打包成功

沒能打包成功

<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.ziwen.test</groupId>
	<artifactId>maven-first</artifactId>
	<version>1.0.0RELEASE</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>5.1.48</version>
		</dependency>
		<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.test.Test</mainClass>
						</manifest>
					</archive>
					<descriptorRefs>
						<descriptorRef>jar-with-dependencies</descriptorRef>
					</descriptorRefs>
				</configuration>
			</plugin>
		</plugins>
	</build>
</project>


Failed to execute goal org.apache.maven.plugins:maven-assembly-plugin:2.5.5:assembly (default-cli) on project maven-first: Execution default-cli of goal org.apache.maven.plugins:maven-assembly-plugin:2.5.5:assembly failed: Plugin org.apache.maven.plugins:maven-assembly-plugin:2.5.5 or one of its dependencies could not be resolved: Failed to collect dependencies at org.apache.maven.plugins:maven-assembly-plugin:jar:2.5.5 -> org.apache.maven:maven-core:jar:2.2.1 -> org.apache.maven.reporting:maven-reporting-api:jar:2.2.1: Failed to read artifact descriptor for org.apache.maven.reporting:maven-reporting-api:jar:2.2.1: Could not transfer artifact org.apache.maven.reporting:maven-reporting:pom:2.2.1 from/to central (https://repo.maven.apache.org/maven2): Transfer failed for https://repo.maven.apache.org/maven2/org/apache/maven/reporting/maven-reporting/2.2.1/maven-reporting-2.2.1.pom: Connect to repo.maven.apache.org:443 [repo.maven.apache.org/151.101.52.215] failed: Connection timed out: connect -> [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/PluginResolutionException


正在回答

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

2回答

同学你好,如下提示maven-assembly-plugin或着其依赖无法解析,如:

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

可能是从中央仓库下载插件到本地仓库时出现错误,所以建议删除本地仓库中的maven-assembly-plugin插件,重新从中央仓库下插件并打包。

祝:学习愉快~

好帮手慕阿满 2020-03-18 18:58:40

同学你好,建议同学删除本地仓库中maven-assembly-plugin插件,目录如下:

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

然后重新打包再试试。

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

  • 提问者 cccca #1
    解决了,我想请问怎么看出是这里出错的,我还以为是在中央仓库加载插件问题
    2020-03-18 20:19:20
问题已解决,确定采纳
还有疑问,暂不采纳

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

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

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

在线咨询

领取优惠

免费试听

领取大纲

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