Thanks for your interest in contributing! Bug reports, feature suggestions, documentation improvements, and pull requests are all welcome.
- Java (Open)JDK 21 or above — the Maven plugin's main sources target Java 8 bytecode (tests target Java 17), but building requires a modern JDK; CI builds with JDK 25
- No Maven or Gradle installation needed — both wrappers (
mvnw,gradlew) are included
Clone the repository and build all Maven modules:
git clone https://github.com/ASSERT-KTH/depclean.git
cd depclean
./mvnw clean installThis is close to what CI runs (./mvnw clean verify) and executes unit tests, integration tests, and Checkstyle.
The Gradle plugin (depclean-gradle-plugin) resolves depclean-core and its own snapshot from your local Maven repository, so build the Maven modules first, then publish and test the plugin:
./mvnw clean install -DskipTests
cd depclean-gradle-plugin
./gradlew clean publishToMavenLocal buildNote: running
./gradlew testwithoutpublishToMavenLocaltests the stale snapshot in~/.m2, not your current code. Always use the command above (it is what CI runs).
- Java code follows a Google Java Style-based configuration enforced by Checkstyle (checkstyle.xml). Checkstyle runs as part of the Maven build.
- Formatting is done with Spotless (google-java-format): run
./mvnw spotless:applyfor the Maven modules and./gradlew spotlessApplyindepclean-gradle-plugin.
- Unit tests run with
./mvnw test. - The Maven plugin has integration tests (
DepCleanMojoIT) that execute real Maven builds against fixture projects underdepclean-maven-plugin/src/test/resources-its. Their assertions compare against golden log output, which embeds exact dependency versions and jar sizes — if you change a fixture, update the expected output from the actual logs underdepclean-maven-plugin/target/maven-it/. - By default the integration tests fork the same Maven that runs the build (the wrapper's 3.9.x). To run them against another Maven distribution, e.g. Maven 4, point
it.maven.homeat its installation directory:./mvnw clean verify -Dit.maven.home=/opt/apache-maven-4.0.0-rc-6. CI only smoke-tests the plugin on the Maven 4 version listed in build.yml, so run this locally when touching the Maven integration. - Coverage is collected with JaCoCo and reported to Codecov.
Please follow the checklist in the pull request template. In short:
- Keep changes small and focused on a single problem (separate PRs for separate problems).
- Run the build locally (
./mvnw clean verify) and make sure it passes. - Reference the related issue in the PR title and description, and summarize your changes in bullet points.
- Be ready to discuss your changes during code review.
Releases are published to Maven Central through the Central Publisher Portal (see the Sonatype Maven guide) by the Deploy workflow.
The version is carried not only by the Maven POMs but also by the Gradle plugin, its test fixtures and the READMEs. scripts/set-version.sh <version> updates all of them at once, and CI fails if any of them drifts from pom.xml (scripts/set-version.sh --check). Never bump versions by hand. The one exception is the root README.md: it documents the plugin as consumed from Maven Central, so it always shows the latest release and is not touched by -SNAPSHOT bumps (the Gradle plugin README does follow the snapshot, because that plugin is only available from a local build).
scripts/release.sh drives the release from a clean, up-to-date master checkout (needs an authenticated gh):
scripts/release.sh prepare X.Y.Z— bumps every version reference, runs a sanity build and opens the release PR. Review and merge it.scripts/release.sh publish X.Y.Z— dispatches the Deploy workflow onmasterand waits for it. The run pauses until a maintainer approves it in thereleaseenvironment, then it signs the artifacts, publishes them, tags the commit, and opens a draft GitHub release.scripts/release.sh finish X.Y.Z— waits for the artifacts to appear on Maven Central, publishes the draft GitHub release and opens the PR that bumpsmasterto the next-SNAPSHOT.
Every step checks its preconditions and can be re-run; add --dry-run to see what a step would do.
The workflow needs these repository secrets:
| Secret | Purpose |
|---|---|
CENTRAL_TOKEN_USERNAME |
Username part of the Central Portal user token |
CENTRAL_TOKEN_PASSWORD |
Password part of the Central Portal user token |
GPG_PRIVATE_KEY |
Private key used to sign the artifacts |
GPG_PASSPHRASE |
Passphrase of that key |
Central no longer accepts a Sonatype account password for publishing, so the token has to be regenerated from the Portal when it is rotated or revoked.
Use the issue tracker with the provided templates. For security vulnerabilities, please follow the security policy instead of opening a public issue.