René's URL Explorer Experiment


Title: Add a Maven plugin with format and check goals · Issue #26 · openjavaformat/open-java-format · GitHub

Open Graph Title: Add a Maven plugin with format and check goals · Issue #26 · openjavaformat/open-java-format

X Title: Add a Maven plugin with format and check goals · Issue #26 · openjavaformat/open-java-format

Description: Why Maven users have no way to run open-java-format from their build today. palantir-java-format never had a Maven plugin. palantir#327 has asked for Maven instructions since 2020, and in palantir#832 the maintainers point Maven users to...

Open Graph Description: Why Maven users have no way to run open-java-format from their build today. palantir-java-format never had a Maven plugin. palantir#327 has asked for Maven instructions since 2020, and in palantir#...

X Description: Why Maven users have no way to run open-java-format from their build today. palantir-java-format never had a Maven plugin. palantir#327 has asked for Maven instructions since 2020, and in palantir#...

Opengraph URL: https://github.com/openjavaformat/open-java-format/issues/26

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Add a Maven plugin with format and check goals","articleBody":"### Why\n\nMaven users have no way to run open-java-format from their build today.\n\n- palantir-java-format never had a Maven plugin. palantir/palantir-java-format#327 has asked for Maven instructions since 2020, and in palantir/palantir-java-format#832 the maintainers point Maven users to Spotless.\n- Spotless is not a route for this project. Its `palantirJavaFormat` step hardcodes `com.palantir.javaformat:palantir-java-format`, and diffplug/spotless#3084, which adds an `openJavaFormat` step, was closed. The details are at https://openjavaformat.dev/get-started/spotless/.\n- A search of Maven Central found no Maven plugin for palantir-java-format either.\n\n### Proposal\n\nA plugin `dev.openjavaformat:open-java-format-maven-plugin`, released together with the formatter and under the same version, with two goals modelled on [spotify/fmt-maven-plugin](https://github.com/spotify/fmt-maven-plugin):\n\n| Goal | Default phase | What it does |\n| --- | --- | --- |\n| `format` | `process-sources` | Formats the Java files in place |\n| `check` | `verify` | Fails the build and lists the files that are not formatted |\n\n```xml\n\u003cplugin>\n  \u003cgroupId>dev.openjavaformat\u003c/groupId>\n  \u003cartifactId>open-java-format-maven-plugin\u003c/artifactId>\n  \u003cversion>\u003c!-- the formatter version -->\u003c/version>\n  \u003cexecutions>\n    \u003cexecution>\n      \u003cgoals>\n        \u003cgoal>check\u003c/goal>\n      \u003c/goals>\n    \u003c/execution>\n  \u003c/executions>\n\u003c/plugin>\n```\n\nFrom the command line the prefix gives `mvn open-java-format:format` and `mvn open-java-format:check`.\n\nAs few settings as possible, in line with a formatter that has none: the source roots, which default to the module's compile and test source roots, includes and excludes, and `skip`. The style is always OJF.\n\n### How the formatter runs\n\nThe formatter needs javac's internal packages exported. Running it inside the Maven JVM would make every project add the five `--add-exports` flags to `.mvn/jvm.config`, which is what [Cosium/git-code-format-maven-plugin](https://github.com/Cosium/git-code-format-maven-plugin) asks its users to do. Two ways avoid that:\n\n- **Fork one JVM per module.** Start the current JDK with the flags and the formatter's classpath, and hand all files of the module to `com.palantir.javaformat.java.Main` in a single call through an `@argfile`: `--replace` for `format`, `--dry-run --set-exit-if-changed` for `check`. `BootstrappingFormatterService` in `open-java-format-jdk-bootstrap` already builds this command line, although it starts one process per file. spotify/fmt-maven-plugin forks by default for the same reason, see its `forkMode`.\n- **The native binary** from `open-java-format-native`, as the Gradle plugin does with `openjavaformat.native.formatter`, on Linux with glibc and on macOS.\n\nThe formatter comes from the plugin's own dependencies, so it needs nothing from the project's repositories. That is the principle of #20 for the Gradle plugin.\n\n### Building it here\n\nThe repository builds with Gradle, and a Maven plugin needs a plugin descriptor. `org.gradlex.maven-plugin-development` generates it from the mojo annotations; the alternative is a small Maven build for this one module. Publishing goes through the existing JReleaser conventions together with the other jars.\n\n### Done when\n\n- the plugin is on Maven Central under the formatter's version;\n- an integration test runs real `mvn` on a sample multi-module project against the locally published plugin, for both goals, on Java 21 and without `.mvn/jvm.config`;\n- the output of `format` is byte-identical to the command line with `--ojf`;\n- the website gets a Maven page under Get started, and the Maven parts of the Spotless and Migrate pages point to it.\n\n### Related\n\n- palantir/palantir-java-format#327 and palantir/palantir-java-format#832\n- diffplug/spotless#3084\n- Cosium/git-code-format-maven-plugin has a formatter SPI, `CodeFormatterFactory`, so an open-java-format formatter for it would be a smaller, complementary step.\n","author":{"url":"https://github.com/abashev","@type":"Person","name":"abashev"},"datePublished":"2026-09-21T15:24:05Z","url":"https://github.com/openjavaformat/open-java-format/issues/26"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:b40e4868-6fea-11e3-3bdf-a08bc7212001
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idDA04:1F7D:31C5D3:426903:6AFBC983
html-safe-nonce3f679c6219dd11a0885f9eb68ef0b56b270ce4df18f9cf56bb7c68fbb5f97b27
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEQTA0OjFGN0Q6MzFDNUQzOjQyNjkwMzo2QUZCQzk4MyIsInZpc2l0b3JfaWQiOiI0MTcxNDQyMTE0MjE2NTc3NDExIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac8295ef416ebdc94139bf97f096629e435abd40e8f07cd0e466d2765d14f945a1
hovercard-subject-tagissue:5528980023
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/openjavaformat/open-java-format/26/issue_layout
twitter:imagehttps://opengraph.githubassets.com/f96921610f273b2c8fca32046d922e3fe1fcb02cf59f1917702bb4e07b434221/openjavaformat/open-java-format/issues/26
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/f96921610f273b2c8fca32046d922e3fe1fcb02cf59f1917702bb4e07b434221/openjavaformat/open-java-format/issues/26
og:image:altWhy Maven users have no way to run open-java-format from their build today. palantir-java-format never had a Maven plugin. palantir#327 has asked for Maven instructions since 2020, and in palantir#...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameabashev
hostnamegithub.com
expected-hostnamegithub.com
Noned440bda0d812801778b27bfe9f7c1ce9ff22420c73f6f95150c4fcbca311c50b
turbo-cache-controlno-preview
go-importgithub.com/openjavaformat/open-java-format git https://github.com/openjavaformat/open-java-format.git
octolytics-dimension-user_id325177626
octolytics-dimension-user_loginopenjavaformat
octolytics-dimension-repository_id1288055459
octolytics-dimension-repository_nwoopenjavaformat/open-java-format
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forktrue
octolytics-dimension-repository_parent_id214273098
octolytics-dimension-repository_parent_nwopalantir/palantir-java-format
octolytics-dimension-repository_network_root_id214273098
octolytics-dimension-repository_network_root_nwopalantir/palantir-java-format
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release2c43021aed8695990c86c0eaaedc600bfeffec36
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/openjavaformat/open-java-format/issues/26#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fopenjavaformat%2Fopen-java-format%2Fissues%2F26
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fopenjavaformat%2Fopen-java-format%2Fissues%2F26
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=openjavaformat%2Fopen-java-format
Reloadhttps://github.com/openjavaformat/open-java-format/issues/26
Reloadhttps://github.com/openjavaformat/open-java-format/issues/26
Reloadhttps://github.com/openjavaformat/open-java-format/issues/26
openjavaformathttps://github.com/openjavaformat
open-java-formathttps://github.com/openjavaformat/open-java-format
Codehttps://github.com/openjavaformat/open-java-format
Issues30 (30)https://github.com/openjavaformat/open-java-format/issues
Pull requests5 (5)https://github.com/openjavaformat/open-java-format/pulls
Discussionshttps://github.com/openjavaformat/open-java-format/discussions
Actionshttps://github.com/openjavaformat/open-java-format/actions
Security and qualityhttps://github.com/openjavaformat/open-java-format/security
Insightshttps://github.com/openjavaformat/open-java-format/pulse
https://github.com/openjavaformat/open-java-format
New issuehttps://github.com/login?return_to=https://github.com/openjavaformat/open-java-format/issues/26
New issuehttps://github.com/login?return_to=https://github.com/openjavaformat/open-java-format/issues/26
Add a Maven plugin with format and check goalshttps://github.com/openjavaformat/open-java-format/issues/26#top
enhancementNew feature or requesthttps://github.com/openjavaformat/open-java-format/issues?q=state%3Aopen%20label%3A%22enhancement%22
https://github.com/abashev
abashevhttps://github.com/abashev
on Sep 21, 2026https://github.com/openjavaformat/open-java-format/issues/26#issue-5528980023
Provide how-to in README to format code with maven palantir/palantir-java-format#327https://github.com/palantir/palantir-java-format/issues/327
[QUESTION] Best practise of how to use palantir-java-format with Maven and VS Code palantir/palantir-java-format#832https://github.com/palantir/palantir-java-format/issues/832
Add new action for open-java-format diffplug/spotless#3084https://github.com/diffplug/spotless/pull/3084
https://openjavaformat.dev/get-started/spotless/https://openjavaformat.dev/get-started/spotless/
spotify/fmt-maven-pluginhttps://github.com/spotify/fmt-maven-plugin
Cosium/git-code-format-maven-pluginhttps://github.com/Cosium/git-code-format-maven-plugin
#20https://github.com/openjavaformat/open-java-format/issues/20
Provide how-to in README to format code with maven palantir/palantir-java-format#327https://github.com/palantir/palantir-java-format/issues/327
[QUESTION] Best practise of how to use palantir-java-format with Maven and VS Code palantir/palantir-java-format#832https://github.com/palantir/palantir-java-format/issues/832
Add new action for open-java-format diffplug/spotless#3084https://github.com/diffplug/spotless/pull/3084
abashevhttps://github.com/abashev
enhancementNew feature or requesthttps://github.com/openjavaformat/open-java-format/issues?q=state%3Aopen%20label%3A%22enhancement%22
on Sep 21, 2026https://github.com/openjavaformat/open-java-format/issues/26#event-31539166112
abashevhttps://github.com/abashev
completedhttps://github.com/openjavaformat/open-java-format/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Sep 26, 2026https://github.com/openjavaformat/open-java-format/issues/26#event-31902061483
Sign up for freehttps://github.com/signup?return_to=https://github.com/openjavaformat/open-java-format/issues/26
Sign in to commenthttps://github.com/login?return_to=https://github.com/openjavaformat/open-java-format/issues/26
enhancementNew feature or requesthttps://github.com/openjavaformat/open-java-format/issues?q=state%3Aopen%20label%3A%22enhancement%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.