沒能打包成功
<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
正在回答
同学你好,如下提示maven-assembly-plugin或着其依赖无法解析,如:
可能是从中央仓库下载插件到本地仓库时出现错误,所以建议删除本地仓库中的maven-assembly-plugin插件,重新从中央仓库下插件并打包。
祝:学习愉快~
- 参与学习 人
- 提交作业 357 份
- 解答问题 8016 个
本阶段将带你学习MySQL数据库,JDBC接口,MyBatis框架等,带你掌握的数据的存放和管理。
了解课程
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星