Loading

Eclipse pom文件报错

pom文件出错

① pom.xml第一行报不明错。

问题:利用STS,创建新的Spring Boot工程的时候,pom.xml第一行报错。

 

 

原因:

maven-jar-plugin 最新版3.1.2 的bug?

 解决方案:

指定 maven-jar-plugin 版本为 3.1.1

<maven-jar-plugin.version>3.1.1</maven-jar-plugin.version>
<?xml version="1.0" encoding="UTF-8"?>
<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>
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.4.2</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>
    <groupId>com.bizrobo</groupId>
    <artifactId>monitor</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <name>bizroboMonitor</name>
    <description>bizroboMonitor</description>
    <properties>
        <java.version>1.8</java.version>
        <!-- 追加 -->
        <maven-jar-plugin.version>3.1.1</maven-jar-plugin.version>
    </properties> 

②  Failure to transfer org.apache.maven.plugins:maven-compiler-plugin:pom:2.0.2 

错误内容:

Description Resource Path Location Type Could not calculate build plan: Failure to transfer org.apache.maven.plugins:maven-compiler-plugin:pom:2.0.2 
from http://repo1.maven.org/maven2 was cached in the local repository,
resolution will not be reattempted until the update interval of central has elapsed or updates are forced.
Original error: Could not transfer artifact org.apache.maven.plugins:maven-compiler-plugin:pom:2.0.2 from/to central
(http://repo1.maven.org/maven2): No response received after 60000 ExampleProject Unknown Maven Problem

对应方案:

1 .删除本地失败的下载内容

d %userprofile%\.m2\repository
for /r %i in (*.lastUpdated) do del %i

2 .右键eclipse 里的工程,然后选择 Maven->"Update Project ...", 确保 "Update Dependencies" 已经打勾,然后点击ok。

Eclipse market里找不到 Spring Tool Suite

原因可能是当前版本eclipse对 sts 不支持。

win7环境下通过下载最新的32位版的eclipse,解决掉了。

https://mergedoc.osdn.jp/

 

 

posted @ 2021-01-26 13:43  然爸  阅读(506)  评论(0)    收藏  举报