From bcf6bd4a82d7fa611475724d1345b1fabb60a934 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 7 Jul 2023 03:23:19 +0000 Subject: [PATCH 1/9] Updated CHANGELOG.md --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5337977b8128..95c7e7330f41 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,12 +15,15 @@ **Closed issues:** - Allow disabling periodic scan functionality [\#3078](https://github.com/apache/camel-quarkus/issues/3078) +- Surefire 3.0.0-M4 passing even if a build step throws an exception [\#723](https://github.com/apache/camel-quarkus/issues/723) **Merged pull requests:** +- Set the official snapshot repositories [\#5062](https://github.com/apache/camel-quarkus/pull/5062) ([essobedo](https://github.com/essobedo)) - Improve native support of camel-quarkus-debug [\#5060](https://github.com/apache/camel-quarkus/pull/5060) ([essobedo](https://github.com/essobedo)) - Bump quarkus-micrometer-registry-jmx from 3.0.2 to 3.1.2 [\#5055](https://github.com/apache/camel-quarkus/pull/5055) ([dependabot[bot]](https://github.com/apps/dependabot)) - Bump quarkus-amazon-services-bom from 2.3.3 to 2.4.0 [\#5054](https://github.com/apache/camel-quarkus/pull/5054) ([dependabot[bot]](https://github.com/apps/dependabot)) +- chore: fix various build/compilation warnings [\#5053](https://github.com/apache/camel-quarkus/pull/5053) ([lburgazzoli](https://github.com/lburgazzoli)) - Add sync tag for Groovy version property [\#5052](https://github.com/apache/camel-quarkus/pull/5052) ([jamesnetherton](https://github.com/jamesnetherton)) - Remove skip of maven-enforcer-plugin for Google extensions [\#5049](https://github.com/apache/camel-quarkus/pull/5049) ([jamesnetherton](https://github.com/jamesnetherton)) - Restore native profiles to kubernetes-client tests [\#5047](https://github.com/apache/camel-quarkus/pull/5047) ([jamesnetherton](https://github.com/jamesnetherton)) From 279944f957076954d5250843887152915b4cc02b Mon Sep 17 00:00:00 2001 From: Nicolas Filotto Date: Thu, 6 Jul 2023 17:45:02 +0200 Subject: [PATCH 2/9] Ref #5056: Replace the deprecated RecorderContext#classProxy --- .../runtime/LanguageSupportRecorder.java | 28 +++++++++++++++++++ .../groovy/deployment/GroovyProcessor.java | 9 ++---- .../runtime/GroovyExpressionRecorder.java | 4 +-- .../joor/deployment/JoorProcessor.java | 13 ++++----- .../joor/runtime/JoorExpressionRecorder.java | 13 ++++----- 5 files changed, 44 insertions(+), 23 deletions(-) create mode 100644 extensions-support/language/runtime/src/main/java/org/apache/camel/quarkus/support/language/runtime/LanguageSupportRecorder.java diff --git a/extensions-support/language/runtime/src/main/java/org/apache/camel/quarkus/support/language/runtime/LanguageSupportRecorder.java b/extensions-support/language/runtime/src/main/java/org/apache/camel/quarkus/support/language/runtime/LanguageSupportRecorder.java new file mode 100644 index 000000000000..41b979619099 --- /dev/null +++ b/extensions-support/language/runtime/src/main/java/org/apache/camel/quarkus/support/language/runtime/LanguageSupportRecorder.java @@ -0,0 +1,28 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.quarkus.support.language.runtime; + +import io.quarkus.runtime.RuntimeValue; +import io.quarkus.runtime.annotations.Recorder; + +@Recorder +public class LanguageSupportRecorder { + + public RuntimeValue> loadClass(String name) throws ClassNotFoundException { + return new RuntimeValue<>(Class.forName(name, true, Thread.currentThread().getContextClassLoader())); + } +} diff --git a/extensions/groovy/deployment/src/main/java/org/apache/camel/quarkus/component/groovy/deployment/GroovyProcessor.java b/extensions/groovy/deployment/src/main/java/org/apache/camel/quarkus/component/groovy/deployment/GroovyProcessor.java index ad3027bc3df7..183200f5a05d 100644 --- a/extensions/groovy/deployment/src/main/java/org/apache/camel/quarkus/component/groovy/deployment/GroovyProcessor.java +++ b/extensions/groovy/deployment/src/main/java/org/apache/camel/quarkus/component/groovy/deployment/GroovyProcessor.java @@ -30,7 +30,6 @@ import io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem; import io.quarkus.deployment.pkg.builditem.CurateOutcomeBuildItem; import io.quarkus.deployment.pkg.steps.NativeBuild; -import io.quarkus.deployment.recording.RecorderContext; import io.quarkus.maven.dependency.ResolvedDependency; import io.quarkus.paths.PathCollection; import io.quarkus.runtime.RuntimeValue; @@ -42,6 +41,7 @@ import org.apache.camel.quarkus.support.language.deployment.ExpressionExtractionResultBuildItem; import org.apache.camel.quarkus.support.language.deployment.ScriptBuildItem; import org.apache.camel.quarkus.support.language.runtime.ExpressionUID; +import org.apache.camel.quarkus.support.language.runtime.LanguageSupportRecorder; import org.apache.camel.quarkus.support.language.runtime.ScriptUID; import org.codehaus.groovy.control.CompilationUnit; import org.codehaus.groovy.control.CompilerConfiguration; @@ -145,14 +145,11 @@ void compileScriptsAOT(CurateOutcomeBuildItem curateOutcomeBuildItem, } } - // We still need to use RecorderContext#classProxy as using i.e. Class.forName does not work - // at runtime. See https://github.com/apache/camel-quarkus/issues/5056 - @SuppressWarnings("deprecation") @Record(ExecutionTime.STATIC_INIT) @BuildStep(onlyIf = NativeBuild.class) CamelBeanBuildItem configureLanguage( - RecorderContext recorderContext, GroovyExpressionRecorder recorder, + LanguageSupportRecorder languageRecorder, ExpressionExtractionResultBuildItem result, List sources) throws ClassNotFoundException { @@ -162,7 +159,7 @@ CamelBeanBuildItem configureLanguage( recorder.addScript( builder, source.getOriginalCode(), - recorderContext.classProxy(source.getClassName())); + languageRecorder.loadClass(source.getClassName())); } final RuntimeValue language = recorder.languageNewInstance(builder); return new CamelBeanBuildItem("groovy", GroovyLanguage.class.getName(), language); diff --git a/extensions/groovy/runtime/src/main/java/org/apache/camel/quarkus/component/groovy/runtime/GroovyExpressionRecorder.java b/extensions/groovy/runtime/src/main/java/org/apache/camel/quarkus/component/groovy/runtime/GroovyExpressionRecorder.java index e1d9a922a98e..e0ee30034475 100644 --- a/extensions/groovy/runtime/src/main/java/org/apache/camel/quarkus/component/groovy/runtime/GroovyExpressionRecorder.java +++ b/extensions/groovy/runtime/src/main/java/org/apache/camel/quarkus/component/groovy/runtime/GroovyExpressionRecorder.java @@ -29,9 +29,9 @@ public RuntimeValue languageBuilder() { } @SuppressWarnings("unchecked") - public void addScript(RuntimeValue builder, String content, Class clazz) { + public void addScript(RuntimeValue builder, String content, RuntimeValue> clazz) { try { - builder.getValue().addScript(content, (Class