jborgers / PMD-jPinpoint-rules

PMD rule set for responsible Java and Kotlin coding: performance, sustainability, multi-threading, data mixup and more.
Apache License 2.0
43 stars 10 forks source link

Release into maven central? #179

Open nielsbasjes opened 2 years ago

nielsbasjes commented 2 years ago

My suggestion is to release the rulesets/java/jpinpoint-rules.xml wrapped in a versioned jar file into maven central.

The reason is that projects that want to use your rules can then do something like this (partially tested example):

<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-pmd-plugin</artifactId>
  <version>${maven-pmd-plugin.version}</version>
  <dependencies>
    <dependency>
      <groupId>io.github.jborgers</groupId>
      <artifactId>PMD-jPinpoint-rules</artifactId>
      <version>1.2.3</version>
    </dependency>
  </dependencies>
  <configuration>
    <rulesets>
      <!-- The JPinpoint ruleset -->
      <ruleset>/rulesets/java/jpinpoint-rules.xml</ruleset>
    </rulesets>
  </configuration>
  <executions>
    <execution>
      <id>validate bugs</id>
      <phase>validate</phase>
      <goals>
        <goal>check</goal>
      </goals>
    </execution>
  </executions>
</plugin>

With that projects can use tools like renovate or dependabot to automate updating the rules.

Possibly useful tooling to make this as easy as possible: https://github.com/semantic-release/semantic-release https://docs.github.com/en/actions/publishing-packages/publishing-java-packages-with-maven#publishing-packages-to-github-packages

emouty commented 3 months ago

With the breaking changes introduced with pmd 7.x.x and the work on https://github.com/jborgers/PMD-jPinpoint-rules/tree/pmd7-upgrade-7.2.0 this would be a nice to have :smiley: