Skip to content

Jreleaser - #314

Merged
cstamas merged 8 commits into
mainfrom
jreleaser
Jun 23, 2026
Merged

cstamas merged 8 commits into
mainfrom
jreleaser

Conversation

@cstamas

@cstamas cstamas commented Jun 23, 2026 •

Copy link
Copy Markdown
Member

Summary by CodeRabbit

  • New Features

    • JReleaser publisher integration now available via dedicated extension module.
    • Sonatype Nx3 added as a supported publisher target.
  • Bug Fixes

    • Fixed directory creation when exporting artifacts to a directory.
  • Documentation

    • Updated setup instructions with extension information and new publisher entries.
    • Added JReleaser publisher configuration documentation.

@cstamas cstamas self-assigned this Jun 23, 2026
@coderabbitai

coderabbitai Bot commented Jun 23, 2026 •

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@cstamas, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 37 minutes and 42 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate.

For paid Pro and Pro+ PR reviews, CodeRabbit uses rolling per-developer review limits. Reviews become available again as older review attempts age out of the rolling limit window.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 5cb392e0-83d7-4925-ab0d-c96c57f53f85

📥 Commits

Reviewing files that changed from the base of the PR and between bb9212c and a85fa38.

📒 Files selected for processing (6)
  • core/src/main/java/eu/maveniverse/maven/njord/shared/impl/store/DefaultArtifactStoreWriter.java
  • extension3-jreleaser/src/main/resources/META-INF/maven/extension.xml
  • extension3/src/main/resources/META-INF/maven/extension.xml
  • publisher/jreleaser/README.md
  • publisher/jreleaser/src/main/java/eu/maveniverse/maven/njord/publisher/jreleaser/JReleaserPublisher.java
  • publisher/jreleaser/src/main/java/eu/maveniverse/maven/njord/publisher/jreleaser/JReleaserPublisherConfig.java
📝 Walkthrough

Walkthrough

Adds a new publisher/jreleaser Maven module implementing an ArtifactStorePublisher that writes staged artifacts to a directory and invokes Workflows.fullRelease via JReleaser. Introduces a companion extension3-jreleaser Maven extension descriptor, fixes DefaultArtifactStoreWriter to create target directories, updates root build wiring with JReleaser dependencies, and refreshes README documentation.

Changes

JReleaser Publisher Integration

Layer / File(s) Summary
Root build and dependency wiring
pom.xml, publisher/pom.xml
Registers extension3-jreleaser and jreleaser as build modules, introduces version.jreleaser=1.24.0, and adds managed dependencies for jreleaser, jreleaser-engine, jreleaser-config-yaml, jsoup, and commons-io.
extension3-jreleaser Maven extension module
extension3-jreleaser/pom.xml, extension3-jreleaser/src/main/java/.../Dummy.java, extension3-jreleaser/src/main/resources/META-INF/maven/extension.xml
Defines the extension3-jreleaser POM depending on extension3 and publisher/jreleaser, adds a no-op Dummy class for sources/Javadoc artifacts, and registers an extension.xml descriptor exporting Njord shared packages and all publisher artifacts including jreleaser.
DefaultArtifactStoreWriter directory creation fix
core/src/main/java/eu/maveniverse/maven/njord/shared/impl/store/DefaultArtifactStoreWriter.java
Adds Files.createDirectories(targetDirectory) in writeAsDirectory(...) so the target directory tree is created before artifact store contents are written into it.
JReleaserLoggerAdapter: SLF4J bridge
publisher/jreleaser/src/main/java/.../JReleaserLoggerAdapter.java
Implements JReleaserLoggerAdapter extending AbstractJReleaserLogger, bridging all JReleaser log levels to an SLF4J delegate and a PrintWriter tracer; handles indentation stripping for DEBUG/ERROR; defines an internal Level enum with bracketed toString().
JReleaser publisher config, publisher, factory, and POM
publisher/jreleaser/pom.xml, publisher/jreleaser/src/main/java/.../JReleaserPublisherConfig.java, publisher/jreleaser/src/main/java/.../JReleaserPublisher.java, publisher/jreleaser/src/main/java/.../JReleaserPublisherFactory.java
JReleaserPublisherConfig reads jreleaser.yml, derives staging output directory, and builds a JReleaserContext; JReleaserPublisher.doPublish writes the artifact store to the output directory then calls Workflows.fullRelease; JReleaserPublisherFactory wires all three as a named singleton.
README and publisher documentation
README.md, publisher/jreleaser/README.md
Updates root README setup instructions to reference extension3-jreleaser, expands supported publishers table, removes the placeholder "High level design" section, and adds a publisher/jreleaser README documenting configuration keys, altDeploymentRepository format, and unsupported properties.

Sequence Diagram(s)

sequenceDiagram
  participant User as Maven Build
  participant Factory as JReleaserPublisherFactory
  participant Config as JReleaserPublisherConfig
  participant Publisher as JReleaserPublisher
  participant StoreWriter as DefaultArtifactStoreWriter
  participant JReleaser as Workflows.fullRelease

  User->>Factory: doCreate(session)
  Factory->>Config: new JReleaserPublisherConfig(session.config(), logger)
  Factory->>Publisher: new JReleaserPublisher(session, repoSystem, config, requirements)
  User->>Publisher: publish(artifactStore)
  Publisher->>Config: outputDirectory()
  Publisher->>StoreWriter: writeAsDirectory(artifactStore, outputDirectory)
  StoreWriter->>StoreWriter: Files.createDirectories(targetDirectory)
  StoreWriter-->>Publisher: done
  Publisher->>Config: createContext()
  Config->>Config: load jreleaser.yml, override coordinates
  Config-->>Publisher: JReleaserContext
  Publisher->>JReleaser: fullRelease(context)
  JReleaser-->>User: release complete
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐇 A new publisher hops into the mix,
JReleaser wired up with a few clever tricks.
Directories created before writing begins,
The extension descriptor declares where it wins.
Log levels bridged, the tracer file set,
A fullRelease called — no artifact left unmet! 🎉

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title 'Jreleaser' is a single word that refers to a real component being added in the changeset, but it lacks specificity about what action is being taken and does not clearly convey the main purpose of the change. Use a more descriptive title that explains the primary change, such as 'Add JReleaser publisher integration' or 'Implement JReleaser artifact store publisher'.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch jreleaser

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@cstamas
cstamas marked this pull request as ready for review June 23, 2026 10:05

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@core/src/main/java/eu/maveniverse/maven/njord/shared/impl/store/DefaultArtifactStoreWriter.java`:
- Around line 31-35: There is a TOCTOU race condition in the targetDirectory
existence check and creation logic. Instead of checking if targetDirectory
exists and then calling Files.createDirectories, remove the Files.exists check
and call Files.createDirectories directly, but wrap it in a try-catch block to
handle FileAlreadyExistsException. If the exception is caught, verify whether
the existing path is actually a directory or a file, and only throw an
IOException with the appropriate message if a file exists at that location or if
the directory should not have been pre-created. This ensures atomic directory
creation without the race condition window that currently exists between the
exists check and the createDirectories call.

In `@extension3-jreleaser/src/main/resources/META-INF/maven/extension.xml`:
- Around line 21-27: The extension.xml file is missing the install publisher
export entry from the exportedArtifacts list. Add a new exportedArtifact element
with the value eu.maveniverse.maven.njord.publisher:install to the
exportedArtifacts section alongside the other publisher entries like deploy,
apache, sonatype-central, sonatype-cp, sonatype-nx2, sonatype-nx3, and jreleaser
to ensure the install publisher is properly exported and available through this
extension.

In `@publisher/jreleaser/README.md`:
- Around line 18-21: The documentation for the altDeploymentRepository property
incorrectly states that the legacy format is not supported and only the id::url
format is expected. Since ResolverUtils.parseRemoteRepositoryString() actually
supports both the id::url format and the legacy id::layout::url format (as
confirmed by the error message and integration tests), update the README.md file
to correct this claim. Replace the statement about "does **not supports legacy
format**" with text that accurately reflects that both the id::url and legacy
id::layout::url formats are supported for the altDeploymentRepository property.

In
`@publisher/jreleaser/src/main/java/eu/maveniverse/maven/njord/publisher/jreleaser/JReleaserPublisher.java`:
- Around line 44-58: The doPublish method in JReleaserPublisher contains a
redundant try-with-resources statement wrapping the artifactStore parameter.
Since ArtifactStorePublisherSupport.publish() already manages the store
lifecycle with try-with-resources before calling doPublish(), remove the nested
try-with-resources block and use the artifactStore parameter directly throughout
the method. Additionally, replace the catch block that converts IOException to
UncheckedIOException with a catch block that propagates the IOException
directly, respecting the parent method's declared throws IOException contract
instead of converting to an unchecked exception.

In
`@publisher/jreleaser/src/main/java/eu/maveniverse/maven/njord/publisher/jreleaser/JReleaserPublisherConfig.java`:
- Around line 98-99: In the createContext() method, you are creating a
JReleaserLogger instance at line 98 and storing it in the logger variable, but
then calling getLogger(outputDirectory) again at line 128 when passing the
logger to ContextCreator.create(). Instead of creating a second logger, pass the
same logger instance created at line 98 as an argument to
ContextCreator.create(). This will prevent file truncation from the second call
to getLogger() and eliminate the resource leak from the unclosed first
PrintWriter. Update the ContextCreator.create() method signature to accept the
logger parameter and use the passed instance instead of creating a new one
internally.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 28eae399-006c-41d1-9e34-f3315927ccda

📥 Commits

Reviewing files that changed from the base of the PR and between 03f1bd7 and bb9212c.

📒 Files selected for processing (13)
  • README.md
  • core/src/main/java/eu/maveniverse/maven/njord/shared/impl/store/DefaultArtifactStoreWriter.java
  • extension3-jreleaser/pom.xml
  • extension3-jreleaser/src/main/java/eu/maveniverse/maven/njord/extension3/jreleaser/Dummy.java
  • extension3-jreleaser/src/main/resources/META-INF/maven/extension.xml
  • pom.xml
  • publisher/jreleaser/README.md
  • publisher/jreleaser/pom.xml
  • publisher/jreleaser/src/main/java/eu/maveniverse/maven/njord/publisher/jreleaser/JReleaserLoggerAdapter.java
  • publisher/jreleaser/src/main/java/eu/maveniverse/maven/njord/publisher/jreleaser/JReleaserPublisher.java
  • publisher/jreleaser/src/main/java/eu/maveniverse/maven/njord/publisher/jreleaser/JReleaserPublisherConfig.java
  • publisher/jreleaser/src/main/java/eu/maveniverse/maven/njord/publisher/jreleaser/JReleaserPublisherFactory.java
  • publisher/pom.xml

Comment thread publisher/jreleaser/README.md Resolved
@cstamas
cstamas merged commit e357f01 into main Jun 23, 2026
26 checks passed
@cstamas
cstamas deleted the jreleaser branch June 23, 2026 10:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant