GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Add enforceBytecodeVersion rule based on mojohaus by cstamas · Pull Request #968 · apache/maven-enforcer

Conversation

@cstamas

@cstamas cstamas commented Mar 25, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

This rule is very often used, and does not require anything special like new dependency, hence it should be among "built in" rules.

OTOH, it had issues, for example on larger multi projects did recheck same (potentially huge) JAR over and over again. It is now altered to not repeat same check (same options against same file) within same session.

This rule is 100% drop-in replacement for old uses (ITs are unmodified and just copied over), moreover rule itself has set priority that if enforce plugin gets updated with this rule, but the extra rules are present, the new rule will kick in. All the options are same as before, and rule name is unchanged as well.

Where it differs, and is reflected in ITs: is not so chatty as mojohaus one, it does not tell "skipped due scope", "skipped due regexp" etc, hence ITs are modified to simply assert for presence or absence of "[DEBUG] Analyzing GAV..." string instead.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@cstamas
Moved rule from mojohaus: enforceBytecodeVersion
c21f3ae
This rule is very often used, and does not require anything special
like new dependency, hence it should be among "built in" rules.

OTOH, it had issues, for example on larger multi projects did
recheck same (potentinally huge) JAR over and over again.
It is now altered to not repeat same check (same options
against same file).
@cstamas cstamas self-assigned this Mar 25, 2026
@cstamas
cstamas requested a review from slawekjaranowski March 25, 2026 15:34
slawekjaranowski
slawekjaranowski reviewed Mar 25, 2026
View reviewed changes
Comment thread ...r-rules/src/main/java/org/apache/maven/enforcer/rules/dependency/EnforceBytecodeVersion.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

slawekjaranowski
slawekjaranowski reviewed Mar 25, 2026
View reviewed changes
Comment thread ...r-rules/src/main/java/org/apache/maven/enforcer/rules/dependency/EnforceBytecodeVersion.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

cstamas added 3 commits March 25, 2026 19:44
@cstamas
Fix PR comments
1224fe5
@cstamas
Add way to disable optimization, if it comes in way
b366a55
@cstamas
Return "1.9"
9d1c700
@cstamas

cstamas commented Mar 25, 2026

Copy link
Copy Markdown
Member Author

Applied PR comments and added new option processOncePerSession (by def true), that if configured to false this rule will behave as before, to be able to disable optimization if it comes in way for any reason.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@slawekjaranowski

slawekjaranowski commented Mar 25, 2026

Copy link
Copy Markdown
Member

We also need to add a documentation.

I don't know why one test fail on Jenkins ...

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@slawekjaranowski

slawekjaranowski commented Mar 25, 2026

Copy link
Copy Markdown
Member

As it is a modified version not directly copied from mojohaus, maybe we can change tile of change to something like:

Add enforceBytecodeVersion rule based on mojohaus

To avoid questions about IP rights 😄

cstamas reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@cstamas cstamas changed the title Moved rule from mojohaus: enforceBytecodeVersion Add enforceBytecodeVersion rule based on mojohaus Mar 25, 2026
cstamas added 2 commits May 13, 2026 18:09
@cstamas
Merge remote-tracking branch 'origin/master' into enforce-bytecode-ve…
8529bd2
…rsion
@cstamas
Add doco
a25776f
@cstamas cstamas added the enhancement New feature or request label May 13, 2026
@cstamas
cstamas requested a review from slawekjaranowski May 14, 2026 09:08
slawekjaranowski
slawekjaranowski reviewed May 14, 2026
View reviewed changes
Comment thread pom.xml Outdated
<!-- the same as in Maven -->
<!-- all the same as in Maven -->
<resolver.version>1.9.25</resolver.version>
<version.plexus-utils>3.6.0</version.plexus-utils>

@slawekjaranowski slawekjaranowski May 14, 2026

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3.6.1 or 4.0.3 due to CVE
it is also in parent

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
slawekjaranowski
slawekjaranowski approved these changes May 14, 2026
View reviewed changes
cstamas added 3 commits May 14, 2026 19:01
@cstamas
Bring in parent; drop these
85ce261
@cstamas
Merge branch 'master' into enforce-bytecode-version
231c12b
@cstamas
Dropped too much
d149a02
@cstamas
cstamas merged commit 8e4f5b9 into master May 14, 2026
21 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@cstamas
cstamas deleted the enforce-bytecode-version branch May 14, 2026 17:44
@github-actions github-actions Bot added this to the 3.6.3 milestone May 14, 2026
@slawekjaranowski slawekjaranowski mentioned this pull request Oct 13, 2026
[MENFORCER-506] Move EnforceBytecodeVersion rule from extra-rules #878
Closed
@slawekjaranowski slawekjaranowski mentioned this pull request Nov 23, 2026
Bump extra-enforcer-rules from 1.12.1 to 1.13.0 codehaus-plexus/plexus-pom#471
Draft
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@slawekjaranowski slawekjaranowski slawekjaranowski approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@cstamas cstamas

Labels

enhancement New feature or request

Projects

None yet

Milestone

3.6.3

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@cstamas @slawekjaranowski
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.