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

Remove javax.annotation.Generated as it doesn't ship with Android #577

Closed
joelittlejohn opened this issue May 23, 2016 · 6 comments
Closed
Milestone

Comments

@joelittlejohn
Copy link
Owner

The goal of adding this annotation is to let tools know that this is generated source and hence probably shouldn't be considered for things like static code analysis. This annotation doesn't ship with Android's Java though, which causes annoyance for Android developers.

Let's stop adding javax.annotation.Generated entirely.

@joelittlejohn joelittlejohn added this to the 0.4.24 milestone May 23, 2016
@farmazon3000
Copy link

Having this annotation is fine in Android because I can mark (for example for future developers of my code) that they can simplify they lives with it so I'd live it - as you can see in SO it can be easily solved in gradle (with adding a dependency) - however it would be nice to have a checkbox to enable/disable generation of this annotation.

@samskiter
Copy link
Collaborator

samskiter commented May 23, 2016

It could be removed for only Android projects by default by adjusting the configuration in GenerateJsonSchemaAndroidTask

@joelittlejohn
Copy link
Owner Author

@farmazon3000 As you say, it's nice to advertise the existence of this project, but this error will waste a lot of engineering time. It's simply not worth sending people to Google and forcing them to add an extra dependency. This annotation hasn't proven useful enough IMO to warrant the annoyance, it's such a trivial thing to break people's projects over.

I like the idea of forcing this off for Android projects. I'm happy to introduce a configuration option here and set the default as described by @samskiter.

@Clans
Copy link

Clans commented May 30, 2016

+1 for removing this

@joelittlejohn
Copy link
Owner Author

joelittlejohn commented Aug 31, 2016

More problems caused by having this annotation:

https://github.com/andrewkandzuba/jsonschema2pojo-plugin-jdk9

/cc @andrewkandzuba

@joelittlejohn joelittlejohn modified the milestones: 0.4.26, 0.4.24 Aug 31, 2016
@ankon
Copy link
Contributor

ankon commented Oct 24, 2016

FWIW: I actually appreciated the Generated annotation on the generated files, because it made Eclipse aware that these files should not be edited.

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

No branches or pull requests

5 participants