Deployed jar get java.lang.ClassNotFoundException: org.apache.pdfbox.pdmodel.PDDocument

24 Views Asked by At

I have a spring boot application that uses external jars present in a folder at the same level as the src folder, when I launch the application everything works, but when I create the jar ( maven clean compile package ) and launch it from another system

java -jar application.jar

I get this error

java.lang.ClassNotFoundException: org.apache.pdfbox.pdmodel.PDDocument

this is a part of my pom

<dependency>
            <groupId>org.digidoc4j.dss</groupId>
            <artifactId>dss-pades-pdfbox</artifactId>
            <version>5.11.1.d4j.1</version>
        </dependency>

        <dependency>
            <groupId>org.apache.pdfbox</groupId>
            <artifactId>pdfbox-xmpbox</artifactId>
            <version>2.0.29</version>
            <systemPath>${project.basedir}/libs/xmpbox-2.0.29.jar</systemPath>
            <scope>system</scope>
            <type>jar</type>
        </dependency>
        <dependency>
            <groupId>org.apache.pdfbox</groupId>
            <artifactId>pdfbox-tools</artifactId>
            <version>2.0.29</version>
            <systemPath>${project.basedir}/libs/pdfbox-tools-2.0.29.jar</systemPath>
            <scope>system</scope>
            <type>jar</type>
        </dependency>
        <dependency>
            <groupId>org.apache.pdfbox</groupId>
            <artifactId>pdfbox-examples</artifactId>
            <version>2.0.29</version>
            <systemPath>${project.basedir}/libs/pdfbox-examples-2.0.29.jar</systemPath>
            <scope>system</scope>
            <type>jar</type>
        </dependency>
        <dependency>
            <groupId>org.apache.pdfbox</groupId>
            <artifactId>pdfbox</artifactId>
            <version>2.0.29</version>
            <systemPath>${project.basedir}/libs/pdfbox-2.0.29.jar</systemPath>
            <scope>system</scope>
            <type>jar</type>
        </dependency>
        <dependency>
            <groupId>org.apache.pdfbox</groupId>
            <artifactId>fontbox</artifactId>
            <version>2.0.29</version>
            <systemPath>${project.basedir}/libs/fontbox-2.0.29.jar</systemPath>
            <scope>system</scope>
            <type>jar</type>
        </dependency>
        <dependency>
            <groupId>org.apache.pdfbox</groupId>
            <artifactId>commons-logging</artifactId>
            <version>1.2</version>
            <systemPath>${project.basedir}/libs/commons-logging-1.2.jar</systemPath>
            <scope>system</scope>
            <type>jar</type>
        </dependency>
0

There are 0 best solutions below