Hallo zusammen,
ich habe ein Programm geschrieben welches als Libary Apache PDFBox verwendet, das Programm lässt sich in Netbeans ausführen und tut was es soll.
Erzeuge ich mit mvn package das Programm, es lässt sich starten aber wirft eine Exception:
Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: org/apache/pdfbox/Loader
Das sagt mir das die Bibliothek fehlt.
Wie bekomme ich die Bibliothek mit rein?
POM:
Vielen Dank
Grüße
Moritz
ich habe ein Programm geschrieben welches als Libary Apache PDFBox verwendet, das Programm lässt sich in Netbeans ausführen und tut was es soll.
Erzeuge ich mit mvn package das Programm, es lässt sich starten aber wirft eine Exception:
Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: org/apache/pdfbox/Loader
Das sagt mir das die Bibliothek fehlt.
Wie bekomme ich die Bibliothek mit rein?
POM:
XML:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.ritzmo</groupId>
<artifactId>PDFViewer</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<dependencies>
<dependency>
<groupId>org.apache.pdfbox</groupId>
<artifactId>pdfbox</artifactId>
<version>3.0.2</version>
<type>jar</type>
</dependency>
</dependencies>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<exec.mainClass>eu.ritzmo.pdfviewer.PDFViewer</exec.mainClass>
</properties>
<build>
<plugins>
<plugin>
<!-- Build an executable JAR -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.3.0</version>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<classpathPrefix>lib/</classpathPrefix>
<mainClass>eu.ritzmo.pdfviewer.PDFViewer</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
</plugins>
</build>
</project>
Vielen Dank
Grüße
Moritz