Skip to content

Replace no more maintained com.squareup:javapoet by#23455

Open
apupier wants to merge 1 commit into
apache:mainfrom
apupier:moveToMaintainedJavaPoet
Open

Replace no more maintained com.squareup:javapoet by#23455
apupier wants to merge 1 commit into
apache:mainfrom
apupier:moveToMaintainedJavaPoet

Conversation

@apupier
Copy link
Copy Markdown
Contributor

@apupier apupier commented May 22, 2026

com.palantir.javapoet:javapoet

the squareup one was deprecated in 2020 and the repo has been archived in 2024
Palantir one is a fork of the squareup javapoet project.

Description

Target

  • I checked that the commit is targeting the correct branch (Camel 4 uses the main branch)

Tracking

  • If this is a large change, bug fix, or code improvement, I checked there is a JIRA issue filed for the change (usually before you start working on it).

Apache Camel coding standards and style

  • I checked that each commit in the pull request has a meaningful subject line and body.
  • I have run mvn clean install -DskipTests locally from root folder and I have committed all auto-generated changes.

@github-actions
Copy link
Copy Markdown
Contributor

🌟 Thank you for your contribution to the Apache Camel project! 🌟
🤖 CI automation will test this PR automatically.

🐫 Apache Camel Committers, please review the following items:

  • First-time contributors require MANUAL approval for the GitHub Actions to run
  • You can use the command /component-test (camel-)component-name1 (camel-)component-name2.. to request a test from the test bot although they are normally detected and executed by CI.
  • You can label PRs using skip-tests and test-dependents to fine-tune the checks executed by this PR.
  • Build and test logs are available in the summary page. Only Apache Camel committers have access to the summary.

⚠️ Be careful when sharing logs. Review their contents before sharing them publicly.

com.palantir.javapoet:javapoet

the squareup one was deprecated in 2020 and the repo has been archived
in 2024
Palantir one is a fork of the squareup javapoet project.

* maven coordinate adjusted
* package name adjusted
* few api change to use methods instead of attributes as they became
private
* fixed one method in our code thanks to stricter check introduced
palantir/javapoet@04b6134

Signed-off-by: Aurélien Pupier <apupier@ibm.com>
@apupier apupier force-pushed the moveToMaintainedJavaPoet branch from d9e4791 to 05ce454 Compare May 22, 2026 12:28
@github-actions
Copy link
Copy Markdown
Contributor

🧪 CI tested the following changed modules:

  • components/camel-servicenow/camel-servicenow-maven-plugin
  • dsl/camel-yaml-dsl/camel-yaml-dsl-maven-plugin
  • parent
  • tooling/openapi-rest-dsl-generator

POM dependency changes: targeted tests included

Changed properties: javapoet-version

Modules affected by dependency changes (3)
  • :camel-openapi-rest-dsl-generator
  • :camel-servicenow-maven-plugin
  • :camel-yaml-dsl-maven-plugin
All tested modules (12 modules)
  • Camel :: JBang :: MCP
  • Camel :: JBang :: Plugin :: Route Parser
  • Camel :: JBang :: Plugin :: TUI
  • Camel :: JBang :: Plugin :: Validate
  • Camel :: Launcher :: Container
  • Camel :: Maven Plugins :: OpenApi REST DSL Generator
  • Camel :: Maven Plugins :: OpenApi REST DSL Generator SUCCESS
  • Camel :: ServiceNow :: Maven Plugin
  • Camel :: Tooling :: OpenApi REST DSL Generator
  • Camel :: YAML DSL :: Maven Plugins
  • Camel :: YAML DSL :: Validator
  • Camel :: YAML DSL :: Validator Maven Plugin

⚙️ View full build and test results

@apupier apupier marked this pull request as ready for review May 22, 2026 15:00
Copy link
Copy Markdown
Contributor

@gnodet gnodet left a comment

Choose a reason for hiding this comment

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

Good change. Replacing the archived com.squareup:javapoet (deprecated in 2020, archived in 2024) with the actively maintained Palantir fork (com.palantir.javapoet:javapoet) is the right move.

The migration looks correct:

  • All import package renames (com.squareup.javapoet -> com.palantir.javapoet) are applied consistently across all three modules (servicenow-maven-plugin, yaml-dsl-maven-plugin, openapi-rest-dsl-generator).
  • The public-field-to-accessor-method changes (TypeSpec.name -> TypeSpec.name(), AnnotationSpec.members -> AnnotationSpec.members()) are properly adapted -- the Palantir fork encapsulates state behind accessor methods instead of exposing public fields.
  • The removal of the unused info.name().toString() arg from the addMember("order", ...) call is correct -- the format string had no $ placeholder, so the arg was always ignored by squareup javapoet. The Palantir fork is stricter and validates that all varargs are consumed, so this would have failed at runtime without the fix. Good catch.
  • License is Apache 2.0, fully compatible.
  • CI checks all pass.
  • Version 0.15.0 is the latest available release.

Two minor nits (non-blocking):

  1. PR title truncated -- the title reads "Replace no more maintained com.squareup:javapoet by" and ends mid-sentence. Consider completing it, e.g., "Replace archived com.squareup:javapoet with com.palantir.javapoet".

  2. Commit message -- same truncation issue. If the PR gets squash-merged, the commit message will be incomplete.

Claude Code on behalf of Guillaume Nodet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants