zstd-java
Used in:
components
- OverviewOverview
- VersionsVersions
- DependentsDependents
- DependenciesDependencies
<dependency>
<groupId>io.github.dfa1.zstd</groupId>
<artifactId>zstd-java</artifactId>
<version>0.12</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>io.github.dfa1.zstd</groupId>
<artifactId>zstd-java</artifactId>
<version>0.12</version>
<packaging>pom</packaging>
<name>zstd-java</name>
<description>Java FFM (Foreign Function & Memory) bindings for zstd</description>
<url>https://github.com/dfa1/zstd-java</url>
<licenses>
<license>
<name>BSD 3-Clause License</name>
<url>https://opensource.org/license/bsd-3-clause</url>
<distribution>repo</distribution>
</license>
</licenses>
<developers>
<developer>
<id>dfa1</id>
<name>Davide Angelocola</name>
<url>https://github.com/dfa1</url>
</developer>
</developers>
<scm>
<connection>scm:git:https://github.com/dfa1/zstd-java.git</connection>
<developerConnection>scm:git:git@github.com:dfa1/zstd-java.git</developerConnection>
<url>https://github.com/dfa1/zstd-java</url>
<tag>HEAD</tag>
</scm>
<modules>
<module>native/osx-aarch64</module>
<module>native/osx-x86_64</module>
<module>native/linux-x86_64</module>
<module>native/linux-aarch64</module>
<module>native/windows-x86_64</module>
<module>native/windows-aarch64</module>
<module>zstd</module>
<module>zstd-platform</module>
<module>bom</module>
<module>integration-tests</module>
<module>benchmark</module>
</modules>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.release>25</maven.compiler.release>
<central-publishing-plugin.version>0.11.0</central-publishing-plugin.version>
<maven-gpg-plugin.version>3.2.8</maven-gpg-plugin.version>
<maven-source-plugin.version>3.4.0</maven-source-plugin.version>
<maven-javadoc-plugin.version>3.12.0</maven-javadoc-plugin.version>
<maven-release-plugin.version>3.3.1</maven-release-plugin.version>
<maven-jar-plugin.version>3.5.0</maven-jar-plugin.version>
<jacoco-maven-plugin.version>0.8.15</jacoco-maven-plugin.version>
<pitest-maven.version>1.25.7</pitest-maven.version>
<pitest-junit5-plugin.version>1.2.3</pitest-junit5-plugin.version>
<!-- SonarCloud analysis (.github/workflows/sonar.yml). -->
<sonar.host.url>https://sonarcloud.io</sonar.host.url>
<sonar.organization>dfa11</sonar.organization>
<sonar.projectKey>dfa1_zstd-java</sonar.projectKey>
<!-- The benchmark module is a JMH harness, not shipped runtime: its
@Setup/@TearDown lifecycle trips false "resource not closed" reports and
it has no tests by design. Exclude from analysis entirely (which also
keeps it out of the coverage ratio). -->
<sonar.exclusions>
**/benchmark/**
</sonar.exclusions>
<!-- S7474 ("Markdown, HTML and Javadoc tags should be consistent") flags our
JEP 467 Markdown reference links ([ClassName#method]) and wants the
{@link}/HTML form instead. That form is forbidden here: the project
mandates `///` Markdown javadoc with [ClassName] reference links and
checkstyle bans {@link}. The rule therefore conflicts with a mandated,
enforced convention rather than catching a real defect — ignore it. -->
<sonar.issue.ignore.multicriteria>jep467</sonar.issue.ignore.multicriteria>
<sonar.issue.ignore.multicriteria.jep467.ruleKey>java:S7474</sonar.issue.ignore.multicriteria.jep467.ruleKey>
<sonar.issue.ignore.multicriteria.jep467.resourceKey>**/*.java</sonar.issue.ignore.multicriteria.jep467.resourceKey>
<sonar.coverage.exclusions>
**/benchmark/**
</sonar.coverage.exclusions>
<!-- Coverage sources Sonar ingests:
1. per-module surefire (unit tests) — target/site/jacoco/jacoco.xml
2. integration-tests aggregate — report-aggregate there reads the IT
jacoco.exec and reports hits on the zstd classes it exercises, so the
library's integration coverage lands on Sonar too. -->
<sonar.coverage.jacoco.xmlReportPaths>
${project.build.directory}/site/jacoco/jacoco.xml,
${maven.multiModuleProjectDirectory}/integration-tests/target/site/jacoco-aggregate/jacoco.xml
</sonar.coverage.jacoco.xmlReportPaths>
<!-- Default for the @{argLine} placeholder in the surefire config below.
JaCoCo's prepare-agent overwrites this property with the agent args when
the coverage profile is active; the empty default keeps surefire from
receiving a literal @{argLine} token when it is not. -->
<argLine />
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>io.github.dfa1.zstd</groupId>
<artifactId>zstd</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.github.dfa1.zstd</groupId>
<artifactId>zstd-platform</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.github.dfa1.zstd</groupId>
<artifactId>zstd-native-osx-aarch64</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.github.dfa1.zstd</groupId>
<artifactId>zstd-native-linux-x86_64</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.github.dfa1.zstd</groupId>
<artifactId>zstd-native-linux-aarch64</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.github.dfa1.zstd</groupId>
<artifactId>zstd-native-osx-x86_64</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.github.dfa1.zstd</groupId>
<artifactId>zstd-native-windows-x86_64</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.github.dfa1.zstd</groupId>
<artifactId>zstd-native-windows-aarch64</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>6.1.2</version>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>3.27.7</version>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.15.0</version>
<configuration>
<release>25</release>
<failOnWarning>true</failOnWarning>
<compilerArgs>
<arg>-Xlint:all</arg>
</compilerArgs>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.12.0</version>
<configuration>
<release>25</release>
<failOnError>true</failOnError>
<failOnWarnings>true</failOnWarnings>
<quiet>true</quiet>
<!-- Don't cross-link to sibling reactor modules: the native/bom
modules have no Java sources, so link detection just creates
fake apidocs dirs and logs "Error fetching link". -->
<detectOfflineLinks>false</detectOfflineLinks>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.5.6</version>
<configuration>
<!-- @{argLine} carries JaCoCo's agent when the coverage profile is
active (empty otherwise); the native-access flag is always on. -->
<argLine>@{argLine} --enable-native-access=ALL-UNNAMED</argLine>
</configuration>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${jacoco-maven-plugin.version}</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>3.6.3</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>3.6.0</version>
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>check</goal>
</goals>
<configuration>
<configLocation>${maven.multiModuleProjectDirectory}/checkstyle.xml</configLocation>
<failsOnError>true</failsOnError>
<consoleOutput>true</consoleOutput>
<sourceDirectories>
<sourceDirectory>src/main/java</sourceDirectory>
<sourceDirectory>src/test/java</sourceDirectory>
</sourceDirectories>
<excludes>**/module-info.java</excludes>
</configuration>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>com.puppycrawl.tools</groupId>
<artifactId>checkstyle</artifactId>
<version>13.8.0</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>${maven-release-plugin.version}</version>
<configuration>
<autoVersionSubmodules>true</autoVersionSubmodules>
<tagNameFormat>v@{project.version}</tagNameFormat>
<pushChanges>false</pushChanges>
<localCheckout>true</localCheckout>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>${maven-jar-plugin.version}</version>
<executions>
<!-- Resource-only native modules carry no Java sources. Attach
empty javadoc/sources jars (from non-existent dirs) so Maven
Central's "javadoc + sources required" validation passes. -->
<execution>
<id>empty-javadoc-jar</id>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<classifier>javadoc</classifier>
<classesDirectory>${project.build.directory}/empty-javadoc</classesDirectory>
<forceCreation>true</forceCreation>
</configuration>
</execution>
<execution>
<id>empty-sources-jar</id>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<classifier>sources</classifier>
<classesDirectory>${project.build.directory}/empty-sources</classesDirectory>
<forceCreation>true</forceCreation>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<executions>
<execution>
<id>javadoc-no-warnings</id>
<phase>verify</phase>
<goals>
<goal>javadoc</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<profiles>
<!-- Activated in CI for Sonar: ./mvnw verify -P coverage
Attaches the JaCoCo agent to surefire (via the @{argLine} placeholder)
and writes one target/site/jacoco/jacoco.xml per module. -->
<profile>
<id>coverage</id>
<build>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<executions>
<execution>
<id>prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>report</id>
<phase>verify</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<!-- Cut a release with maven-release-plugin (configured in build above):
./mvnw release:prepare
drops -SNAPSHOT, commits, tags v<version> (pushChanges=false), then
bumps to the next snapshot. Push the commits and the tag; the v* tag
triggers .github/workflows/publish.yml, which runs
./mvnw deploy -Prelease
to sign and upload to Maven Central.
Prerequisites:
1. Register namespace io.github.dfa1 at central.sonatype.com.
2. A Central user token (Account / User Tokens); in CI it comes from
the CENTRAL_USERNAME / CENTRAL_PASSWORD secrets.
3. A published GPG key (GPG_PRIVATE_KEY / GPG_PASSPHRASE secrets). -->
<profile>
<id>release</id>
<build>
<plugins>
<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>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>${maven-javadoc-plugin.version}</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
<configuration>
<doclint>none</doclint>
</configuration>
</plugin>
<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>--pinentry-mode</arg>
<arg>loopback</arg>
</gpgArguments>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.sonatype.central</groupId>
<artifactId>central-publishing-maven-plugin</artifactId>
<version>${central-publishing-plugin.version}</version>
<extensions>true</extensions>
<configuration>
<publishingServerId>central</publishingServerId>
<autoPublish>true</autoPublish>
<waitUntil>published</waitUntil>
<excludeArtifacts>
<!-- Internal modules: not published to Maven Central.
Each entry is a groupId:artifactId string. -->
<artifact>io.github.dfa1.zstd:zstd-integration-tests</artifact>
<artifact>io.github.dfa1.zstd:zstd-benchmark</artifact>
</excludeArtifacts>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<!-- Mutation testing (opt-in: -P pitest). Common PIT setup lives here once; the
zstd module's own `pitest` profile only adds the plugin to <plugins> and names
its <targetClasses>. PIT forks minion JVMs that exercise the native library, so
they get the same enable-native-access flag as surefire. -->
<profile>
<id>pitest</id>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.pitest</groupId>
<artifactId>pitest-maven</artifactId>
<version>${pitest-maven.version}</version>
<dependencies>
<dependency>
<groupId>org.pitest</groupId>
<artifactId>pitest-junit5-plugin</artifactId>
<version>${pitest-junit5-plugin.version}</version>
</dependency>
</dependencies>
<executions>
<execution>
<id>pit-report</id>
<phase>verify</phase>
<goals>
<goal>mutationCoverage</goal>
</goals>
</execution>
</executions>
<configuration>
<jvmArgs>
<param>--enable-native-access=ALL-UNNAMED</param>
</jvmArgs>
<outputFormats>
<param>HTML</param>
<param>XML</param>
</outputFormats>
<timestampedReports>false</timestampedReports>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
</profile>
</profiles>
</project>