Skip to content

fix: read Java version from maven-compiler-plugin configuration - #679

Open
vibgrate-team wants to merge 1 commit into
mainfrom
cursor/maven-compiler-java-version-15f8
Open

vibgrate-team wants to merge 1 commit into
mainfrom
cursor/maven-compiler-java-version-15f8

Conversation

@vibgrate-team

Copy link
Copy Markdown
Contributor

Reads the Java version from maven-compiler-plugin configuration when no Java version property is set in <properties>.

What changed

  • parsePom still checks <properties> first (java.version, maven.compiler.source, maven.compiler.target, maven.compiler.release, java.source.version).
  • When none of those is set, it looks for maven-compiler-plugin under build.plugins and build.pluginManagement (single plugin or array, matched by artifactId) and reads <release>, then <source>, then <target>.
  • Values go through resolveProperty; anything still containing ${ is ignored.

Tests

test/maven-compiler-java-version.test.ts covers <release>17</release>, <source>11</source> fallback, a maven.compiler.release property still winning, ${jdk.version} resolution, <target>, both plugin locations as object and array, and an unresolved placeholder.

pnpm test, pnpm typecheck and pnpm lint pass.

Closes #658

parsePom only read java.version and maven.compiler.* properties, so a POM
that set the language level on maven-compiler-plugin reported no Java
runtime. When those properties are absent, read the plugin's release, then
source, then target, from build.plugins and build.pluginManagement, and
resolve ${property} references.

Signed-off-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: ABIZ - Agentic Business Record Standard <ops@to.co>
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 this pull request may close these issues.

Enhancement: read the Java version from maven-compiler-plugin <release> / <source> configuration

2 participants