Skip to content

[#3879] Feature/introduce kotlin extension#3878

Draft
jangalinski wants to merge 970 commits intomainfrom
feature/introduce-kotlin-extension
Draft

[#3879] Feature/introduce kotlin extension#3878
jangalinski wants to merge 970 commits intomainfrom
feature/introduce-kotlin-extension

Conversation

@jangalinski
Copy link
Copy Markdown
Collaborator

@jangalinski jangalinski commented Nov 7, 2025

  • Import existing extension-kotlin into extensions/kotlin - keeping commit history
  • clean up maven setup and use correct parents
  • move everything not applicable (directly) to _todo

Closes AxonFramework/extension-kotlin#393. Takes over #3878 by @jangalinski.

Context

@jangalinski opened #3878 to import the extension-kotlin repository into
extensions/kotlin/ (with full commit history) and wire it into the monorepo build.
That PR intentionally stopped there: incompatible AF4 files were moved to _todo/
rather than rewritten, leaving the actual AF5 migration as follow-up work.

This PR completes that migration. The reference for every change is
extension-kotlin#394,
which performed the same migration against the standalone extension-kotlin
repository (targeting AF 5.1.0).


Differences from extension-kotlin#394

The monorepo integration required a few adjustments beyond a straight copy of the patch.

extensions/kotlin/pom.xml — parent and coordinates

PR#394 kept the standalone axon-kotlin-parent / 4.12.x-SNAPSHOT parent and
simply updated axon.version to 5.0.3.

Our branch replaces the entire parent with the monorepo coordinates:

  • parentaxon-extensions / 5.1.0-SNAPSHOT
  • version5.1.0-SNAPSHOT (inherited)
  • All standalone release/deploy/SCM infrastructure removed (sonatype, gpg, dokka,
    release-plugin, pluginRepositories, scm, developers, .github/, .editorconfig,
    mvnw, coverage-report/, etc.)
  • docs/ removed — AF4 Antora reference content imported via history, no AF5
    equivalent yet; reference docs update is a separate effort

Additionally the <log4j.version>2.13.3</log4j.version> property present in the
standalone pom was removed. In the monorepo it overrides the managed 2.25.3 version
and causes a Maven resolution failure (log4j-slf4j2-impl:2.13.3 does not exist in
Maven Central — only introduced in log4j 2.20).

CommandGatewayExtensions.ktsendAndWait null safety

CommandGateway.sendAndWait(Object, Class<R>) is @Nullable. PR#394 silently trusts
the platform type. Our branch adds ?: error(...) to fail fast with a clear message
pointing callers to sendForResult as the nullable alternative.

QueryUpdateEmitterExtensions.kt — type bound and SAM lambda

Two changes vs PR#394: Q : Any bound added (required to resolve the correct Java
overload), and filter wrapped in an explicit lambda to satisfy Predicate<? super Q>
unambiguously. @Suppress("UNCHECKED_CAST") covers the remaining compiler warning.


What was done (full summary)

Build (extensions/kotlin/pom.xml)

  • Parent changed to monorepo axon-extensions / 5.1.0-SNAPSHOT
  • Removed <log4j.version>2.13.3</log4j.version> (would break monorepo resolution)
  • Removed AF4 compile dependencies: jackson-module-kotlin,
    kotlinx-serialization-core, javax.xml.bind:jaxb-api
  • Removed all-open:annotation=...AggregateRoot compiler plugin option
  • axon-configurationaxon-messaging in dependency management

Deleted — AF4-only, no AF5 equivalent (yet)

File Reason
AggregateLifecycleExtensions.kt AggregateLifecycle / @AggregateRoot removed in AF5
BuilderExtensions.kt EventSourcingRepository / GenericJpaRepository builders not present in AF5
ResultDiscriminatorCommandCallback.kt CommandCallback / CommandResultMessage replaced by CommandResult
EventUpcaster.kt SingleEventUpcaster not available in AF5.0/5.1; tracked for 5.2
messaging/responsetypes/ArrayResponseType.kt AbstractResponseType removed; ResponseType hierarchy reworked
serialization/ (entire module) Serializer replaced by Converter; full rewrite out of scope — tracked as follow-up
META-INF/spring-devtools.properties Spring Boot DevTools dependency removed
All corresponding tests Deleted with their production classes

Rewritten for AF5

CommandGatewayExtensions.ktsend, sendForResult, sendAndWait over
CommandResult<R> (replaces AF4 CommandCallback / CommandResultMessage pattern).

QueryGatewayExtensions.ktquery, queryMany, subscriptionQuery retained;
scatterGather* replaced by streamingQuery; type bound R : Any on all functions
where R is used as Class<R>.

QueryUpdateEmitterExtensions.kt — package import updated to AF5;
Q : Any bound added; explicit SAM lambda for Predicate.

kotlin-test/FixtureExtensions.ktAggregateTestFixture / SagaTestFixture /
TestExecutor / ResultValidator replaced by the AF5 phase-based
AxonTestFixture / AxonTestPhase API; whenever(), whenever(command),
exception(KClass), exception(KClass, message) rewritten accordingly.

Tests

18 tests pass (12 in kotlin, 6 in kotlin-test). Test files are identical to
the ones in PR#394.

Documentation

README.md: versions 4.6.05.1.0-SNAPSHOT, CI/SonarCloud/CodeTriage badges
removed (standalone-repo artefacts), issue tracker URL updated to monorepo,
docs profile name corrected (javadoc-and-sourcesdocs-and-sources).


Out of scope / follow-up

Item Notes
KotlinSerializer / KotlinConverter Requires full rewrite against AF5 Converter API
EventUpcaster DSL SingleEventUpcaster absent from AF5.0/5.1; scheduled for 5.2

dgomezg and others added 30 commits July 3, 2024 09:22
Bumps the maven-dependencies group with 2 updates: [org.apache.maven.plugins:maven-surefire-plugin](https://github.com/apache/maven-surefire) and [io.projectreactor:reactor-core](https://github.com/reactor/reactor-core).


Updates `org.apache.maven.plugins:maven-surefire-plugin` from 3.3.0 to 3.3.1
- [Release notes](https://github.com/apache/maven-surefire/releases)
- [Commits](apache/maven-surefire@surefire-3.3.0...surefire-3.3.1)

Updates `io.projectreactor:reactor-core` from 3.6.7 to 3.6.8
- [Release notes](https://github.com/reactor/reactor-core/releases)
- [Commits](reactor/reactor-core@v3.6.7...v3.6.8)

---
updated-dependencies:
- dependency-name: org.apache.maven.plugins:maven-surefire-plugin
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: maven-dependencies
- dependency-name: io.projectreactor:reactor-core
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: maven-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
…endencies-1420651362

Bump the maven-dependencies group with 2 updates
Bumps the maven-dependencies group with 1 update: [org.apache.maven.plugins:maven-release-plugin](https://github.com/apache/maven-release).


Updates `org.apache.maven.plugins:maven-release-plugin` from 3.1.0 to 3.1.1
- [Release notes](https://github.com/apache/maven-release/releases)
- [Commits](apache/maven-release@maven-release-3.1.0...maven-release-3.1.1)

---
updated-dependencies:
- dependency-name: org.apache.maven.plugins:maven-release-plugin
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: maven-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
…endencies-f2fe579de3

Bump org.apache.maven.plugins:maven-release-plugin from 3.1.0 to 3.1.1 in the maven-dependencies group
Set since tag

#338
Revert Kotlin Serialization to 1.6.3 for backwards compatibility

#340
Move ArrayResponseType to message/responsetypes. In doing so, we reflect
 the folder structure for the other ResponseType implementation in Axon
 Framework

#338
Expand KDoc with construction example

#338
Upgrade Axon Framework to 4.10.0

#dependency-upgrade/af-4.10
Set version to 4.10.0 for release

#release/4.10.0
Set milestone to 4.11.0

#release/4.10.0
Update version of non-deployed modules

#release/4.10.0
Bumps the maven-dependencies group with 4 updates: [org.jetbrains.kotlinx:kotlinx-serialization-core](https://github.com/Kotlin/kotlinx.serialization), [org.jetbrains.kotlinx:kotlinx-serialization-json](https://github.com/Kotlin/kotlinx.serialization), [org.jetbrains.kotlinx:kotlinx-serialization-cbor](https://github.com/Kotlin/kotlinx.serialization) and [org.jetbrains.kotlinx:kotlinx-serialization-protobuf](https://github.com/Kotlin/kotlinx.serialization).


Updates `org.jetbrains.kotlinx:kotlinx-serialization-core` from 1.6.3 to 1.7.1
- [Release notes](https://github.com/Kotlin/kotlinx.serialization/releases)
- [Changelog](https://github.com/Kotlin/kotlinx.serialization/blob/master/CHANGELOG.md)
- [Commits](Kotlin/kotlinx.serialization@v1.6.3...v1.7.1)

Updates `org.jetbrains.kotlinx:kotlinx-serialization-json` from 1.6.3 to 1.7.1
- [Release notes](https://github.com/Kotlin/kotlinx.serialization/releases)
- [Changelog](https://github.com/Kotlin/kotlinx.serialization/blob/master/CHANGELOG.md)
- [Commits](Kotlin/kotlinx.serialization@v1.6.3...v1.7.1)

Updates `org.jetbrains.kotlinx:kotlinx-serialization-cbor` from 1.6.3 to 1.7.1
- [Release notes](https://github.com/Kotlin/kotlinx.serialization/releases)
- [Changelog](https://github.com/Kotlin/kotlinx.serialization/blob/master/CHANGELOG.md)
- [Commits](Kotlin/kotlinx.serialization@v1.6.3...v1.7.1)

Updates `org.jetbrains.kotlinx:kotlinx-serialization-protobuf` from 1.6.3 to 1.7.1
- [Release notes](https://github.com/Kotlin/kotlinx.serialization/releases)
- [Changelog](https://github.com/Kotlin/kotlinx.serialization/blob/master/CHANGELOG.md)
- [Commits](Kotlin/kotlinx.serialization@v1.6.3...v1.7.1)

Updates `org.jetbrains.kotlinx:kotlinx-serialization-json` from 1.6.3 to 1.7.1
- [Release notes](https://github.com/Kotlin/kotlinx.serialization/releases)
- [Changelog](https://github.com/Kotlin/kotlinx.serialization/blob/master/CHANGELOG.md)
- [Commits](Kotlin/kotlinx.serialization@v1.6.3...v1.7.1)

Updates `org.jetbrains.kotlinx:kotlinx-serialization-cbor` from 1.6.3 to 1.7.1
- [Release notes](https://github.com/Kotlin/kotlinx.serialization/releases)
- [Changelog](https://github.com/Kotlin/kotlinx.serialization/blob/master/CHANGELOG.md)
- [Commits](Kotlin/kotlinx.serialization@v1.6.3...v1.7.1)

Updates `org.jetbrains.kotlinx:kotlinx-serialization-protobuf` from 1.6.3 to 1.7.1
- [Release notes](https://github.com/Kotlin/kotlinx.serialization/releases)
- [Changelog](https://github.com/Kotlin/kotlinx.serialization/blob/master/CHANGELOG.md)
- [Commits](Kotlin/kotlinx.serialization@v1.6.3...v1.7.1)

---
updated-dependencies:
- dependency-name: org.jetbrains.kotlinx:kotlinx-serialization-core
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: maven-dependencies
- dependency-name: org.jetbrains.kotlinx:kotlinx-serialization-json
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: maven-dependencies
- dependency-name: org.jetbrains.kotlinx:kotlinx-serialization-cbor
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: maven-dependencies
- dependency-name: org.jetbrains.kotlinx:kotlinx-serialization-protobuf
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: maven-dependencies
- dependency-name: org.jetbrains.kotlinx:kotlinx-serialization-json
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: maven-dependencies
- dependency-name: org.jetbrains.kotlinx:kotlinx-serialization-cbor
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: maven-dependencies
- dependency-name: org.jetbrains.kotlinx:kotlinx-serialization-protobuf
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: maven-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
…endencies-92cb11aacb

Bump the maven-dependencies group with 4 updates
Set version to 4.11.0-SNAPSHOT for main branch

#release/4.10.0
Revert to 1.6.3 for backwards compatibility

#347
Bumps the maven-dependencies group with 4 updates: [org.jetbrains.kotlinx:kotlinx-serialization-core](https://github.com/Kotlin/kotlinx.serialization), [org.jetbrains.kotlinx:kotlinx-serialization-json](https://github.com/Kotlin/kotlinx.serialization), [org.jetbrains.kotlinx:kotlinx-serialization-cbor](https://github.com/Kotlin/kotlinx.serialization) and [org.jetbrains.kotlinx:kotlinx-serialization-protobuf](https://github.com/Kotlin/kotlinx.serialization).


Updates `org.jetbrains.kotlinx:kotlinx-serialization-core` from 1.6.3 to 1.7.1
- [Release notes](https://github.com/Kotlin/kotlinx.serialization/releases)
- [Changelog](https://github.com/Kotlin/kotlinx.serialization/blob/master/CHANGELOG.md)
- [Commits](Kotlin/kotlinx.serialization@v1.6.3...v1.7.1)

Updates `org.jetbrains.kotlinx:kotlinx-serialization-json` from 1.6.3 to 1.7.1
- [Release notes](https://github.com/Kotlin/kotlinx.serialization/releases)
- [Changelog](https://github.com/Kotlin/kotlinx.serialization/blob/master/CHANGELOG.md)
- [Commits](Kotlin/kotlinx.serialization@v1.6.3...v1.7.1)

Updates `org.jetbrains.kotlinx:kotlinx-serialization-cbor` from 1.6.3 to 1.7.1
- [Release notes](https://github.com/Kotlin/kotlinx.serialization/releases)
- [Changelog](https://github.com/Kotlin/kotlinx.serialization/blob/master/CHANGELOG.md)
- [Commits](Kotlin/kotlinx.serialization@v1.6.3...v1.7.1)

Updates `org.jetbrains.kotlinx:kotlinx-serialization-protobuf` from 1.6.3 to 1.7.1
- [Release notes](https://github.com/Kotlin/kotlinx.serialization/releases)
- [Changelog](https://github.com/Kotlin/kotlinx.serialization/blob/master/CHANGELOG.md)
- [Commits](Kotlin/kotlinx.serialization@v1.6.3...v1.7.1)

Updates `org.jetbrains.kotlinx:kotlinx-serialization-json` from 1.6.3 to 1.7.1
- [Release notes](https://github.com/Kotlin/kotlinx.serialization/releases)
- [Changelog](https://github.com/Kotlin/kotlinx.serialization/blob/master/CHANGELOG.md)
- [Commits](Kotlin/kotlinx.serialization@v1.6.3...v1.7.1)

Updates `org.jetbrains.kotlinx:kotlinx-serialization-cbor` from 1.6.3 to 1.7.1
- [Release notes](https://github.com/Kotlin/kotlinx.serialization/releases)
- [Changelog](https://github.com/Kotlin/kotlinx.serialization/blob/master/CHANGELOG.md)
- [Commits](Kotlin/kotlinx.serialization@v1.6.3...v1.7.1)

Updates `org.jetbrains.kotlinx:kotlinx-serialization-protobuf` from 1.6.3 to 1.7.1
- [Release notes](https://github.com/Kotlin/kotlinx.serialization/releases)
- [Changelog](https://github.com/Kotlin/kotlinx.serialization/blob/master/CHANGELOG.md)
- [Commits](Kotlin/kotlinx.serialization@v1.6.3...v1.7.1)

---
updated-dependencies:
- dependency-name: org.jetbrains.kotlinx:kotlinx-serialization-core
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: maven-dependencies
- dependency-name: org.jetbrains.kotlinx:kotlinx-serialization-json
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: maven-dependencies
- dependency-name: org.jetbrains.kotlinx:kotlinx-serialization-cbor
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: maven-dependencies
- dependency-name: org.jetbrains.kotlinx:kotlinx-serialization-protobuf
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: maven-dependencies
- dependency-name: org.jetbrains.kotlinx:kotlinx-serialization-json
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: maven-dependencies
- dependency-name: org.jetbrains.kotlinx:kotlinx-serialization-cbor
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: maven-dependencies
- dependency-name: org.jetbrains.kotlinx:kotlinx-serialization-protobuf
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: maven-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
…endencies-92cb11aacb

Bump the maven-dependencies group with 4 updates
Disable auto merge to catch undesired dep. upgrades

#348
vcanuel added 2 commits March 11, 2026 23:22
…3878)

- Replace parent with monorepo axon-extensions / 5.1.0-SNAPSHOT
- Remove log4j.version override that breaks monorepo Maven resolution
- Delete AF4-only files: AggregateLifecycleExtensions, BuilderExtensions,
  EventUpcaster, ResultDiscriminatorCommandCallback, ArrayResponseType,
  serialization module, spring-devtools.properties and all their tests
- Rewrite CommandGatewayExtensions for AF5 CommandResult API
- Rewrite QueryGatewayExtensions for AF5 (R:Any bound, streamingQuery)
- Rewrite QueryUpdateEmitterExtensions for AF5 (Q:Any, explicit SAM lambda)
- Rewrite FixtureExtensions for AF5 AxonTestPhase API
- All 18 tests pass
vcanuel added a commit to vcanuel/AxonFramework that referenced this pull request Mar 12, 2026
…xonIQ#3878)

- Replace parent with monorepo axon-extensions / 5.1.0-SNAPSHOT
- Remove log4j.version override that breaks monorepo Maven resolution
- Delete AF4-only files: AggregateLifecycleExtensions, BuilderExtensions,
  EventUpcaster, ResultDiscriminatorCommandCallback, ArrayResponseType,
  serialization module, spring-devtools.properties and all their tests
- Rewrite CommandGatewayExtensions for AF5 CommandResult API
- Rewrite QueryGatewayExtensions for AF5 (R:Any bound, streamingQuery)
- Rewrite QueryUpdateEmitterExtensions for AF5 (Q:Any, explicit SAM lambda)
- Rewrite FixtureExtensions for AF5 AxonTestPhase API
- All 18 tests pass
…editorconfig, .gitattributes, CONTRIBUTING.md, LICENSE.txt, mvnw, docs, coverage-report)
@smcvb
Copy link
Copy Markdown
Contributor

smcvb commented Mar 17, 2026

Closing this PR in favor of the #4281 PR.

@smcvb smcvb closed this Mar 17, 2026
@smcvb smcvb removed this from the Release 5.1.0 milestone Mar 17, 2026
@smcvb smcvb added the Status: Obsolete Use to signal this issue is no longer necessary. label Mar 17, 2026
@jangalinski jangalinski reopened this Mar 17, 2026
@jangalinski jangalinski modified the milestone: Release 5.2.0 Mar 17, 2026
@jangalinski jangalinski removed Status: Obsolete Use to signal this issue is no longer necessary. labels Mar 17, 2026
@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@hjohn
Copy link
Copy Markdown
Contributor

hjohn commented Apr 9, 2026

I didn't see any problems importing this in Eclipse (without a Kotlin plugin).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Priority 2: Should High priority. Ideally, these issues are part of the release they’re assigned to. Type: Feature Use to signal an issue is completely new to the project.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Migrate Kotlin extension to Axon Framework 5

10 participants