kreuzberg
Used in:
components
- OverviewOverview
- VersionsVersions
- DependentsDependents
- DependenciesDependencies
<dependency>
<groupId>dev.kreuzberg</groupId>
<artifactId>kreuzberg</artifactId>
<version>4.0.0-rc.21</version>
</dependency><?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>dev.kreuzberg</groupId>
<artifactId>kreuzberg</artifactId>
<version>4.0.0-rc.21</version>
<packaging>jar</packaging>
<name>Kreuzberg Java</name>
<description>Java bindings for Kreuzberg document intelligence library</description>
<url>https://kreuzberg.dev</url>
<licenses>
<license>
<name>MIT License</name>
<url>https://opensource.org/licenses/MIT</url>
</license>
</licenses>
<developers>
<developer>
<name>Na'aman Hirschfeld</name>
<email>nhirschfeld@gmail.com</email>
</developer>
</developers>
<scm>
<connection>scm:git:git://github.com/kreuzberg-dev/kreuzberg.git</connection>
<developerConnection>scm:git:ssh://github.com:kreuzberg-dev/kreuzberg.git</developerConnection>
<url>https://github.com/kreuzberg-dev/kreuzberg</url>
</scm>
<distributionManagement>
<repository>
<id>ossrh</id>
<name>Central Repository OSSRH</name>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
</distributionManagement>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.release>25</maven.compiler.release>
<junit.version>5.11.4</junit.version>
<maven.version>3.9.11</maven.version>
<maven-compiler-plugin.version>3.14.1</maven-compiler-plugin.version>
<maven-surefire-plugin.version>3.5.4</maven-surefire-plugin.version>
<maven-resources-plugin.version>3.4.0</maven-resources-plugin.version>
<maven-clean-plugin.version>3.5.0</maven-clean-plugin.version>
<maven-jar-plugin.version>3.5.0</maven-jar-plugin.version>
<maven-install-plugin.version>3.1.4</maven-install-plugin.version>
<maven-deploy-plugin.version>3.1.4</maven-deploy-plugin.version>
<maven-site-plugin.version>4.0.0-M16</maven-site-plugin.version> <!-- Pinned to v3, do not upgrade to v4 -->
<maven-checkstyle-plugin.version>3.6.0</maven-checkstyle-plugin.version>
<maven-pmd-plugin.version>3.28.0</maven-pmd-plugin.version>
<versions-maven-plugin.version>2.20.1</versions-maven-plugin.version>
<exec-maven-plugin.version>3.6.2</exec-maven-plugin.version>
<build-helper-maven-plugin.version>3.6.1</build-helper-maven-plugin.version>
<checkstyle.version>12.3.0</checkstyle.version>
<pmd.version>7.19.0</pmd.version>
<maven-source-plugin.version>3.4.0</maven-source-plugin.version>
<maven-javadoc-plugin.version>3.12.0</maven-javadoc-plugin.version>
<maven-gpg-plugin.version>3.2.8</maven-gpg-plugin.version>
<jacoco-maven-plugin.version>0.8.14</jacoco-maven-plugin.version>
<central-publishing-plugin.version>0.9.0</central-publishing-plugin.version>
</properties>
<dependencies>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.20.1</version>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>6.1.0-M1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>4.0.0-M1</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<pluginManagement>
<plugins>
<!-- Lock versions for default binding plugins -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
<version>${maven-clean-plugin.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>${maven-resources-plugin.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>${maven-jar-plugin.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
<version>${maven-install-plugin.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>${maven-deploy-plugin.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>${maven-site-plugin.version}</version>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<!-- Maven Compiler Plugin -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven-compiler-plugin.version}</version>
<configuration>
<release>25</release>
<compilerArgs>
<arg>--enable-preview</arg>
</compilerArgs>
<!-- Exclude Tika benchmark script (has external dependencies) -->
<excludes>
<exclude>**/TikaExtract.java</exclude>
</excludes>
<testExcludes>
<testExclude>**/TikaExtract.java</testExclude>
</testExcludes>
</configuration>
</plugin>
<!-- Maven Enforcer Plugin to enforce Maven version -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>3.6.2</version>
<executions>
<execution>
<id>enforce-maven</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<requireMavenVersion>
<version>${maven.version}</version>
</requireMavenVersion>
</rules>
</configuration>
</execution>
</executions>
</plugin>
<!-- Maven Surefire Plugin for running tests -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven-surefire-plugin.version}</version>
<configuration>
<argLine>@{argLine} -XX:-ClassUnloading -XX:-ClassUnloadingWithConcurrentMark --enable-native-access=ALL-UNNAMED --enable-preview -Djava.library.path=${project.basedir}/../../target/release</argLine>
<forkedProcessTimeoutInSeconds>300</forkedProcessTimeoutInSeconds>
<skipAfterFailureCount>1</skipAfterFailureCount>
</configuration>
</plugin>
<!-- Checkstyle Plugin for code style checks -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>${maven-checkstyle-plugin.version}</version>
<dependencies>
<dependency>
<groupId>com.puppycrawl.tools</groupId>
<artifactId>checkstyle</artifactId>
<version>${checkstyle.version}</version>
</dependency>
</dependencies>
<configuration>
<configLocation>${project.basedir}/checkstyle.xml</configLocation>
<consoleOutput>true</consoleOutput>
<failsOnError>true</failsOnError>
<violationSeverity>warning</violationSeverity>
<propertyExpansion>config_loc=${project.basedir}</propertyExpansion>
</configuration>
<executions>
<execution>
<id>checkstyle</id>
<phase>validate</phase>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- PMD Plugin for code quality checks -->
<!-- NOTE: targetJdk pinned to 21 to align with project toolchain -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
<version>${maven-pmd-plugin.version}</version>
<configuration>
<targetJdk>21</targetJdk>
<typeResolution>false</typeResolution>
<rulesets>
<ruleset>/rulesets/java/quickstart.xml</ruleset>
</rulesets>
<printFailingErrors>true</printFailingErrors>
</configuration>
<executions>
<execution>
<id>pmd</id>
<phase>validate</phase>
<goals>
<goal>check</goal>
<goal>cpd-check</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- Versions Plugin for dependency management -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>versions-maven-plugin</artifactId>
<version>${versions-maven-plugin.version}</version>
<configuration>
<generateBackupPoms>false</generateBackupPoms>
<rulesUri>file://${project.basedir}/versions-rules.xml</rulesUri>
</configuration>
</plugin>
<!-- Maven Source Plugin for attaching sources -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>${maven-source-plugin.version}</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- Maven Javadoc Plugin for attaching javadocs -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>${maven-javadoc-plugin.version}</version>
<configuration>
<doclint>all,-missing</doclint>
<show>protected</show>
<additionalOptions>--enable-preview</additionalOptions>
<!-- Only include main source directory, exclude benchmark scripts -->
<sourcepath>${project.basedir}/src/main/java</sourcepath>
</configuration>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- Maven GPG Plugin for signing artifacts -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>${maven-gpg-plugin.version}</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
<configuration>
<gpgArguments>
<arg>--batch</arg>
<arg>--yes</arg>
<arg>--pinentry-mode=loopback</arg>
</gpgArguments>
</configuration>
</execution>
</executions>
</plugin>
<!-- Sonatype Central Publishing plugin -->
<plugin>
<groupId>org.sonatype.central</groupId>
<artifactId>central-publishing-maven-plugin</artifactId>
<version>${central-publishing-plugin.version}</version>
<extensions>true</extensions>
<configuration>
<publishingServerId>ossrh</publishingServerId>
<autoPublish>true</autoPublish>
<waitUntil>published</waitUntil>
<waitMaxTime>7200</waitMaxTime>
</configuration>
</plugin>
<!-- Spotless Plugin for code formatting (google-java-format) -->
<!-- NOTE: Spotless currently skipped; rely on checkstyle:check + pmd:check -->
<plugin>
<groupId>com.diffplug.spotless</groupId>
<artifactId>spotless-maven-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<skip>true</skip>
<java>
<googleJavaFormat>
<version>1.18.1</version>
<style>GOOGLE</style>
</googleJavaFormat>
</java>
</configuration>
</plugin>
<!-- JaCoCo Maven Plugin for code coverage -->
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${jacoco-maven-plugin.version}</version>
<configuration>
<excludes>
<exclude>java/**/*</exclude>
<exclude>sun/**/*</exclude>
<exclude>jdk/**/*</exclude>
</excludes>
</configuration>
<executions>
<execution>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>report</id>
<phase>test</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
<resources>
<resource>
<directory>src/main/resources</directory>
</resource>
</resources>
</build>
<profiles>
<profile>
<id>benchmark-helper</id>
<activation>
<property>
<name>benchmarkHelper</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>${build-helper-maven-plugin.version}</version>
<executions>
<execution>
<id>add-benchmark-helper-source</id>
<phase>generate-sources</phase>
<goals>
<goal>add-test-source</goal>
</goals>
<configuration>
<sources>
<source>${project.basedir}/../../tools/benchmark-harness/scripts</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>build-native</id>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>${exec-maven-plugin.version}</version>
<executions>
<execution>
<id>build-rust-ffi</id>
<phase>generate-sources</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>cargo</executable>
<workingDirectory>${project.basedir}/../../</workingDirectory>
<arguments>
<argument>build</argument>
<argument>--release</argument>
<argument>-p</argument>
<argument>kreuzberg-ffi</argument>
</arguments>
</configuration>
</execution>
<execution>
<id>copy-native-libraries</id>
<phase>generate-sources</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>bash</executable>
<arguments>
<argument>-c</argument>
<argument>
set -e
UNAME_S=$(uname -s)
UNAME_M=$(uname -m)
if [[ "$UNAME_S" == "Darwin" ]]; then
OS="macos"
elif [[ "$UNAME_S" == "Linux" ]]; then
OS="linux"
elif [[ "$UNAME_S" == MINGW* ]] || [[ "$UNAME_S" == MSYS* ]]; then
OS="windows"
else
OS="linux"
fi
if [[ "$UNAME_M" == "aarch64" ]] || [[ "$UNAME_M" == "arm64" ]]; then
ARCH="arm64"
elif [[ "$UNAME_M" == "x86_64" ]] || [[ "$UNAME_M" == "amd64" ]]; then
ARCH="x86_64"
else
ARCH="$UNAME_M"
fi
RID="${OS}-${ARCH}"
NATIVES_DIR="${project.basedir}/src/main/resources/natives/$RID"
SOURCE_DIR="${project.basedir}/../../target/release"
mkdir -p "$NATIVES_DIR"
# Copy native libraries based on OS
if [[ "$OS" == "macos" ]]; then
cp "$SOURCE_DIR"/libkreuzberg_ffi.dylib "$NATIVES_DIR"/ 2>/dev/null || echo "Warning: libkreuzberg_ffi.dylib not found"
cp "$SOURCE_DIR"/libpdfium.dylib "$NATIVES_DIR"/ 2>/dev/null || echo "Warning: libpdfium.dylib not found"
cp "$SOURCE_DIR"/libonnxruntime*.dylib "$NATIVES_DIR"/ 2>/dev/null || echo "Warning: libonnxruntime libraries not found"
elif [[ "$OS" == "linux" ]]; then
cp "$SOURCE_DIR"/libkreuzberg_ffi.so "$NATIVES_DIR"/ 2>/dev/null || echo "Warning: libkreuzberg_ffi.so not found"
cp "$SOURCE_DIR"/libpdfium.so* "$NATIVES_DIR"/ 2>/dev/null || echo "Warning: libpdfium.so not found"
cp "$SOURCE_DIR"/libonnxruntime.so* "$NATIVES_DIR"/ 2>/dev/null || echo "Warning: libonnxruntime libraries not found"
elif [[ "$OS" == "windows" ]]; then
cp "$SOURCE_DIR"/kreuzberg_ffi.dll "$NATIVES_DIR"/ 2>/dev/null || echo "Warning: kreuzberg_ffi.dll not found"
cp "$SOURCE_DIR"/pdfium.dll "$NATIVES_DIR"/ 2>/dev/null || echo "Warning: pdfium.dll not found"
cp "$SOURCE_DIR"/onnxruntime.dll "$NATIVES_DIR"/ 2>/dev/null || echo "Warning: onnxruntime.dll not found"
fi
echo "Native libraries copied to $NATIVES_DIR"
ls -la "$NATIVES_DIR" || echo "Directory creation failed"
</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>