-
Notifications
You must be signed in to change notification settings - Fork 210
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Gradle quarkusAppPartsBuild task failure #3565
Comments
Hi @deepakkapoor23 : could you please include a minimal reproducer, i.e. a very trimmed down project that recreates the problem you are facing ? Thanks! |
kogito-reproducer.zip Commands: mvnw clean package -U gradlew clean build --no-build-cache |
I am seeing too many issues with gradle build that run ok with Maven, e.g.
There has to be something wrong fundamentally with the gradle plugin, it may be pulling in stale dependencies. |
@deepakkapoor23 |
@gitgabrio did you get a chance to look into it? Its a showstopper for me if I cant build a kogito project using Gradle |
@gitgabrio if you can look into this it would be greatly appreciated. Our team would like to use this upcoming Kogito release, however if we cannot build using Gradle this is a major blocker for our use of the Kogito framework. |
Hi Michael, Deepak,
unfortunately, I did not have time, yet, and I can not give any estimation,
since there are a couple of other priorities I have to attend to.
Best
Gabriele
Il giorno mer 3 lug 2024 alle ore 20:38 MichaelCarolan <
***@***.***> ha scritto:
… @gitgabrio <https://github.com/gitgabrio> if you can look into this it
would be greatly appreciated. Our team would like to use this upcoming
Kogito release, however if we cannot build using Gradle this is a major
blocker for our use of the Kogito framework.
—
Reply to this email directly, view it on GitHub
<#3565 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAF25CWMEGMYZNO77LQXMUDZKRAIRAVCNFSM6AAAAABJ4K7IXCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMBWHE3DKMBRHE>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
I dont see the original error anymore (maybe some other commit fixed it already) and I am able to build the project after commenting out the following dependencies:
However when I run the built binary, I have been noticing issues/inconsistencies compared to a Maven build. I listed a couple of examples in my comment earlier. Hopefully, these can be addressed before the next release. |
@gitgabrio I tried looking at the codegen module but couldnt figure out whats different between gradle and maven builds. Would you be able to look at it and point out why they would both produce different artifacts with inconsistent behavior? |
@fjtirado @gitgabrio See a comparison of gradle vs maven builds for generated sources for one of the examples. |
The only plugin I have been applying in gradle is: and this was working ok with kogito 1.43.0 and quarkus 2.16.12 Is there and additional kogito gradle plugin that must be applied with quarkus 3? |
@gitgabrio looking at KogitoAssetsProcessor Its definitely something to do with output paths. I tried setting the system property org.gradle.appname=gradleapp which made no difference. If I have no java source present in the project, it does not generate any files at all. No logging in KogitoAssetsProcessor makes it difficult to see whats going on and there is no way for me to debug. Also, the one test for this class seems insufficient when its only asserting on root paths and not actually generating any sources to see if they end up at right path. |
I managed to change the location where generated files are written to the disk by overriding these properties for GeneratedFileWriter. kogito.codegen.sources.directory=../quarkus-generated-sources/kogito |
Hi @deepakkapoor23 I have the same issue, as a workaround I did use build.gradle.kts val javaVersion: String by project
val quarkusVersion: String by project
val kogitoVersion: String by project
val cloudEventVersion: String by project
val kotlinVersion: String by project
plugins {
kotlin("jvm")
kotlin("plugin.allopen")
id("io.quarkus")
id("maven-publish")
}
repositories {
mavenCentral()
mavenLocal()
maven {
url = uri("https://repository.apache.org/content/groups/public")
}
}
dependencies {
implementation(enforcedPlatform("io.quarkus.platform:quarkus-bom:$quarkusVersion"))
implementation("io.quarkus:quarkus-kotlin")
implementation("io.quarkus:quarkus-arc")
implementation("io.quarkus:quarkus-resteasy")
implementation("io.quarkus:quarkus-resteasy-jackson")
implementation("io.quarkus:quarkus-smallrye-health")
implementation("io.quarkus:quarkus-smallrye-reactive-messaging-kafka")
implementation("io.quarkus:quarkus-container-image-jib")
implementation("io.quarkus:quarkus-opentelemetry")
implementation("io.quarkus:quarkus-micrometer-registry-prometheus")
implementation("io.quarkus:quarkus-smallrye-openapi")
implementation(enforcedPlatform("org.kie.kogito:kogito-bom:$kogitoVersion"))
implementation("org.apache.kie.sonataflow:sonataflow-quarkus")
implementation("org.kie:kie-addons-quarkus-messaging")
implementation("org.kie:kie-addons-quarkus-events-process")
implementation("org.kie:kie-addons-quarkus-persistence-infinispan")
implementation("org.kie:kie-addons-quarkus-monitoring-prometheus")
implementation("org.kie:kie-addons-quarkus-source-files")
implementation("org.kie:kie-addons-quarkus-process-management")
implementation("io.cloudevents:cloudevents-kafka:$cloudEventVersion")
}
group = "io.mycompany"
version = "0.0.1-SNAPSHOT"
java {
sourceCompatibility = JavaVersion.toVersion(javaVersion)
targetCompatibility = JavaVersion.toVersion(javaVersion)
}
tasks.withType<Test> {
systemProperty("java.util.logging.manager", "org.jboss.logmanager.LogManager")
}
allOpen {
annotation("jakarta.ws.rs.Path")
annotation("jakarta.enterprise.context.ApplicationScoped")
annotation("jakarta.persistence.Entity")
annotation("io.quarkus.test.junit.QuarkusTest")
}
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
kotlinOptions.jvmTarget = javaVersion
kotlinOptions.javaParameters = true
}
publishing {
publications {
create<MavenPublication>("maven") {
groupId = "io.mycompany"
artifactId = "mykogito"
version = "0.0.1-SNAPSHOT"
from(components["java"])
pom.withXml {
asNode().appendNode("repositories").apply {
appendNode("repository").apply {
appendNode("id", "central")
appendNode("name", "Maven Central")
appendNode("url", "https://repo.maven.apache.org/maven2")
}
appendNode("repository").apply {
appendNode("id", "apache")
appendNode("name", "Apache Public Repository")
appendNode("url", "https://repository.apache.org/content/groups/public")
}
}
asNode().appendNode("build").appendNode("plugins").apply {
appendNode("plugin").apply {
appendNode("groupId", "io.quarkus")
appendNode("artifactId", "quarkus-maven-plugin")
appendNode("version", quarkusVersion)
appendNode("executions").appendNode("execution").apply {
appendNode("goals").appendNode("goal", "build")
}
}
appendNode("plugin").apply {
appendNode("groupId", "org.jetbrains.kotlin")
appendNode("artifactId", "kotlin-maven-plugin")
appendNode("version", kotlinVersion)
appendNode("executions").appendNode("execution").apply {
appendNode("phase", "compile")
appendNode("goals").appendNode("goal", "compile")
}
}
appendNode("plugin").apply {
appendNode("groupId", "org.jetbrains.kotlin")
appendNode("artifactId", "kotlin-maven-allopen")
appendNode("version", kotlinVersion)
appendNode("configuration").apply {
appendNode("compilerPlugins").appendNode("plugin", "all-open")
appendNode("pluginOptions").apply {
appendNode("option", "all-open:annotation=jakarta.ws.rs.Path")
appendNode(
"option", "all-open:annotation=jakarta.enterprise.context.ApplicationScoped"
)
appendNode("option", "all-open:annotation=jakarta.persistence.Entity")
appendNode("option", "all-open:annotation=io.quarkus.test.junit.QuarkusTest")
}
}
}
}
}
}
}
}
gradle.properties
run
|
Hi @gitgabrio how are you? Are you working on this issue? If not, can I get this one? |
Hi @mcruzdev please, do: it would be greatly appreciated! |
Thank you @gitgabrio, I will take this one! |
Describe the bug
Build fails with gradle after quarkus version upgrade while it build fine with Maven
Quarkus platform and plugin version is 3.8.5
Expected behavior
Gradle build should work same as Maven and produce the same output.
Actual behavior
Gradle build fails with the following error:
Caused by: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
[error]: Build step org.drools.quarkus.deployment.DroolsAssetsProcessor#generateSources threw an exception: java.lang.UnsupportedOperationException
at java.base/java.util.AbstractCollection.add(AbstractCollection.java:251)
at org.drools.quarkus.deployment.DroolsAssetsProcessor.generateSources(DroolsAssetsProcessor.java:116)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at io.quarkus.deployment.ExtensionLoader$3.execute(ExtensionLoader.java:849)
at io.quarkus.builder.BuildContext.run(BuildContext.java:256)
at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2513)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1538)
at java.base/java.lang.Thread.run(Thread.java:833)
at org.jboss.threads.JBossThread.run(JBossThread.java:501)
Caused by: java.lang.UnsupportedOperationException
at org.drools.quarkus.deployment.DroolsAssetsProcessor.generateSources(DroolsAssetsProcessor.java:116)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at io.quarkus.deployment.ExtensionLoader$3.execute(ExtensionLoader.java:849)
at io.quarkus.builder.BuildContext.run(BuildContext.java:256)
at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2513)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1538)
at org.jboss.threads.JBossThread.run(JBossThread.java:501)
How to Reproduce?
Create a gradle project with kogito dependencies and plugin and run the build as follows:
gradlew clean build --no-build-cache --stacktrace
Output of
uname -a
orver
Windows
Output of
java -version
17
GraalVM version (if different from Java)
No response
Kogito version or git rev (or at least Quarkus version if you are using Kogito via Quarkus platform BOM)
999-SNAPSHOT
Build tool (ie. output of
mvnw --version
orgradlew --version
)gradle 8.6
Additional information
Intermittently missing classes from org.jbpm and org.drools packages are also reported in the build log with NoClassDefFoundError
The text was updated successfully, but these errors were encountered: