How to Solve Error Message Failed to collect dependencies at org.primefaces:primefaces:jar:7.0.RC2: Failed to read artifact descriptor for org.primefaces:primefaces:jar:7.0.RC2: Could not transfer artifact org.primefaces:primefaces:pom:7.0.RC2 from/to maven-default-http-blocker (http://0.0.0.0/): Blocked mirror for repositories: [prime-repo (http://repository.primefaces.org, default, releases+snapshots)] -> [Help 1] when Compiling and Building Java Project

Posted on

Introduction

This article is showing how to solve an error message when compiling and building a Java project. In this context, the process for compiling and building the Java project is in a Java IDE. In this context, it is using NetBeans IDE. Furthermore, it is using a maven builder in order to compile and build the Java project. But unfortunately the process for compiling and building the Java project end in a failure. The failure for compiling and building the Java project trigger the appearance of a certain error message. The error message exist as follows :

Failed to execute goal on project myproject: Could not resolve dependencies for project com.github.adminfaces:myproject:war:0.1-SNAPSHOT: Failed to collect dependencies at org.primefaces:primefaces:jar:7.0.RC2: Failed to read artifact descriptor for org.primefaces:primefaces:jar:7.0.RC2: Could not transfer artifact org.primefaces:primefaces:pom:7.0.RC2 from/to maven-default-http-blocker (http://0.0.0.0/): Blocked mirror for repositories: [prime-repo (http://repository.primefaces.org, default, releases+snapshots)] -> [Help 1]

How to Solve Error Message Blocked mirror for repositories

So, the solution for solving the problem is very easy actually. It is because of the declaration or the definition of the repository. So, the following is the step for solving the problem :

  1. First of all, just check the ‘pom.xml’ file. Actually below exist the part of the content in the ‘pom.xml’ file which is triggering the error message :

    <repositories>
    <repository>
    <snapshots />
    <id>snapshots</id>
    <name>libs-snapshot</name>
    <url>https://oss.sonatype.org/content/repositories/snapshots</url>
    </repository>
    <repository>
    <id>prime-repo</id>
    <name>PrimeFaces Maven Repository</name>
    <url>http://repository.primefaces.org</url>
    <layout>default</layout>
    </repository>
    </repositories>
  2. Just revise the URL part. It should be ‘https’ instead of ‘http’. So, revise that line as follows :

    <url>https://repository.primefaces.org</url>
    

    So, the ‘pom.xml’ for that part will be exist as below :

    <repositories>
    <repository>
    <snapshots />
    <id>snapshots</id>
    <name>libs-snapshot</name>
    <url>https://oss.sonatype.org/content/repositories/snapshots</url>
    </repository>
    <repository>
    <id>prime-repo</id>
    <name>PrimeFaces Maven Repository</name>
    <url>https://repository.primefaces.org</url>
    <layout>default</layout>
    </repository>
    </repositories>
  3. After editing the ‘pom.xml’ file and save the revision for the’pom.xml’ file, just run the execution for compiling and building the Java project once more. If there are no more error appears, the process for compiling and building the Java project will be a success.

Leave a Reply