-
Notifications
You must be signed in to change notification settings - Fork 463
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
Start work on the maven plugin #102
Comments
The maven plugin is completely greenfield. It's all yours :) |
@gaganis Do you have any initial work that you can share with us, or has this fallen off your radar? |
@jbduncan Unfortunately I have nothing working to share. I tried starting with building a hello world maven plugin in the gradle build of spotless but despite putting quite an effort I was unable to make it work. I tried using https://dev.liferay.com/develop/reference/-/knowledge_base/7-0/maven-plugin-builder-gradle-plugin and also using mavenEmbedder directly but I got stuck which is why I did no progress. My latest non-working attempt was using the following maven-plugin build.gradle file: This is definitely still on my radar and I am planning to give it another try. Any help on building the plugin would be very welcome 😄 |
May I suggest applying maven-plugin-builder-gradle-plugin to a brand-new Gradle Java project, where its only Java source file is a "Hello World" Mojo (as described near the start of https://maven.apache.org/guides/plugin/guide-java-plugin-development.html)? If you can get your head around that, then you may be able to gradually build up the |
Thank you for the feedback @jbduncan 😄 I will try your suggestion. |
You're welcome @gaganis. I'm sorry that I can't provide any easier-to-follow or more specific advice in this situation. I wish you best of luck with these endeavours. :) |
An alternative would be to use maven directly, with maven-wrapper and a pom.xml. The reason for that being that maven has great support for generating its plugins, e.g. maven-invoker integration tests and so on. |
@leonard84 That could be done, but it would mean that we couldn't share Gradle build script settings in |
We're happy to take whatever is easiest - duplicating build logic in maven might be easier than reinventing maven's plugin development in gradle. Author's choice :) |
Spring Boot does it the other way round (building gradle-plugin within a maven project) https://github.com/spring-projects/spring-boot/tree/master/spring-boot-tools. You basically need to write an adapter build.gradle file that calls maven. |
@leonard84 That sounds like a neat idea IMO. (Having viewed how Spring Boot does it with Maven-to-Gradle, it seems perfectly doable the other way around.) In that case, I'm happy regardless of whether the Maven plugin is managed with Gradle or Maven, since we can eventually tie everything with Gradle if needed (as future work). :) |
@jbduncan I created a small proof of concept here https://github.com/leonard84/spotless/tree/mvn-plugin What still needs to be done:
|
Looks good so far @leonard84! I just have a couple of comments (1, 2) about the current implementation, but other than that, it looks like a good starting point. But first of all, if you're intending continue, then I'd encourage you to wait a bit, as I believe @gaganis is still working on this himself. @gaganis, do you find @leonard84's contribution so far helpful for your own efforts? Would you be happy if @leonard84 continues down his own avenue, on the understanding that he may tread on your toes? Overall, is this issue something that you still want to work on? |
@leonard84 Sorry, didn't actually link the comments that I talked about. Here they are: 1, 2. |
@leonard84 Oh I beg your pardon! 🙇♂️ @nedtwigg tells me that it's much better to freely allow people to develop code on GitHub without feeling that they're being co-ordinated; to allow so-called "permissionless innovation", since it gets things done quicker. So please disregard my earlier comment on waiting up a bit. By all means, continue with your efforts at whatever pace that you feel comfortable with. :) |
Thanks to a tremendous effort from @lutovich, we now have a fantastic implementation of We've currently shipped as We'd love some example projects to link to for the example configurations section, please give it a try and let us know how it goes. Once we've got a couple examples to link to, we'll release the real |
First of all thank you very very much @lutovich for implementing the first version of the maven plugin of spotless! This is a big step for maven projects! Second I would like to contribute some more steps like I'll plan to start this afternoon (~ 16:00 MEZ / 8:00 PST). Just let me know if any of you are already implementing those, so we don't do the same work. |
A publishing bug was found in @matthiasbalke - great, I think you're the only one working on these, and they would be great to have! If you have any questions, feel free to ask in https://gitter.im/diffplug/spotless |
We introduced another bug in I think we've had something really useful to people for about a month now, would be a shame to keep it under wraps for longer just cuz there's no example project. |
@nedtwigg For various reasons, it's taking longer than expected for jrtom/jung#198 to be merged in to allow JUNG to be used as an example project. I'll let you know when I know more. :) |
Anybody have an example project we can link to yet? |
So sorry @nedtwigg, not sure yet still when my PR for JUNG will be looked at. :( I'll let you know when I know more. |
Bump: any opensource projects we can point to as an example? |
Oops, JUNG still can't be used as an example, as @jrtom and I have not been doing anything for that project for quite a while now! Any others? |
Great work @jbduncan, looks like spotless got merged into jung. Can I include this in the examples from the readme? |
Certainly, go ahead! I'm sure @jrtom would be ok with this. :) |
Yep, fine by me. :) |
Hello All,
I was thinking on starting work for the maven plugin, so this issue is to ask whether anyone has already started to work, and to act as a placeholder for related discussion.
Thanks
Giorgos
The text was updated successfully, but these errors were encountered: