Search code examples
javaspringmavenprimefacespom.xml

Could not resolve dependencies for project: primefaces and modelmapper


I try to import my project on another computer, but when I try to build the project with maven, I get these errors.

[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  4.247 s
[INFO] Finished at: 2022-02-20T10:27:33-06:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project serpienteemplumada: Could not resolve dependencies for project com.serpienteemplumada:serpienteemplumada:war:0.0.1-SNAPSHOT: The following artifacts could not be resolved: org.primefaces:primefaces:jar:10.0.0, org.primefaces.extensions:primefaces-extensions:jar:10.0.2, org.modelmapper:modelmapper:jar:2.3.5: Could not transfer artifact org.primefaces:primefaces:jar:10.0.0 from/to spring-plugins (https://repo.spring.io/plugins-release/): Access denied to https://repo.spring.io/plugins-release/org/primefaces/primefaces/10.0.0/primefaces-10.0.0.jar. Error code 401, Unauthorized -> [Help 1]
[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/DependencyResolutionException

I've already tried all the methods I found on the internet, maven:clean, update and install; put the repositories at the beginning, work from another IDE, but still, the error persists in those two dependencies.

Here is my Pom.xml file

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
         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.5.2</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>
    <groupId>com.serpienteemplumada</groupId>
    <artifactId>serpienteemplumada</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <packaging>war</packaging>
    <name>serpienteemplumada</name>
    <description>MarketPlace Serpiente Emplumada</description>
    <properties>
        <java.version>11</java.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <start-class>com.SerpienteemplumadaApplication</start-class>
    </properties>
    
    <repositories>
        <repository>
            <id>prime-repo</id>
            <name>PrimeFaces Maven Repository</name>
            <url>http://repository.primefaces.org</url>
            <layout>default</layout>
        </repository>

        <repository>
            <id>spring-plugins</id>
            <name>Spring Plugins Repository</name>
            <url>https://repo.spring.io/plugins-release/</url>
            <layout>default</layout>
        </repository>

        <repository>
            <id>central</id>
            <name>central</name>
            <url>http://repo1.maven.org/maven2/</url>
        </repository>

        <repository>
            <id>ICM</id>
            <name>ICM</name>
            <url>http://maven.icm.edu.pl/artifactory/repo/</url>
        </repository>
    </repositories>
    
    <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-web</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-security</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-devtools</artifactId>
            <scope>runtime</scope>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <scope>runtime</scope>
        </dependency>
        <!-- https://mvnrepository.com/artifact/org.primefaces/primefaces -->
        <dependency>
            <groupId>org.primefaces</groupId>
            <artifactId>primefaces</artifactId>
            <version>10.0.0</version>
        </dependency>
        <!-- https://mvnrepository.com/artifact/org.primefaces.extensions/primefaces-extensions -->
        <dependency>
            <groupId>org.primefaces.extensions</groupId>
            <artifactId>primefaces-extensions</artifactId>
            <version>10.0.2</version>
        </dependency>
        <dependency>
            <groupId>org.primefaces.themes</groupId>
            <artifactId>all-themes</artifactId>
            <version>1.0.10</version>
        </dependency>
        <dependency>
            <groupId>com.sun.faces</groupId>
            <artifactId>jsf-api</artifactId>
            <version>2.2.20</version>
        </dependency>
        <dependency>
            <groupId>com.sun.faces</groupId>
            <artifactId>jsf-impl</artifactId>
            <version>2.2.20</version>
        </dependency>
        <dependency>
            <groupId>org.apache.tomcat.embed</groupId>
            <artifactId>tomcat-embed-jasper</artifactId>
        </dependency>
        <dependency>
            <groupId>org.glassfish</groupId>
            <artifactId>javax.el</artifactId>
            <version>3.0.0</version>
        </dependency>

        <dependency>
            <groupId>javax.enterprise</groupId>
            <artifactId>cdi-api</artifactId>
            <version>2.0.SP1</version>
        </dependency>




<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-lang3 -->
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
        </dependency>


        <dependency>
            <groupId>org.modelmapper</groupId>
            <artifactId>modelmapper</artifactId>
            <version>2.3.5</version>
        </dependency>

        <dependency>
            <groupId>org.imgscalr</groupId>
            <artifactId>imgscalr-lib</artifactId>
            <version>4.2</version>
        </dependency>



    </dependencies>
    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>repackage</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

</project>

thx to read.


Solution

  • I finally can...

    I had to read those dependencies for project with conflicts, then I download manually, for a weird reason my project cannot access to PrimeFace repository

    Problems and issues

    If org.primefaces.themes fail I just download those files from here:

    https://search.maven.org/search?q=g:org.primefaces

    then I had to join with my maven2 folder

    /Users/$user/.m2/repository/org

    Also, I changed the versions of the dependencies.