Reputation: 1395
I tried to add an extension with command .\gradlew addExtension --extensions=io.quarkus:quarkus-resteasy-mutiny --stacktrace
. I got the following error:
Caused by: org.gradle.api.GradleException: No platforms detected in the project
at io.quarkus.gradle.tasks.QuarkusPlatformTask.platformDescriptor(QuarkusPlatformTask.java:45)
at io.quarkus.gradle.tasks.QuarkusPlatformTask.getQuarkusProject(QuarkusPlatformTask.java:188)
at io.quarkus.gradle.tasks.QuarkusAddExtension_Decorated.getQuarkusProject(Unknown Source)
at io.quarkus.gradle.tasks.QuarkusAddExtension.addExtension(QuarkusAddExtension.java:59)
I figured something is lacking in the configuration, but I can't find what.
My build.gradle
file:
plugins {
// Apply the application plugin to add support for building a CLI application in Java.
id 'application'
id 'io.quarkus'
}
repositories {
// Use JCenter for resolving dependencies.
jcenter()
mavenCentral()
gradlePluginPortal()
}
dependencies {
// Use JUnit test framework.
testImplementation 'junit:junit:4.13'
// This dependency is used by the application.
implementation group: 'io.quarkus', name: 'quarkus-resteasy', version: '1.12.2.Final'
implementation group: 'io.quarkus', name: 'quarkus-resteasy-mutiny', version: '1.12.2.Final'
}
application {
// Define the main class for the application.
mainClass = 'wells.App'
}
Upvotes: 0
Views: 1285
Reputation: 1393
First of all, the --extensions
parameter of the addExtension
task does not take Maven coordinates but extension names without the quarkus-
prefix, like so:
% ./gradlew addExtension --extensions="hibernate-validator"
> Task :addExtension
? Extension io.quarkus:quarkus-hibernate-validator has been installed
Additionally, I strongly recommend to let Quarkus manage the dependency versions for you. Quarkus is an opinionated framework and puts a lot of effort into managing dependencies for us. To take advantage of that, add an enforcedPlatform
clause to your build.gradle
script. Example:
dependencies {
implementation enforcedPlatform("io.quarkus:quarkus-universe-bom:1.12.2.Final")
// This dependency is used by the application.
implementation group: 'io.quarkus', name: 'quarkus-resteasy'
implementation group: 'io.quarkus', name: 'quarkus-resteasy-mutiny'
// Unit and integration tests
testImplementation 'io.quarkus:quarkus-junit5'
}
Upvotes: 1