spotless icon indicating copy to clipboard operation
spotless copied to clipboard

maven-plugin-development Gradle Plugin for Maven Plugin

Open JLLeitschuh opened this issue 5 years ago • 5 comments

There is now a Gradle Plugin to help Gradle developers produce Maven plugins.

https://github.com/britter/maven-plugin-development

If there's a desire to unify the build, this may help by allowing us to simplify the plugin development for this project: https://github.com/diffplug/spotless/tree/master/plugin-maven

JLLeitschuh avatar Apr 06 '20 13:04 JLLeitschuh

@lutovich just in case you didn't see this. I have no opinion either way.

nedtwigg avatar May 03 '20 04:05 nedtwigg

Interesting! This plugin could potentially simplify the build of spotless-maven-plugin

lutovich avatar May 03 '20 22:05 lutovich

Thanks to buildcache, our standard CI build is now ~45 seconds. But the maven builds are 7 - 10 minutes, every time. e.g. https://app.circleci.com/pipelines/github/diffplug/spotless/734/workflows/eb22b955-dd19-40a8-aaa3-bd6519d9ac84

The linked plugin recently added buildcache support: https://github.com/britter/maven-plugin-development/issues/7

It's not high on my todo, but it would be nice to slurp this in bring our average build times down a ton. Especially for new contributors, a clean build of a fresh clone takes a really long time, and most of that is maven.

nedtwigg avatar Oct 15 '20 19:10 nedtwigg

Hey everyone! Continuing discussion started here - https://github.com/diffplug/spotless/pull/1237

So the maven-plugin build is not fully cacheable. That's primarily because the dependencies needed for the build are downloaded into "localMavenRepository" folder every time the build is triggered (even if the inputs/outputs are specified properly). From what I can tell, the root cause lies in the "_remote.repositories" file, which contains date time and its changing from build to build. Example for antlr: #NOTE: This is an Aether internal implementation file, its format can be changed without prior notice. #Mon Jun 13 20:05:38 EEST 2022 antlr-2.7.2.jar>central= antlr-2.7.2.pom>central=

In order to fix this, that whole folder has to be cached (although normal dependency cache would probably be a better solution and a proper one I guess). Alternatively, the plugin mentioned above could solve this altogether, but I haven't checked it yet.

If you'd like, I can have a look at it and try to experiment with the build using the plugin.

welandaz avatar Jun 20 '22 19:06 welandaz

I would love a PR for this, thanks very much for investigating!

nedtwigg avatar Jun 20 '22 19:06 nedtwigg

I'm gonna take a whack at this.

nedtwigg avatar Jan 16 '23 22:01 nedtwigg

First publish of this new build is plugin-maven 2.31.0.

nedtwigg avatar Jan 26 '23 20:01 nedtwigg