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

MuzzleCodeGenerationPlugin is not a proper Byte Buddy plugin #13611

Open
kriegaex opened this issue Mar 28, 2025 · 0 comments
Open

MuzzleCodeGenerationPlugin is not a proper Byte Buddy plugin #13611

kriegaex opened this issue Mar 28, 2025 · 0 comments
Labels
enhancement New feature or request needs triage New issue that requires triage

Comments

@kriegaex
Copy link

kriegaex commented Mar 28, 2025

Is your feature request related to a problem? Please describe.

The API docs for net.bytebuddy.build.Plugin say, among other things:

Plugin types must be public, non-abstract and must declare a public default constructor to work.

MuzzleCodeGenerationPlugin does not declare any default constructor, only a custom one accepting a URLClassLoader argument. I.e., the plugin neither works from Byte Buddy (BB) Maven nor BB Gradle plugin, only from the custom Gradle plugin. Otherwise, it would easily be possible to use the regular BB plugins, no custom plugin would be necessary. The apply interface method accepts 3 parameters, among them a ClassFileLocator which is completely ignored by MuzzleCodeGenerationPlugin in favour of the URLClassLoader.

Describe the solution you'd like

I suggest to refactor the plugin into something using BB infrastructure es intended, which in the end would mean less code to maintain (no more custom build plugin but the default BB build plugins for Maven and Gradle calling the BB plugin implementation via normal parametrisation). The build process for extensions would be closer to the standard BB provides infrastructure for, and on top of Gradle Maven would be supported out of the box.

Describe alternatives you've considered

No response

Additional context

See this related Stack Overflow question which I have answered, describing workarounds for Maven.

@kriegaex kriegaex added enhancement New feature or request needs triage New issue that requires triage labels Mar 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request needs triage New issue that requires triage
Projects
None yet
Development

No branches or pull requests

1 participant