Hacktoberfest 2026: as issues que os mantenedores marcaram para outubro, abertas e boas para iniciantes. Ver issues do Hacktoberfest

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

Aberta
#881 0 comentários 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 1 dia

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
4/5
Tempo estimado
3-5 dias
Facilidade para iniciantes
48/100
Tipo de issue
Refatoração
Clareza
Razoavelmente clara
Status de atividade
Ativa
Stack de tecnologia
java, kotlin
Domínio
build-system

Direção de pesquisa

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.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

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.

Linguagem predominante
Kotlin
Estrelas
824
Forks
175
Merge médio
2d 5h
PRs com merge (30d)
52

Preparar o ambiente

Este projeto não oferece contêiner de desenvolvimento, Dockerfile nem guia de contribuição, então a configuração fica por sua conta: comece pelo README e veja nosso guia da primeira contribuição para os passos gerais.

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de graphql-java-kickstart/graphql-java-tools

Todas as issues de graphql-java-kickstart/graphql-java-tools

Issues semelhantes

Mais issues de Kotlin

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.