Maven: check the Java target in pom.xml

Aperta
#59 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@evalogical-lab ci sta già lavorando.

Dal 13/11/2026.

  • #64 di @evalogical-lab — aperta

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
22/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
java, python
Ambito
cli, tooling

Direzione di ricerca

Start in checks/runtimes.py beside the existing project.java.pin row, then look at explain.py and docs/checks.md, which need matching rows. Tests should cover the pom.xml cases, including a hostile file and an undefined ${property}. Open pull request #64 already targets this issue, so check with the maintainers before starting. Done means the Java 11 vs 17 case reports one fail, and pytest, ruff check and ruff format --check pass.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

enhancement

Problem: DevReady reads the Java version from .java-version and .tool-versions, but a Maven project declares its Java target in pom.xml. On a machine with Java 11, a project that requires 17 builds fail with a compiler error and DevReady reports nothing useful.

Do:

  • Add a literal pin extractor for pom.xml in checks/runtimes.py, next to the existing project.java.pin row, so the Java check only runs when the file declares a target.
  • Recognize, in this order:
    • <maven.compiler.release>17</maven.compiler.release>
    • <release>17</release> inside maven-compiler-plugin
    • <maven.compiler.source> / <maven.compiler.target> (take 1.8 as 1.8)
  • Resolve a ${property} reference only when the same file defines that property; otherwise report skip rather than guess.
  • Parse line-based literals only (no XML entity handling, no file content echoed), and reuse the existing version matcher.
  • New id project.java.maven; title like Java (Maven); a mismatch is a fail (a build requirement).
  • Add explain.py and docs/checks.md rows, a CHANGELOG line, and unit tests including a hostile pom.xml.

Done when:

  • A pom.xml with maven.compiler.release 17 on a Java 11 machine reports one fail naming 17 and the installed version.
  • A pom.xml with no compiler target adds no result.
  • ${java.version} resolves when defined in the same file; an undefined property reports skip and never echoes the file.
  • pytest, ruff check and ruff format --check pass.

Notes:

  • Maven's real resolution (parent POMs, profiles, ~/.m2/settings.xml) is out of scope; that is why unknown specs stay skip.
  • Read-only like every other check: no mvn invocation.
Lingua principale
Python
Stelle
2
Fork
3
Merge medio
10h 51m
PR unite (30g)
40

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di Evalogical-Inc/devReady

Tutte le issue di Evalogical-Inc/devReady

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.