davsclaus commented on code in PR #27514:
URL: https://github.com/apache/camel/pull/27514#discussion_r4211698423
##########
dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/RunHelper.java:
##########
@@ -90,12 +96,35 @@ public static RuntimeType detectRuntimeFromPom(Path
pomPath) {
}
}
}
+ // the Maven plugin of the runtime builds the application
+ if (model.getBuild() != null) {
+ for (Plugin plugin : model.getBuild().getPlugins()) {
+ String a = resolveProperty(model, plugin.getArtifactId());
+ if ("quarkus-maven-plugin".equals(a)) {
+ return RuntimeType.quarkus;
+ }
+ if ("spring-boot-maven-plugin".equals(a)) {
+ return RuntimeType.springBoot;
+ }
+ }
+ }
} catch (Exception e) {
// ignore
}
return null;
}
+ /** The value with a ${name} property of the pom resolved, as Maven would;
as written when the pom has none. */
+ static String resolveProperty(Model model, String value) {
+ if (value != null && value.startsWith("${") && value.endsWith("}") &&
model.getProperties() != null) {
+ String resolved =
model.getProperties().getProperty(value.substring(2, value.length() - 1));
+ if (resolved != null) {
+ return resolveProperty(model, resolved);
Review Comment:
Good catch, fixed in 762dec7: it follows at most 10 references now, and
RunHelperDetectRuntimeTest has a ${a} -> ${b} -> ${a} case. (The catch of
Exception would not have stopped the StackOverflowError.)
##########
dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/LaunchManager.java:
##########
@@ -342,7 +354,7 @@ private void checkDeferredLaunch(long now) {
.filter(i -> i.alive)
.map(i -> i.alias)
.collect(Collectors.toSet());
- if (runningAliases.containsAll(deferredLaunch.requiredInfra)) {
+ if
(deferredLaunch.requiredInfra.stream().map(LaunchManager::serviceOf).allMatch(runningAliases::contains))
{
Review Comment:
Agreed. checkDeferredLaunch has no seam for a test in this PR (the deferred
launch starts a real camel infra run). The follow-up PR for the infra start
rework adds one (deferUntilInfra/launchInfra), and I am adding an "aws sqs"
required / "aws" running case there.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]