Skip to content

Start work on the maven plugin #102

Closed

Description

@gaganis

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

Activity

  1. jbduncan commented on Apr 13, 2017

    @jbduncan
    Member

    Hi @gaganis, I haven't done any work towards the Maven plugin myself, but I don't know about @nedtwigg...

  2. nedtwigg commented on Apr 13, 2017

    @nedtwigg
    Member

    The maven plugin is completely greenfield. It's all yours :)

  3. jbduncan commented on May 30, 2017

    @jbduncan
    Member

    @gaganis Do you have any initial work that you can share with us, or has this fallen off your radar?

  4. gaganis commented on May 30, 2017

    @gaganis
    Author

    @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:
    https://gist.github.com/gaganis/fb0a8d1e27bbaf61281b9314a62bd95b

    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 😄

  5. jbduncan commented on May 31, 2017

    @jbduncan
    Member

    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 build.gradle in this brand-new project so it looks more like Spotless's, and then track down what's causing you problems.

  6. gaganis commented on Jun 5, 2017

    @gaganis
    Author

    Thank you for the feedback @jbduncan 😄 I will try your suggestion.

  7. jbduncan commented on Jun 5, 2017

    @jbduncan
    Member

    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. :)

  8. leonard84 commented on Jun 8, 2017

    @leonard84

    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.

  9. jbduncan commented on Jun 8, 2017

    @jbduncan
    Member

    @leonard84 That could be done, but it would mean that we couldn't share Gradle build script settings in build.gradle and gradle/*.gradle with the pom.xml, which would introduce build logic duplication, I suspect.

  10. nedtwigg commented on Jun 8, 2017

    @nedtwigg
    Member

    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 :)

  11. leonard84 commented on Jun 9, 2017

    @leonard84

    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.

  12. jbduncan commented on Jun 9, 2017

    @jbduncan
    Member

    @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). :)

  13. leonard84 commented on Jun 9, 2017

    @leonard84

    @jbduncan I created a small proof of concept here https://github.com/leonard84/spotless/tree/mvn-plugin
    It works by using a templated pom.xml and injects the gradle.properties, then it uses the maven-wrapper in an exec task to execute the maven build.

    What still needs to be done:

    • configure the maven plugins
    • figure out a way to use the spotless lib from the current project build
      • one way would be to depend on the install task of the lib to use the local maven repository
      • currently it just depends on the stable version
    • write the actual plugin
    • add mvn-invoker integration tests
  14. jbduncan commented on Jun 9, 2017

    @jbduncan
    Member

    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?

  15. 1 remaining item

  16. jbduncan commented on Jun 9, 2017

    @jbduncan
    Member

    @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. :)

  17. nedtwigg commented on Feb 12, 2018

    @nedtwigg
    Member

    Thanks to a tremendous effort from @lutovich, we now have a fantastic implementation of spotless-maven-plugin deployed to maven-central. You can see the docs here.

    We've currently shipped as 1.0.0.BETA1, but there are no known defects. It's only BETA because it hasn't been battle-tested on many projects yet.

    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 1.0 and trumpet its arrival more broadly.

  18. matthiasbalke commented on Feb 15, 2018

    @matthiasbalke
    Contributor

    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 generic.EndWithNewlineStep, generic.IndentStep, generic.TrimTrailingWhitespaceStep, generic.ReplaceStep and generic.ReplaceRegexStep. As soon as I'm finished with these simple steps I would like to implement a more complex one. Maybe groovy.GrEclipseFormatterStep. But let's start with the simple ones 😏

    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.

  19. nedtwigg commented on Feb 16, 2018

    @nedtwigg
    Member

    A publishing bug was found in 1.0.0.BETA1, fixed in 1.0.0.BETA2.

    @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

  20. nedtwigg commented on Mar 13, 2018

    @nedtwigg
    Member

    We introduced another bug in 1.0.0.BETA3, but fixed it in 1.0.0.BETA4. Thanks to #223, we now support Kotlin in addition to the Java and Scala we supported before. It seems to me that we're ready to cut the 1.0.0 release, and do some publicity, except that we don't have an open-source example project that we can point to. Anybody have anything open-source they can get a PR merged-in to?

    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.

  21. jbduncan commented on Mar 13, 2018

    @jbduncan
    Member

    @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. :)

  22. nedtwigg commented on Apr 27, 2018

    @nedtwigg
    Member

    Anybody have an example project we can link to yet?

  23. jbduncan commented on Apr 27, 2018

    @jbduncan
    Member

    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.

  24. nedtwigg commented on Jul 24, 2018

    @nedtwigg
    Member

    Bump: any opensource projects we can point to as an example?

  25. jbduncan commented on Jul 24, 2018

    @jbduncan
    Member

    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?

  26. nedtwigg commented on Jul 30, 2018

    @nedtwigg
    Member

    Great work @jbduncan, looks like spotless got merged into jung. Can I include this in the examples from the readme?

  27. jbduncan commented on Jul 30, 2018

    @jbduncan
    Member

    Certainly, go ahead! I'm sure @jrtom would be ok with this. :)

  28. jrtom commented on Jul 30, 2018

    @jrtom

    Yep, fine by me. :)

  29. nedtwigg commented on Aug 8, 2018

    @nedtwigg
    Member

    Huge thanks to @lutovich for pushing this to the finish line, but also to everybody who contributed great bug reports and fixes. Now that we have an example project thanks to @jbduncan and @jrtom, I think we're ready to publicize this a little. Here's the announcement tweet:

    https://twitter.com/NedTwigg/status/1027216025853415425

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions