0

I am trying to import a pom.xml file to my project and when I am running the command mvn clean install, I am getting the following error on the command prompt ==> Failed to collect dependencies at org.apache.poi:poi-scratchpad:jar:3.9: Failed to read artifact descriptor for org.apache.poi:poi-scratchpad:jar:3.9: Could not transfer artifact org.apache.poi:poi-scratchpad:pom:3.9 from/to central (https://repo.maven.apache.org/maven2): Transfer failed for https://repo.maven.apache.org/maven2/org/apache/poi/poi-scratchpad/3.9/poi-scratchpad-3.9.pom: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target -> [Help 1]

The contents of the imported pom.xml file

**

4.0.0

<groupId>Ecommerce_Practise</groupId>
<artifactId>Ecommerce_Practise</artifactId>
<version>0.0.1-SNAPSHOT</version>

<name>Ecommerce_Practise</name>
<!-- FIXME change it to the project's website -->
<url>http://www.example.com</url>

<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <maven.compiler.source>1.8</maven.compiler.source>
    <maven.compiler.target>1.8</maven.compiler.target>
    <aspectj.version>1.9.5</aspectj.version>

</properties>

<dependencies>


    <dependency>
        <groupId>org.seleniumhq.selenium</groupId>
        <artifactId>selenium-java</artifactId>
        <version>3.141.59</version>
    </dependency>

    <dependency>
        <groupId>io.github.bonigarcia</groupId>
        <artifactId>webdrivermanager</artifactId>
        <version>4.3.1</version>
    </dependency>

    <!-- https://mvnrepository.com/artifact/org.testng/testng -->
    <dependency>
        <groupId>org.testng</groupId>
        <artifactId>testng</artifactId>
        <version>6.14.3</version>
    </dependency>


    <dependency>
        <groupId>org.apache.poi</groupId>
        <artifactId>poi</artifactId>
        <version>3.9</version>
    </dependency>
    <dependency>
        <groupId>org.apache.poi</groupId>
        <artifactId>poi-ooxml</artifactId>
        <version>3.9</version>
    </dependency>
    <dependency>
        <groupId>org.apache.poi</groupId>
        <artifactId>poi-ooxml-schemas</artifactId>
        <version>3.9</version>
    </dependency>
    <dependency>
        <groupId>org.apache.poi</groupId>
        <artifactId>poi-scratchpad</artifactId>
        <version>3.9</version>
    </dependency>
    <dependency>
        <groupId>org.apache.poi</groupId>
        <artifactId>ooxml-schemas</artifactId>
        <version>1.1</version>
    </dependency>

    <dependency>
        <groupId>org.apache.poi</groupId>
        <artifactId>openxml4j</artifactId>
        <version>1.0-beta</version>
    </dependency>

    <dependency>
        <groupId>com.aventstack</groupId>
        <artifactId>extentreports</artifactId>
        <version>3.1.5</version>
    </dependency>

    <dependency>
        <groupId>io.qameta.allure</groupId>
        <artifactId>allure-testng</artifactId>
        <version>2.12.0</version>
    </dependency>

    <dependency>
        <groupId>javax.xml.bind</groupId>
        <artifactId>jaxb-api</artifactId>
        <version>2.3.1</version>
    </dependency>


</dependencies>

<build>

    <plugins>


        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.8.1</version>
            <configuration>
                <source>1.8</source>
                <target>1.8</target>
            </configuration>
        </plugin>


        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>2.20</version>

            <configuration>
                <forkCount>3</forkCount>
                <reuseForks>true</reuseForks>
                <argLine>-Xmx1024m -XX:MaxPermSize=256m</argLine>
                <suiteXmlFiles>
                    <suiteXmlFile>src/test/resources/testrunners/testng_regression.xml</suiteXmlFile>
                </suiteXmlFiles>
                
                <argLine>
                    -javaagent:"${settings.localRepository}/org/aspectj/aspectjweaver/${aspectj.version}/aspectjweaver-${aspectj.version}.jar"
                </argLine>

            </configuration>
            
            <dependencies>
                <dependency>
                    <groupId>org.aspectj</groupId>
                    <artifactId>aspectjweaver</artifactId>
                    <version>${aspectj.version}</version>
                </dependency>
            </dependencies>

        </plugin>
    </plugins>



</build>

**

Bimlesh
  • 269
  • 2
  • 9
  • 20
  • 1
    The main problem is `PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target`. So you have a problem with the `cacerts` of your `JVM`. What java version is used? Because most java `HTTPS` connection problems can be fixed by updating the `JVM`. – Axel Richter Mar 09 '21 at 07:30
  • This is my java version – Bimlesh Mar 09 '21 at 07:55
  • java version "1.8.0_281" Java(TM) SE Runtime Environment (build 1.8.0_281-b09) Java HotSpot(TM) 64-Bit Server VM (build 25.281-b09, mixed mode) – Bimlesh Mar 09 '21 at 07:56
  • That looks actual enough. Sure you are using that `JVM` and not a much older one linked to some `IDE`? – Axel Richter Mar 09 '21 at 08:10
  • Yes using this version of JVM and not using any older version. How do I fix this issue? – Bimlesh Mar 09 '21 at 08:17
  • https://stackoverflow.com/questions/21076179/pkix-path-building-failed-and-unable-to-find-valid-certification-path-to-requ – Axel Richter Mar 09 '21 at 08:24
  • [Apache POI 3.9 dates from 2012, and is almost 10 years old](http://poi.apache.org/devel/history/changes-3x.html#3.9) - why are you using such an old version? – Gagravarr Mar 09 '21 at 12:17

0 Answers0