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

Maven plugin should not need <extension>true</extension> #2145

Open
jakub-bochenski opened this issue Nov 27, 2024 · 3 comments
Open

Maven plugin should not need <extension>true</extension> #2145

jakub-bochenski opened this issue Nov 27, 2024 · 3 comments

Comments

@jakub-bochenski
Copy link
Contributor

jakub-bochenski commented Nov 27, 2024

I don't see the maven plugin doing anything that would require it to be an extension.

The main use case for declaring a plugin as an extension is:

plug-ins which provide lifecycle enhancements.

https://maven.apache.org/guides/mini/guide-using-extensions.html

On the other hand extension plugins can be very powerful -- which means they could be doing anything. And this makes the build significantly harder to understand.

If I remove the extension attribute the plugin no longer executes it's goals.

Using the extension mechanism just to register some executions (=save typing) it's wrong.

The documentation should explain why is the extension needed for.

If you want to keep using the extension to save typing, the documentation should also show how to configure the plugin manually without extensions.

@jakub-bochenski
Copy link
Contributor Author

In my case I changed the <extension>true</extension>
to

                <executions>
                    <execution>
                        <id>generate-tests</id>
                        <goals>
                            <goal>generateTests</goal>
                        </goals>
                    </execution>
                </executions>

Not only I can now understand the build just by reading the POM file. As a bonus I got rid of the convert and generateStubs executions that I had no use for.

@marcingrzejszczak
Copy link
Contributor

Hey, thank you for the feedback.

Nobody requires you to use the extensions. It's not mandatory to set them. If you don't want to set them just attach your executions to whatever phase you want.

Are you willing to file a PR to patch the documentation?

@jakub-bochenski
Copy link
Contributor Author

Sure, if you can point me to where the sources are - I can't seem to find them

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

3 participants