Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Use Kotlin's documented Maven setup to compile Kotlin before Java

Aperta
#881 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
48/100
Tipo di issue
Refactoring
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
java, kotlin
Ambito
build-system

Direzione di ricerca

Read the Maven configuration for kotlin-maven-plugin and maven-compiler-plugin, including default-testCompile and the java17-tests profile. Compare it with the Kotlin Maven guide's second setup option, then check how module-info.java and the release profile's source and javadoc jars depend on the current executions. Done means Kotlin and Java compile in the required order across these configurations with no behavior change.

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

Descrizione

We get Kotlin compiled before javac by binding the Kotlin executions to earlier phases: compile runs at process-sources, and since #879 test-compile runs at process-test-sources. #879 needed that so ResolverMethodsTest.java could call the Kotlin assertEveryFieldResolves helper. Without it, javac compiled the Java tests before any Kotlin test class existed.

It works, but it isn't how Kotlin's docs say to do it. The Maven guide has two options:

  • <extensions>true</extensions> on kotlin-maven-plugin, declared before maven-compiler-plugin. It adds the Kotlin executions itself, and the docs say not to configure the compiler plugin's executions with it.
  • Keep the Kotlin executions at compile / test-compile, set default-compile and default-testCompile to <phase>none</phase>, and add java-compile / java-test-compile executions after Kotlin.

The second one probably fits better, since we already configure default-testCompile (useModulePath=false, with a TODO for 15.0.0) and the java17-tests profile adds its own java17-test-compile execution. Both have to keep working, along with module-info.java and the release profile's source and javadoc jars.

No behaviour change, it's build cleanup only.

Lingua principale
Kotlin
Stelle
824
Fork
175
Merge medio
2g 5h
PR unite (30g)
53

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

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 graphql-java-kickstart/graphql-java-tools

Tutte le issue di graphql-java-kickstart/graphql-java-tools

Issue simili

Altre issue su Kotlin

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.