maven新建工程报错(could not calculate build plan:plugin)(maven received fatal alert: protocol_version)

一、在练习使用maven做一个项目,建好父工程,再建子工程的时候给我报错了,如下图

这个时候图标上也是一把叉,工程里应该有的结构文件也没有出来。

图中提示内容如下:

不能计算计划路径:org\apache\maven\plugins\maven-resources-plugin里的2.7或者它的一个依赖不能处理:

不能读取模块描述:org\apache\maven\plugins\maven-resources-plugin

 

二、于是上网百度了一下,果然有很多人遇到了类似的问题,我找了几个成功解决的案例

https://blog.csdn.net/gezilan/article/details/80274430

https://blog.csdn.net/wjy329/article/details/79306847

先试了试

把我的本地库路径\org\apache\maven\plugins\maven-resources-plugin里的2.7先删掉,然后再用maven中的强制更新来下载新的2.7文件。。。。然后完全失败,而且得到了另外的错误提示,

如下:

[INFO] Scanning for projects...
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[FATAL] Non-resolvable parent POM for com.taotao:taotao-common:0.0.1-SNAPSHOT: Could not find artifact com.taotao:taotao-parent:pom:0.0.1-SNAPSHOT and 'parent.relativePath' points at wrong local POM @ line 3, column 11
 @ 
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]   
[ERROR]   The project com.taotao:taotao-common:0.0.1-SNAPSHOT (E:\workspace-taotao\taotao-common\pom.xml) has 1 error
[ERROR]     Non-resolvable parent POM for com.taotao:taotao-common:0.0.1-SNAPSHOT: Could not find artifact com.taotao:taotao-parent:pom:0.0.1-SNAPSHOT and 'parent.relativePath' points at wrong local POM @ line 3, column 11 -> [Help 2]
[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/ProjectBuildingException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException

如下图:

三、又是一阵翻找,发现同样的问题不能按照老办法来解决了

是因为由于TLSv1.1 协议不安全, 出于PCI 安全标准的原因, 从2018-06-18起, maven Sonatype 中央仓库不再支持 TLSv1.1 以及以下的协议版本,原文参见 no longer supports TLSv1.1 and below  官方说明

详细请看:

http://feitianbenyue.iteye.com/blog/2429045

于是又试了很久。。。。发现我这台电脑还是不行。。。我的maven是3.3.9,我的jdk是1.7版本

我的尝试包括

https://www.imooc.com/wenda/detail/394476?t=285200

https://stackoverflow.com/questions/51090914/received-fatal-alert-protocol-version-build-failure-gradle-maven

https://blog.csdn.net/u010800201/article/details/81285620

https://stackoverflow.com/questions/50946420/could-not-transfer-artifact-https-repo-maven-apache-org-maven2-received-fat

 

四、上面的办法最后都没成功,我是这样解决的

1、首先重新设置编译版本

<plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.3.2</version>
                <configuration>
                    <source>1.7</source>
                    <target>1.7</target>
                </configuration>
            </plugin>

2、然后在默认的java vm处输入了-Dhttps.protocols=TLSv1,TLSv1.1,TLSv1.2

 虽然解决了,但不知道怎么回事。。。。有点懵,记录在这里,希望能帮到更我一样头疼的朋友

  • 3
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
It seems that you encountered an error while trying to calculate the Maven build plan. The error message indicates that there is an issue with the Maven resources plugin. To troubleshoot this issue, you can try the following steps: 1. Check your Maven setup: Make sure that you have the correct version of Maven installed and configured properly on your system. 2. Update your Maven dependencies: Sometimes, this error can occur due to conflicts or compatibility issues between different plugins or dependencies. Try updating your Maven dependencies to their latest versions by running the `mvn clean install` command or using the Maven Update feature in your IDE. 3. Check your project's POM file: Verify that the `<plugins>` section in your project's POM (Project Object Model) file includes the correct version of the resources plugin (`maven-resources-plugin`) and its required dependencies. If necessary, update the version numbers and ensure that they are compatible with each other. 4. Clean your project: Run the `mvn clean` command to clean your project's build artifacts and then try building it again. 5. Check for internet connectivity issues: Sometimes, this error can occur if your system is unable to connect to the Maven Central Repository to download the required plugin artifacts. Ensure that you have a stable internet connection and try again. If none of these steps resolve the issue, please provide more details about your project setup, including the relevant sections of your POM file and any additional error messages you may have received.

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值