Introduction
Another article where the main focus is just to solve an error message appear. The following is the output of the command for building, compiling and running a Java program using maven tool. The maven tool is internally integrated with NetBeans IDE. The following is the output of the command execution :
Downloaded: https://repo.maven.apache.org/maven2/com/unboundid/unboundid-ldapsdk/4.0.10/unboundid-ldapsdk-4.0.10.pom (4 KB at 7.5 KB/sec) ------------------------------------------------------------------------ BUILD FAILURE ------------------------------------------------------------------------ Total time: 15:40.953s Finished at: Tue Feb 15 14:58:16 ICT 2022 Final Memory: 15M/82M ------------------------------------------------------------------------ Failed to execute goal on project apps: Could not resolve dependencies for project com.github.adminfaces:apps:war:0.1-SNAPSHOT: Failed to collect dependencies for [javax:javaee-api:jar:7.0 (provided), com.github.adminfaces:admin-template:jar:1.0.0-RC21 (compile), com.github.adminfaces:admin-theme:jar:1.0.0-RC21 (compile), org.primefaces:primefaces:jar:7.0.RC2 (compile), commons-io:commons-io:jar:2.6 (compile), commons-fileupload:commons-fileupload:jar:1.3 (compile), org.mybatis.spring.boot:mybatis-spring-boot-starter:jar:2.0.1 (compile), org.mybatis:mybatis:jar:3.4.6 (compile), org.mybatis:mybatis-cdi:jar:1.1.0 (compile), net.bootsfaces:bootsfaces:jar:1.4.2 (compile), javax.servlet:jstl:jar:1.2 (compile), net.sf.jasperreports:jasperreports:jar:6.9.0 (compile), org.apache.poi:poi:jar:3.15 (compile), org.apache.poi:poi-ooxml:jar:3.15 (compile), org.jboss.weld:weld-core:jar:2.1.0.Final (compile), org.postgresql:postgresql:jar:42.2.15 (compile), mysql:mysql-connector-java:jar:5.1.6 (compile), com.microsoft.sqlserver:mssql-jdbc:jar:8.4.1.jre8 (compile), org.mariadb.jdbc:mariadb-java-client:jar:2.1.2 (compile), org.keycloak:keycloak-core:jar:12.0.2 (compile), org.springframework.boot:spring-boot-starter-data-ldap:jar:2.3.3.RELEASE (compile), com.unboundid:unboundid-ldapsdk:jar:4.0.10 (compile)]: Failed to read artifact descriptor for com.lowagie:itext:jar:2.1.7.js6: Could not transfer artifact com.lowagie:itext:pom:2.1.7.js6 from/to jaspersoft-third-party (http://jaspersoft.jfrog.io/jaspersoft/third-party-ce-artifacts/): Failed to transfer file: http://jaspersoft.jfrog.io/jaspersoft/third-party-ce-artifacts/com/lowagie/itext/2.1.7.js6/itext-2.1.7.js6.pom. Return code is: 308 , ReasonPhrase:Permanent Redirect. -> [Help 1], To see the full stack trace of the errors, re-run Maven with the -e switch. Re-run Maven using the -X switch to enable full debug logging.
Solution
Actually, after going after through googling in using the keyword, there is an article showing the solution. It is exist in this link where the focus is in the failure for downloading. In this case, there are several ways for solving the failure for downloading the ‘http://jaspersoft.jfrog.io/jaspersoft/third-party-ce-artifacts/com/lowagie/itext/2.1.7.js6/itext-2.1.7.js6.pom’. The following are several of the ways to solve it :
-
The first way is just to change the repository for downloading the package. In this case, it is itext-2.1.7.js6.pom’. Change it from ‘http’ to ‘https’.
-
The second one is by having another version of the package. In this context, just search the package whether it has another different version available for downloading. The following is the package definition :
<dependency> <groupId>com.lowagie</groupId> <artifactId>itext</artifactId> <version>2.1.7</version> </dependency>
<dependency> <groupId>com.lowagie</groupId> <artifactId>itext</artifactId> <version>2.1.7.js2</version> </dependency>
<dependency> <groupId>com.lowagie</groupId> <artifactId>itext</artifactId> <version>2.1.7.js4</version> </dependency>
<dependency> <groupId>com.lowagie</groupId> <artifactId>itext</artifactId> <version>2.1.7.js8</version> </dependency>
In other words, just search it the maven repository where it exist in this link.
-
Another way is just by excluding the package. It exist as in the article exist in this link. So, after failing to include the package just exclude it. The package which need that package is the jasperreports
<dependency> <groupId>net.sf.jasperreports</groupId> <artifactId>jasperreports</artifactId> <version>6.9.0</version> <exclusions> <exclusion> <groupId>com.lowagie</groupId> <artifactId>itext</artifactId> </exclusion> </exclusions> </dependency>
One thought on “How to Solve Error Message Return code is: 308 , ReasonPhrase:Permanent Redirect. when building Java Program using maven in NetBeans”