Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 9, 2025

Description

Lombok annotation processing fails for third-party classes when depending on xapi-model-spring-boot-starter. The starter excludes spring-boot-starter-jackson in favor of spring-boot-jackson2 for jjwt compatibility, but does not configure Lombok, causing compilation failures in consuming projects.

Changes

xapi-model-spring-boot-starter/pom.xml

  • Added lombok as optional dependency to make it available transitively
  • Configured maven-compiler-plugin with Lombok annotation processor path
  • Added spring-boot-starter-test dependency for testing

xapi-model-spring-boot-starter/lombok.config

  • Added Lombok configuration matching xapi-model and xapi-client modules

xapi-model-spring-boot-starter/src/test/java/.../LombokProcessingTests.java

  • Added tests verifying @Getter, @Setter, @Builder, and @Value annotations process correctly
  • Uses generic test classes (Person, Cat, Dog) to demonstrate Lombok functionality

Impact

Projects depending on xapi-model-spring-boot-starter can now use Lombok annotations without additional configuration:

@Getter
@Setter
class Person {
    private String name;
    private int age;
}

@Builder
@Getter  
class Cat {
    private String name;
    private String breed;
}

Checklist:

  • Public methods are documented
  • Public methods are tested
  • New and existing tests pass when run locally
  • There are no new warnings or errors
Original prompt

This section details on the original issue you should resolve

<issue_title>[Bug]: Lombok annotation processing fails for Subscription/SubscriptionProperties with xapi-model-spring-boot-starter 1.1.20 on Spring Boot 4.0</issue_title>
<issue_description>### Summary

Lombok compilation failure: The Subscription and SubscriptionProperties classes' @Setter/@Getter annotations are not being processed with xapi-java 1.1.20, causing compilation errors in third party projects. Suspected interference from xapi-model-spring-boot-starter 1.1.20’s Jackson 2 compatibility layer in Spring Boot 4.0 environments.

Steps to reproduce

  1. Use xapi-model-spring-boot-starter version 1.1.20 as a dependency in a Spring Boot 4.0 project.
  2. Define classes Subscription and SubscriptionProperties with Lombok @Setter/@Getter annotations.
  3. Attempt to compile the project (e.g. ./mvnw clean verify).

Observed in the third party project depending on xapi-java 1.1.20.

Expected behavior

Lombok @Setter/@Getter annotations should be processed, and compilation should succeed without errors related to missing getters/setters.

Actual behavior

Compilation fails, indicating missing getter/setter methods. Lombok annotations are not being processed as expected.

Notes

This may be related to the Jackson 2 compatibility layer in xapi-model-spring-boot-starter 1.1.20 interfering with Lombok in Spring Boot 4.0.

Version

1.x</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

…model-spring-boot-starter

Co-authored-by: thomasturrell <1552612+thomasturrell@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix Lombok annotation processing for Subscription classes Fix Lombok annotation processing failure in xapi-model-spring-boot-starter Dec 9, 2025
Copilot AI requested a review from thomasturrell December 9, 2025 19:51
@thomasturrell
Copy link
Contributor

@copilot use generic class names like Person

Co-authored-by: thomasturrell <1552612+thomasturrell@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Dec 9, 2025

@copilot use generic class names like Person

Updated test classes to use generic names: Person, Cat, and Dog. Commit 7cec210

@thomasturrell thomasturrell marked this pull request as ready for review December 9, 2025 20:00
Copilot AI review requested due to automatic review settings December 9, 2025 20:00
@sonarqubecloud
Copy link

sonarqubecloud bot commented Dec 9, 2025

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a Lombok annotation processing failure that occurred when third-party projects depended on xapi-model-spring-boot-starter. The starter module previously excluded spring-boot-starter-jackson for jjwt compatibility but didn't configure Lombok, causing compilation failures in consuming projects that used Lombok annotations.

Key Changes:

  • Added Lombok dependency and compiler configuration to enable annotation processing
  • Included lombok.config file to standardize Lombok behavior
  • Added comprehensive tests to verify Lombok annotations work correctly

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
xapi-model-spring-boot-starter/pom.xml Added Lombok as a dependency with maven-compiler-plugin configuration for annotation processing, and spring-boot-starter-test for testing
xapi-model-spring-boot-starter/lombok.config Added Lombok configuration to suppress code coverage and standardize builder/constructor behavior
xapi-model-spring-boot-starter/src/test/java/.../LombokProcessingTests.java Added tests verifying @Getter, @Setter, @builder, and @value annotations process correctly

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@sonarqubecloud
Copy link

sonarqubecloud bot commented Dec 9, 2025

@thomasturrell thomasturrell merged commit dd04a64 into main Dec 9, 2025
4 checks passed
@thomasturrell thomasturrell deleted the copilot/fix-lombok-processing-issue branch December 9, 2025 20:22
Copilot AI added a commit that referenced this pull request Dec 9, 2025
Co-authored-by: thomasturrell <1552612+thomasturrell@users.noreply.github.com>
@thomasturrell
Copy link
Contributor

This turned out to be a false positive

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.

[Bug]: Lombok annotation processing fails for Subscription/SubscriptionProperties with xapi-model-spring-boot-starter 1.1.20 on Spring Boot 4.0

2 participants