Why am I getting Unknown error in line 1 of pom.xml?

后端 未结 18 1344
悲&欢浪女
悲&欢浪女 2020-12-02 06:43

Getting unknown error at Line 1 in pom.xml in Eclipse IDE. It was working fine till yesterday, but all of a sudden after updating my project from master and aft

相关标签:
18条回答
  • 2020-12-02 07:10

    same problem for me, original code from spring starter demo gives unknown error on line 1:

    <?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 http://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.1.6.RELEASE</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>
    ...
    

    Changing just the version of 2.1.6.RELEASE to 2.1.4.RELEASE fixes the problem.

    0 讨论(0)
  • 2020-12-02 07:11

    As per the suggestion from @Shravani, in my pom.xml file, I changed my version number in the area from this:

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.1.5.RELEASE</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>
    

    to this:

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.1.4.RELEASE</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>
    

    I then right clicked on the project and did a 'Maven -> Update project...'. This made the problem go away for me.

    0 讨论(0)
  • 2020-12-02 07:12

    Add <maven-jar-plugin.version>3.1.1</maven-jar-plugin.version> in property tag

    problem resolve

    https://medium.com/@saannjaay/unknown-error-in-pom-xml-66fb2414991b

    0 讨论(0)
  • 2020-12-02 07:13

    whenever you facing this type of error simply change the Release version just like In my case it is showing Error in 2.2.7 I changed to 2.2.6

    Problem:

    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>2.2.7.RELEASE</version>
    

    Solution:

    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>2.2.6.RELEASE</version>
    
    0 讨论(0)
  • 2020-12-02 07:15

    There is a bug about Eclipse and spring-boot-starter-parent 2.1.5

    "if the maven packaging attribute is war then no problem.The problem is in jar type." So you can also fix this problem by changing packaging type.

    <packaging>war</packaging>
    
    0 讨论(0)
  • 2020-12-02 07:17

    I was getting same error in Version 3. It worked after upgrading STS to latest version: 4.5.1.RELEASE. No change in code or configuration in latest STS was required.

    0 讨论(0)
提交回复
热议问题