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

Feature Request: Reactor support for enforceBytecodeVersion in extra-enforcer-rules #94

Open
ches opened this issue May 21, 2020 · 0 comments

Comments

@ches
Copy link

ches commented May 21, 2020

I have a situation where leaf application modules in a multi-module/Reactor build target Java 11, but a particular module needs to continue being able to run in Java 8 runtime environments, thus other library modules in the build that it depends on must also target 8.

I hoped that the enforceBytecodeVersion rule in extra-enforcer-rules would help to enforce this, but I tried the following configuration and the rule does not fail when class files of other modules that the one in question depends on are verifiably built with <release>11</release> / show major bytecode version 55 from javap.

<executions>
  <execution>
    <id>enforce-bytecode-version</id>
    <goals>
      <goal>enforce</goal>
    </goals>
    <configuration>
      <rules>
        <enforceBytecodeVersion>
          <maxJdkVersion>1.8</maxJdkVersion>
        </enforceBytecodeVersion>
      </rules>
      <fail>true</fail>
    </configuration>
  </execution>
</executions>

(also tried <maxJavaMajorVersionNumber>52</maxJavaMajorVersionNumber>)

So from cursory appearance, it seems the rule does not consider Reactor module dependencies. I didn't check implementation, I'm not acquainted with Maven plugin APIs, so apologies if I'm overlooking something.

@andham andham transferred this issue from mojohaus/mojo-parent May 22, 2020
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

No branches or pull requests

1 participant