-
Bug
-
Resolution: Unresolved
-
Major
-
None
-
39.0.0.Beta1
-
None
-
---
-
---
Description
When building a bootable JAR using wildfly-maven-plugin with [packaging-scripts], the CLI prints a warning to stderr:
WARN: can't find jboss-cli.xml. Using default configuration values.
Source of the Warning
The warning originates from wildfly-core repository, specifically from:
cli/src/main/java/org/jboss/as/cli/impl/CliConfigImpl.java
Key code (around lines 86-99):
static CliConfig load(final CommandContext ctx, CommandContextConfiguration configuration) throws CliInitializationException { File jbossCliFile = findCLIFileFromSystemProperty(); if (jbossCliFile == null) { jbossCliFile = findCLIFileInCurrentDirectory(); } if (jbossCliFile == null) { jbossCliFile = findCLIFileInJBossHome(); } if (jbossCliFile == null) { System.err.println("WARN: can't find " + JBOSS_CLI_FILE + ". Using default configuration values."); config = new CliConfigImpl(); } ... }
File Search Order
-
- System property jboss.cli.config
2. Current directory - ./jboss-cli.xml
3. JBOSS_HOME/bin/ - $JBOSS_HOME/bin/jboss-cli.xml
- System property jboss.cli.config
Why This Happens During Bootable-JAR Build
-
- wildfly-maven-plugin executes CLI scripts via [packaging-scripts]
2. During bootable JAR build, there is no full $JBOSS_HOME structure
3. CLI cannot find the configuration file → prints warning to System.err
- wildfly-maven-plugin executes CLI scripts via [packaging-scripts]
Affected Quickstarts
17 quickstarts use [packaging-scripts] in their pom.xml:
- ee-security, ejb-security-context-propagation, helloworld-jms, helloworld-mutual-ssl, helloworld-mutual-ssl-secured, hibernate, http-custom-mechanism, jaxrs-jwt, logging, mail, messaging-clustering-singleton, micrometer, opentelemetry-tracing, security-domain-to-domain, servlet-security, todo-backend
11 quickstarts have [bootable-jar]true[/bootable-jar] profile:
- helloworld, micrometer, microprofile-config, microprofile-fault-tolerance, microprofile-health, microprofile-jwt, microprofile-lra, microprofile-openapi, microprofile-reactive-messaging-kafka, microprofile-rest-client, opentelemetry-tracing
Only 2 quickstarts have BOTH packaging-scripts AND bootable-jar profile:
- micrometer
- opentelemetry-tracing
This explains why only these 2 quickstarts produce the warning in bootable-jar builds.
Possible Solutions
-
- Suppress warning in CLI - if jboss-cli.xml is not required, no warning should be printed (or use logging framework instead of System.err)
2. Add empty jboss-cli.xml - to affected quickstarts
3. Provide jboss-cli.xml during bootable-jar build - wildfly-maven-plugin could provide a default config
- Suppress warning in CLI - if jboss-cli.xml is not required, no warning should be printed (or use logging framework instead of System.err)