Quarkus extension in Gradle Multi Module Project #31999
peterfortuin
started this conversation in
Community
Replies: 1 comment 1 reply
-
Yes that works, but is not documented at all. I had lots of fun figuring that out. Folder structure
My gradle files are in kotlin, if you use groovy you should be able to adapt them include("some-extension:deployment")
project(":some-extension:deployment").name = "some-extension-deployment"
include("some-extension:runtime")
project(":some-extension:runtime").name = "some-extension" Then in the deployment you need a build.gradle(.kts) val quarkusPlatformGroupId: String by project
val quarkusPlatformArtifactId: String by project
val quarkusPlatformVersion: String by project
dependencies {
implementation("io.quarkus:quarkus-core-deployment:$quarkusPlatformVersion")
annotationProcessor("io.quarkus:quarkus-extension-processor:${quarkusPlatformVersion}") // not sure if this is needed
// additional dependencies here
implementation(project(":some-extension:some-extension"))
} In the runtime you need a build.gradle(.kts) plugins {
id("io.quarkus.extension")
}
quarkusExtension {
deploymentModule.set("some-extension-deployment")
}
description = "Some description"
// you can set a with: version = "x.x.x" (make sure to also use that in the deployment)
val quarkusPlatformGroupId: String by project
val quarkusPlatformArtifactId: String by project
val quarkusPlatformVersion: String by project
dependencies {
implementation(enforcedPlatform("${quarkusPlatformGroupId}:${quarkusPlatformArtifactId}:${quarkusPlatformVersion}"))
implementation("io.quarkus:quarkus-core")
annotationProcessor("io.quarkus:quarkus-extension-processor:${quarkusPlatformVersion}")
} And in the root build file you configure the plugin version like so (inside the settings.gradle(.kts) pluginManagement {
val quarkusPluginVersion: String by settings
val quarkusPluginId: String by settings
repositories {
mavenCentral()
gradlePluginPortal()
mavenLocal()
}
plugins {
id(quarkusPluginId) version quarkusPluginVersion
id("io.quarkus.extension") version quarkusPluginVersion
}
} |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm wondering if it would be possible to write your own custom Quarkus extension inside a Gradle Multi Module project and also use that extension in a Quarkus services that is also in that same Gradle Multi Module project?
Beta Was this translation helpful? Give feedback.
All reactions