在使用maven过程中出现的问题(1)——运行mvn compile报错

xiaoxiao2025-11-15  6

第一次用maven创建项目,运行mvn compile报错

[ERROR] Plugin org.apache.maven.plugins:maven-resources-plugin:2.6 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org. apache.maven.plugins:maven-resources-plugin:jar:2.6: Could not transfer artifact org.apache.maven.plugins:maven-resources-plugin:pom:2.6 from/to central (https: //repo.maven.apache.org/maven2): Received fatal alert: protocol_version -> [Help 1] [ERROR] Plugin org.apache.maven.plugins:maven-resources-plugin:2.6 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org. apache.maven.plugins:maven-resources-plugin:jar:2.6: Could not transfer artifact org.apache.maven.plugins:maven-resources-plugin:pom:2.6 from/to central (https: //repo.maven.apache.org/maven2): repo.maven.apache.org: Unknown host repo.maven. apache.org -> [Help 1]

开始真的是一头雾水,在网上查找解决办法, 1、有的说缺少依赖,直接在pom文件中添加依赖添加链接描述 <dependency> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-resources-plugin</artifactId> <version>2.6</version> </dependency>

2、有的说原因是maven的中央仓库没法访问 解决方法是修改conf/settings.xml,设mirror为http://mirrors.ibiblio.org/pub/mirrors/maven2

… 我的解决办法就是卸载了原来的maven3.5.2,重新下载解压了一个maven3.2.2------------可能是版本的问题,也可能是当时配置有稍许问题…???

其他见参考:maven compile问题解决

使用Maven命令创建项目

转载请注明原文地址: https://www.6miu.com/read-5039714.html

最新回复(0)