jonathanlermitage / oga-maven-plugin

:jigsaw: Old GroupIds Alerter - A Maven plugin that checks for deprecated groupId+artifactId (e.g. did you know that graphql-spring-boot-starter moved from com.graphql-java to com.graphql-java-kickstart?).
https://central.sonatype.com/search?q=biz.lermitage.oga
MIT License
38 stars 7 forks source link

Support for classpath resources for definitions and ignore lists #79

Closed pwhittlesea closed 3 months ago

pwhittlesea commented 3 months ago

I am using a Maven aggregator pom to set up common plugins that are used across many projects. I use this to set coding standards throughout these projects (PMD, Checkstyle, Spotless, etc) and one of the checks I run is for out of date dependencies, using this plugin 😄

This 'parent pom' is an aggregator project and as such cannot include files for use in downstream projects. When the checks are run I would like to have a constant set of ignores and definitions across all of the projects which use this parent.

Currently this plugin gives me two options:

When using other plugins like PMD you can include a dependency in the plugin definition which allows usage of a classpath file:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-pmd-plugin</artifactId>
    <configuration>
        <rulesets>
            <ruleset>pmd_rules.xml</ruleset>
        </rulesets>
    </configuration>
    <dependencies>
        <dependency>
            <groupId>uk.me.thega</groupId>
            <artifactId>all-of-my-plugin-config-files</artifactId>
            <version>1.0.0</version>
        </dependency>
    </dependencies>
</plugin>

This allows all downstream projects to have the same configuration applied without having to copy and paste the configuration around (or web host it).

Is this behavior possible already and I am missing something or do we think it is valuable to add?

I already have an initial version of support here and I am happy to write some tests and create a PR.

I think there is an initial step where support could be added for the file properties, but ultimately we could switch the configuration to remove the different concepts for 'file' and 'url' and do something similar to PMD (see above) where you can just add paths. But that would be a bigger, breaking change.

jonathanlermitage commented 3 months ago

Hi! I think this would be a great addition. I don't have a lot a free time these days, so contributions are highly appreciated. Thanks!