Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow the jakarta version of @Generated instead of the javax one. #93

Open
Zegveld opened this issue Jan 14, 2022 · 2 comments · May be fixed by #97
Open

allow the jakarta version of @Generated instead of the javax one. #93

Zegveld opened this issue Jan 14, 2022 · 2 comments · May be fixed by #97

Comments

@Zegveld
Copy link

Zegveld commented Jan 14, 2022

all javax modules are being replaced with jakarta, this includes @javax.annotation.Generated. This is replaced by @jakarta.annotation.Generated, allow users to choose which annotation they want on the generated classes.

(Related to assertj/assertj-assertions-generator#194 )
(I'm also making a PR for this one)

Zegveld added a commit to rigd-loxia/assertj-assertions-generator-maven-plugin that referenced this issue Jan 14, 2022
@dmitry-weirdo
Copy link

Yes, this is very important, the tests are broken when migrating to Spring Boot 3 because of this annotation.

Is there a new version of the plugin probably? Version 2.2.0 was released at March 2019 (see mvn repo) 😱 🙀

@dmitry-weirdo
Copy link

dmitry-weirdo commented Jan 11, 2023

As a workaround for the current plugin version 2.2.0, I overrode the following templates in the plugin configuration,

The template files are taken from here, and just replaced @javax.annotation.Generated(value="assertj-assertions-generator") with @jakarta.annotation.Generated(value="assertj-assertions-generator")

                    <templates>
                        <!-- specify the base directory where to look for templates -->
                        <!-- !!! No file separator at the end, else it will still silently take the default templates -->
                        <templatesDirectory>${project.basedir}/src/test/resources/assertj/templates</templatesDirectory>

                        <assertionClass>_ins_custom_assertion_class_template.txt</assertionClass>
                        <softEntryPointAssertionClass>_ins_soft_assertions_entry_point_class_template.txt</softEntryPointAssertionClass>
                        <junitSoftEntryPointAssertionClass>_ins_junit_soft_assertions_entry_point_class_template.txt</junitSoftEntryPointAssertionClass>
                        <bddEntryPointAssertionClass>_ins_bdd_assertions_entry_point_class_template.txt</bddEntryPointAssertionClass>
                        <assertionsEntryPointClass>_ins_standard_assertions_entry_point_class_template.txt</assertionsEntryPointClass>
                    </templates>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants