Conversation
|
Yeah, I'll approve but why do we need shading in the first place here? [as there are no annotations that the prisms need in these packages right? so why the shading in the first place?] |
|
classes from http generater core is being used, if we unshaded it's possible for the classes used to not exist and thus fail compilation |
|
It relates to #120, where in that case the generator had a hard dependency on jackson and yet failed to find jackson classes while compiling in my project. From this I learned that relying on dependencies inside an AP is no bueno. |
Hmm, well imo this [AP through the maven-compiler] is the way the world is moving and especially maven 4. Need to keep that in mind. |
What makes you say that? |
|
The So yes the "provided scope implicit registration of annotation processors" ... is going to be increasingly discouraged. |
|
One of the things I've found in my experience is that IDEs have a very hard time working out what you mean when marking a dependency as However, because neither of those is transitive what I ended up doing in my annotation processor is creating a dependency for the generator that only contains the generated prisms (think
I'm not sure if maven doesn't pull transitive dependencies of something that's
Having
Still, I get that dropping the shading is a potentially breaking change - especially since the documentation on the Avaje website does things via |
What do you mean want to, they've already done it. APT is disabled unless you use proc=full or the maven annotation processor paths. Do you anticipate that that they will remove the flag from javac?
My issue was on the command line, not an IDE.
Jackson was
Oh no it does, only transitive provided dependencies of a provided dependency are not pulled. Which made the issue even more strange.
Don't feel like it, as I exclusively use |
To be clear SentryMan and I disagree on the
Yes, I think it is actually a good idea to look at this. As I see it, shading is kinda a hack and it will likely bite us at some point in the future so yes I think we need to look at removing it. The "dependency ... that only contains the generated prisms" sounds like a good option. |
if and when it does then I will gladly discard it. Intentionally introducing a breaking change on a mere "maybe" is unpalatable for me. The baseline for this project is java 11, the proc full change only happened in jdk 23+. Most people in my estimation are using java 17/21. |
Why do you think its going to be a breaking change to remove the shading? |
|
Because of the edge case where the project can fail to compile when using the provided scope due to missing classes. |
|
Yeah, I want to actually see that / do not understand what you mean yet.
This statement didn't actually make sense to me, in that a annotation processor isn't going to dependency that has provided scope - this is the thing to avoid (so we avoid it). So I don't see where the issue is yet. |
|
Look at #120 again, we did not have Jackson as a provided dependency and yet still the generator failed to find the classes |
|
Yeah, and that is extremely weird right, as in not expected at all ... so that makes me want to see if we can actually reproduce that somehow. To me, it feels like you are approximately saying annotation processors can't have any dependencies and I'm saying - "Nah mate, that should work fine" and I'm unconvinced. |
Now doesn't have clashing packages with the other generators. Resolves #741