AxonFramework / IdeaPlugin

An IntelliJ IDEA plugin for Axon Framework
Apache License 2.0
34 stars 21 forks source link

No Creator Found: with kotlin/gradle + java/maven multi-module project #256

Closed KahigaKiguru closed 1 year ago

KahigaKiguru commented 1 year ago

Basic information

Steps to reproduce

I run IntelliJ IDEA 2023.2.4 (Ultimate Edition) and Axon Framework Plugin v0.8.3

I have a global message library that contains all our commands, events, queries and projections, previously written in Java as Java Records then rewritten as Kotlin data classes.

This library is consumed by spring microservices that run with java 20, axon-starter 4.9.0 and spring-boot 3.1.5

When the Library was written in Java, the plugin could easily Identify and route all message types within the multimodule project. However, with kotlin nested data classes, the plugin errs with the message 'No creators of this Message Payload were found'

This happens with events, queries and commands.

I'm not entirely sure if it's the IDE since I'm running the latest version at the time of writing.

Writing large code-bases with the axon plugin malfunctioning is very difficult.

Thanks!

Expected behaviour

The plugin should route all message types and their handlers regardless of the implementation language so long as it is supported

Actual behaviour

The plugin errs with message :: No creators of this Message Payload were found for commands, events and queries with DTOs implemented as nested Kotlin Data Classes. Please describe the actual behaviour as discovered.

KahigaKiguru commented 1 year ago

Update, Turns out I need to use wildcard imports for nested data classes so that the plugin recognizes them as valid messages.

KahigaKiguru commented 1 year ago

I'll go ahead and close the issue - solved.

smcvb commented 1 year ago

Happy to hear you've found a solution to your predicament yourself, @KahigaKiguru! This info should proof useful for others facing the same situation.