-
Notifications
You must be signed in to change notification settings - Fork 458
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
Make plugin-maven use local config files if possible #572
Conversation
@lutovich I know this doesn't solve our big problem, but do you see any downsides to this tiny PR? If not I will merge. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't think of any downsides 👍
Javadoc for this method could be adjusted to say that the method doesn't always copy the file.
plugin-maven/src/main/java/com/diffplug/spotless/maven/FileLocator.java
Outdated
Show resolved
Hide resolved
Thanks for the feedback, good call. While we're at it, do you think there's any chance that we could take your filename-is-hash idea, and have just one resource manager in the root project, so that all subprojects are extracting resources to the same place? It's a performance optimization to know "if my filename hash is there, it's already been extracted before by someone else", and I think it would also solve #559. |
@nedtwigg IIRC Maven modules should be independent and not rely on files from parent modules. We've explored an idea to scan parent modules for config files here but decided not to do this to keep modules self-container. I think this issue helped us to decide. Feels like having a common place for config files could result in a similar any-pattern. |
Interesting. It is usually a bad idea to work against the container you're in, but I also think container designers are not infallible. In gradle, we've fought platform conventions a bit in a few minor ways, and in hindsight I'm still quite happy with all of those decisions. IMO, there's a difference between "the child project cannot function unless the parent project does something" versus "every child project is going to perform the exact same operation, so using a central caching location can improve performance and reduce the number of moving parts, which reduces complexity". The projects are already sharing a But I'm maven-illiterate, so it's very possible there's more to the firewalled projects than I appreciate. Definitely FileSignature needs to be improved someday anyway, but that looks to be pretty distant. The gitattributes thing is a hairy problem, and my Spotless time is waaaayyyy over its budget atm. As a semi-related aside, I just merged in the public abstract class GitRatchet<Project> {
protected abstract Project parentOfProject(Project project)
...
} It works great in Gradle, but I wasn't sure if maven provided an analogous project class but thanks to checkstyle it looks like it is possible! It's very low on my prio-list, but I think adding |
Released in |
There are downsides to this approach, just pushing up to demonstrate a point for #571