Non-resolvable parent POM

di il
2 risposte

Non-resolvable parent POM

Ho crato un progetto con Spring-Boot con Netbeans (jdk 17)

Quando arrivo a fare la “Build”, ricevo il seguente messaggio d'errore:

Non-resolvable parent POM for com.paolo:demo:0.0.1-SNAPSHOT: The following artifacts could not be resolved: org.springframework.boot:spring-boot-starter-parent:pom:3.2.5.RELEASE (absent): org.springframework.boot:spring-boot-starter-parent:pom:3.2.5.RELEASE was not found in https://repository.apache.org/content/groups/public/ during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of repository-apache-org has elapsed or updates are forced and 'parent.relativePath' points at no local POM @ line 5, column 10

L'errore si troverebbe nel file pom.xml alla riga 5, colonna 10, ecco il mio file pom.xml:

<?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>3.2.5.RELEASE</version>
               <relativePath/><!-- lookup parent from repository -->
    </parent>
    <groupId>com.paolo</groupId>
    <artifactId>demo</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <packaging>war</packaging>
    <name>myspring</name>
    <description>Demo project for Spring Boot</description>
    <properties>
        <java.version>17</java.version>
    </properties>
    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-jpa</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-thymeleaf</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
          <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-devtools</artifactId>
            <scope>runtime</scope>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>com.mysql</groupId>
            <artifactId>mysql-connector-j</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-tomcat</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

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

</project>

      Propio non capisco, sono un neofita.

2 Risposte

  • Re: Non-resolvable parent POM

    21/04/2024 - starcris ha scritto:


    org.springframework.boot:spring-boot-starter-parent:pom:3.2.5.RELEASE was not found in https://repository.apache.org/content/groups/public/ during a previous attempt.

    Il problema è abbastanza semplice: sta cercando gli artifact di Spring Boot nel repository della ASF (Apache Software Foundation) che ovviamente non contiene nulla relativo a Spring (lì ci sono solo gli artifact dei progetti ASF e dipendenze varie).

    In pratica non sta usando il repository Maven Central (che è quello che si usa normalmente in modo predefinito).

    Quindi: verifica come Maven è configurato in NetBeans (dato che NetBeans è attualmente proprio della ASF … sta usando solo il “suo” repo) e verifica se/cosa hai nel file ~/.m2/settings.xml (il “~” indica la “home” della tua utenza sul pc).

  • Re: Non-resolvable parent POM

    Ecco il settings.xml dentro /home/paolo/.m2

    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <settings xmlns="http://maven.apache.org/SETTINGS/1.2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.2.0 http://maven.apache.org/xsd/settings-1.2.0.xsd">
     <profiles>
       <profile>
         <id>repository-apache-org</id>
         <repositories>
           <repository>
             <id>repository-apache-org</id>
             <name>Apache Repository</name>
             <url>https://repository.apache.org/content/groups/public/</url>
             <releases>
               <enabled>true</enabled>
               <updatePolicy>never</updatePolicy>
             </releases>
             <snapshots>
               <enabled>false</enabled>
               <updatePolicy>daily</updatePolicy>
             </snapshots>
           </repository>
         </repositories>
         <pluginRepositories>
           <pluginRepository>
             <id>repository-apache-org</id>
             <name>Apache Repository</name>
             <url>https://repository.apache.org/content/groups/public/</url>
             <releases>
               <enabled>true</enabled>
               <updatePolicy>never</updatePolicy>
             </releases>
             <snapshots>
               <enabled>false</enabled>
               <updatePolicy>daily</updatePolicy>
             </snapshots>
           </pluginRepository>
         </pluginRepositories>
       </profile>
     </profiles>
     <activeProfiles>

    Ecco invece la configurazione in NetBeans  Option > Java > Maven

    https://repo.maven.apache.org/maven2/allow
    https://repository.apache.org/content/groups/public/allow

    Cosa devo modificare?

    Grazie tante in anticipo…. almeno ora so dove investigare….

Devi accedere o registrarti per scrivere nel forum
2 risposte