简体   繁体   中英

Generated Spring pom.xml causes error "Error while fetching http://maven.apache.org/POM/4.0.0"

(I am aware that there are similar questions - but having tried the solutions to them I am still stuck)

I am trying to use the Demo project from Spring and cannot get the generated pom.xml to work under IntelliJ, I tried the solution suggested by IntelliJ to resolve URI is not registered - but this simply causes the titular error.

At first I believed this to be a network error, but upon loading the webpage in a browser it 404s. This leads me to believe it is an issue with my project setup in some way.

I imported the project by opening the pom.xml in IntelliJ and then clicking 'Open as Project'.

My pom.xml is as follows:

<?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.3.5.RELEASE</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>
    <groupId>prs.ttg.spring</groupId>
    <artifactId>test</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <name>test</name>
    <description>Test project for Spring Boot</description>

    <properties>
        <java.version>15</java.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>org.junit.vintage</groupId>
                    <artifactId>junit-vintage-engine</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>

</project>

None of the dependencies get loaded and I cannot for the life of me find a working solution to this.

I appreciate help, and understand if this is just a stupid question - I'm a stupid person

Make sure you have Maven bundled plugin enabled in Preferences |Plugins. If you are behind proxy - set up proxy settings in IDE: https://www.jetbrains.com/help/idea/settings-http-proxy.html

If you have Maven plugin enabled open project via File |New | Project from Existing Sources and select pom.xml file to import project from.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM