Skip to content

Add Kotlin-in-Maven-project skill - #8

Open
e5l wants to merge 3 commits into
mainfrom
add-kotlin-to-maven-project-skill
Open

Add Kotlin-in-Maven-project skill#8
e5l wants to merge 3 commits into
mainfrom
add-kotlin-to-maven-project-skill

Conversation

@e5l

@e5l e5l commented Mar 17, 2026

Copy link
Copy Markdown
Member

Summary

  • Adds kotlin-tooling-add-kotlin-to-maven-project skill that guides configuring Kotlin in existing Java Maven projects
  • Uses kotlin-maven-plugin with <extensions>true</extensions> for minimal, clean mixed Java-Kotlin builds
  • Includes analysis script (scripts/analyze-maven-project.sh), verification checklist, and compiler plugins reference (Spring, JPA, serialization)

What the skill covers

  • Adding kotlin.version property and kotlin-maven-plugin with extensions
  • Test dependency setup (junit-jupiter-engine, kotlin-test-junit5)
  • Directory structure options (co-located .kt alongside .java vs separate kotlin/ dirs)
  • Multi-module Maven project guidance
  • Common issues and troubleshooting

Test plan

  • Tested against kotlin-junit-sample initial/ project
  • With-skill agent produced pom.xml closely matching expected complete/ output
  • Without-skill baseline used verbose old-style config (65+ extra XML lines, missed junit-jupiter-engine)
  • Build passed with 26 tests (Java + Kotlin) in both runs
  • Analysis script correctly detects configured vs unconfigured projects

🤖 Generated with Claude Code

Skill that guides configuring Kotlin in existing Java Maven projects
using kotlin-maven-plugin with <extensions>true</extensions> for
minimal, clean mixed Java-Kotlin builds.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@e5l
e5l force-pushed the add-kotlin-to-maven-project-skill branch from 9a4166f to 7d390df Compare March 18, 2026 12:00
@Tapchicoma

Copy link
Copy Markdown
Collaborator

Asked @shinkai-tester to verify this skill

@d-ambatenne d-ambatenne left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Discussed with Leonid, this skill is common for any Maven projects, not only for KSS

@shinkai-tester

shinkai-tester commented Mar 30, 2026

Copy link
Copy Markdown

Tested on two projects (used Claude Code):

What works well:

  • Migration succeeds on both single-module and multi-module projects
  • Both source layouts work (src/main|test/java and src/main|test/kotlin)
  • Cross-language references compile in both directions (Kotlin→Java and Java→Kotlin)
  • All tests pass

Issues found:

  1. The smart defaults the skill relies on - automatic kotlin-stdlib dependency and source directory registration via extensions set to true - require Kotlin 2.3.20 or later (not yet available). With the hardcoded 2.1.20 (Step 1: Add Kotlin Version Property), these features won't work. Maybe the skill should instruct the agent to fetch the latest stable version from https://mvnrepository.com/artifact/org.jetbrains.kotlin/kotlin-maven-plugin, and instruct that the minimum should be 2.3.20.
  2. "Compiler Plugins (Optional)" heading is misleading for Spring/JPA projects. The "(Optional)" label led the agent to skip compiler plugins on the first pass - but for Spring Boot + JPA projects, the spring and jpa plugins are effectively required. Suggestion: either remove "(Optional)" or reword to something like "Compiler Plugins (Framework-Dependent)" with clearer guidance that this step is required for Spring/JPA projects.

…ance

- Update hardcoded Kotlin 2.1.20 to 2.3.20 (minimum for extensions smart defaults)
- Add agent instructions to look up latest version on Maven Central
- Add minimum version note to "What extensions does" section
- Rename "Compiler Plugins (Optional)" to "Compiler Plugins (Framework-Dependent)"
- Add dependency-detection guidance for Spring/JPA/serialization plugins
- Update checklist with version requirement

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@e5l

e5l commented Apr 10, 2026

Copy link
Copy Markdown
Member Author

@shinkai-tester, fixed comments. please check it out

…ring

Spring Boot Kotlin applications (especially Spring Data JPA) need kotlin-reflect
at runtime for DI, AOP proxies, and Jackson's Kotlin module. kotlin-maven-plugin
with <extensions>true</extensions> adds kotlin-stdlib but not kotlin-reflect, and
without it these applications fail at runtime.

- SKILL.md: document kotlin-reflect as a Spring runtime dependency
- COMPILER-PLUGINS.md: note kotlin-reflect requirement in the Spring section
- checklist.md: add a kotlin-reflect check

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@shinkai-tester

Copy link
Copy Markdown

@shinkai-tester, fixed comments. please check it out

@e5l sorry for the delay, just got back from vacation. Looks good 👍

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.

4 participants