Skip to content
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

Support for classpath resources for definitions and ignore lists #79

Closed
pwhittlesea opened this issue May 3, 2024 · 1 comment · Fixed by #80
Closed

Support for classpath resources for definitions and ignore lists #79

pwhittlesea opened this issue May 3, 2024 · 1 comment · Fixed by #80

Comments

@pwhittlesea
Copy link
Contributor

pwhittlesea commented May 3, 2024

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:

  • HTTP hosted files - As all of my code is in a private organization having a HTTP hosted file is not possible as the file can contain internal sensitive details (e.g. library names)
  • Absolute/relative file references - This is awkward as I would have to either copy a file into every repo or have the file present on my build system which can be fragile

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
Copy link
Owner

jonathanlermitage commented May 4, 2024

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants