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

Plugin should add @Generated annotation to generated classes #42

Open
josephearl opened this issue Mar 21, 2022 · 1 comment
Open

Plugin should add @Generated annotation to generated classes #42

josephearl opened this issue Mar 21, 2022 · 1 comment

Comments

@josephearl
Copy link

This could be optional.

This will mean generated code is ignored by code coverage and static analysis tools without extra configuration.

@josephearl josephearl changed the title Plugin should add @Generated annotation to classes Plugin should add @Generated annotation to generated classes Mar 21, 2022
@dlmiles
Copy link

dlmiles commented Mar 7, 2023

RTFM ?

https://unbroken-dome.github.io/projects/gradle-xjc-plugin/#_specifying_extra_arguments

https://docs.oracle.com/javase/8/docs/technotes/tools/unix/xjc.html

So maybe this means:

sourceSets {
    main {
        xjcExtraArgs.addAll '-mark-generated'
    }
}

This works for me, ensure to provide the annotation on the classpath if necessary.

IMHO The plugin definitely should not add the annotation by default, it should follow standard behaviour of xjc command line use, which it does :)

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

No branches or pull requests

2 participants