Uploaded image for project: 'Maven Enforcer Plugin'
  1. Maven Enforcer Plugin
  2. MENFORCER-473

Custom Rules are not processed with Java 17

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 3.2.1
    • None
    • externalRules, Plugin, Rule API
    • None
    • Windows, Java 17

    Description

      Hi,

      We noticed that our custom rule, using the newer API (as documented here) is not processed using Java 17.

      We created a sample project using the custom rule example. Once we use Java 17 in the pom.xml it breaks.

      <properties>
      	<api.version>3.2.1</api.version>
      	<maven.version>3.9.0</maven.version>
      	<!-- use JDK 1.8 at least -->
      	<maven.compiler.source>17</maven.compiler.source>
      	<maven.compiler.target>17</maven.compiler.target>
      </properties>
      ...
      <plugin>
      	<groupId>org.apache.maven.plugins</groupId>
      	<artifactId>maven-compiler-plugin</artifactId>
      	<version>3.11.0</version>
      </plugin>
      <plugin>
      	<!-- generate index of project components -->
      	<groupId>org.eclipse.sisu</groupId>
      	<artifactId>sisu-maven-plugin</artifactId>
      	<version>0.9.0.M1</version>
      	<executions>
      		<execution>
      			<goals>
      				<goal>main-index</goal>
      			</goals>
      		</execution>
      	</executions>
      </plugin>
      

      If we compile the custom rule and verify the using project, we get

      [ERROR] Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:3.2.1:enforce (enforce) on project maven-enforcer-plugin-sample-usage: Execution enforce of goal org.apache.maven.plugins:maven-enforcer-plugin:3.2.1:enforce failed: Failed to create enforcer rules with name: myCustomRule or for class: org.apache.maven.plugins.enforcer.MyCustomRule -> [Help 1]
      

      The index file itself looks good, so something else within the plugin or Sisu Plexus seems to break.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              Nils Nils Christian Ehmke
              Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated: