Wildfly maven plugin CLI scripts

178 views
Skip to first unread message

Mansour Al Akeel

unread,
Jun 29, 2023, 11:05:13 PM6/29/23
to WildFly
I need to run multiple CLI scripts to update an existing standalone.xml file. I need to do this as a part of CI/CD, so that the resulting standalone.xml can be included along with other wars in a zip. This zip does not include WF distribution. Just the deployment units, and standalone.xml file. This is already done through maven-assembly-plugin.

We are trying to use wildfly-maven-plugin to apply CLI scripts before generating the final zip file. However, the plugin requires a running or at least an existing WF. This is not attainable on our build agents. I feel it is a lot of efforts and an overkill, to have to install WF just to apply CLI scripts.

Is there a better way to achieve the desired standalone.xml from CLI script on CI/CD ?

Thank you

Emmanuel Hugonnet

unread,
Jun 30, 2023, 4:31:59 AM6/30/23
to Mansour Al Akeel, WildFly
You could use yaml files instead thus the standalone.xml wouldn't have to be updated.
Emmanuel
> --
> You received this message because you are subscribed to the Google Groups "WildFly" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to wildfly+u...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/wildfly/ea0df5c8-b44c-4270-b268-66efb50e62b7n%40googlegroups.com
> <https://groups.google.com/d/msgid/wildfly/ea0df5c8-b44c-4270-b268-66efb50e62b7n%40googlegroups.com?utm_medium=email&utm_source=footer>.

Mansour Al Akeel

unread,
Jun 30, 2023, 11:52:27 AM6/30/23
to WildFly
Sorry, forgot to mention we are using WF 26.

Miha Štemberger

unread,
Jul 3, 2023, 5:56:06 AM7/3/23
to Mansour Al Akeel, WildFly
Hello,

However, the plugin requires a running or at least an existing WF. This is not attainable on our build agents.
Does this mean that running in embedded mode is not possible in any way? https://www.wildfly.org/news/2017/10/10/Embedded-Host-Controller/

If that is not the case, you could unzip the desired distribution and build your configuration that way. Example for a maven project: https://github.com/MihaStemberger/wildfly-offline-jboss-cli

V V pet., 30. jun. 2023 ob 17:52 je oseba Mansour Al Akeel <mansour...@gmail.com> napisala:

James Perkins

unread,
Jul 3, 2023, 8:14:00 PM7/3/23
to WildFly
You could just allow the wildfly-maven-plugin to download WildFly, then run the CLI scripts. You could then just filter out the only the standalone.xml to add to your archive.

James Perkins

unread,
Jul 3, 2023, 8:16:40 PM7/3/23
to WildFly
On Monday, July 3, 2023 at 2:56:06 AM UTC-7 mihaste...@gmail.com wrote:
Hello,

However, the plugin requires a running or at least an existing WF. This is not attainable on our build agents.
Does this mean that running in embedded mode is not possible in any way? https://www.wildfly.org/news/2017/10/10/Embedded-Host-Controller/

If that is not the case, you could unzip the desired distribution and build your configuration that way. Example for a maven project: https://github.com/MihaStemberger/wildfly-offline-jboss-cli

Mansour Al Akeel

unread,
Jul 4, 2023, 4:06:51 AM7/4/23
to WildFly
Thank you all,

This will save me time trying to find a short-cut.
Basically I was trying to avoid downloading and extracting WF just to produce a new standalone.xml. Like I mentioned in the original post, I think having to download the whole server, just to modify standalone.xml is an overkill and may slow the build process. That being said, and after all the support I got, I think it is the only way for now. And yes, offline-mode may fill our need.

I was hoping maven-wildfly-plugin may have the basic dependencies required to accomplish this task without having to download the whole distribution.
I know there are other alternatives, like using XSLT to modify standalone.xml, or CLI archives, but for now I will stick with the downloading the whole server.

Thank you a lot James, Miha and Emmanuel.

James Perkins

unread,
Jul 4, 2023, 1:23:50 PM7/4/23
to WildFly
To configure a server in offline mode, it has to have WildFly configured to support the booting in offline. It's the only way to be able to build the management model so the standalone.xml can be written.

You could use Galleon to provision a lighter server to only download the parts you need. What version of WildFly are you using?

Mansour Al Akeel

unread,
Jul 14, 2023, 9:12:00 PM7/14/23
to James Perkins, WildFly
James, thank you for replying.
I am using WF 26. I was hoping not to have to use Galleon for this as it sounds like an overkill for a very simple use case.


James Perkins

unread,
Jul 17, 2023, 11:37:14 AM7/17/23
to WildFly
It's the way it has to work. CLI commands don't translate directly to XML. What happens is CLI commands are translated to management operations. Then the management operation is processed by the various subsystems. This is where the requirement for a provisioned server to be available. The operation has to find the correct handlers to use in order to update the management model which in turn updates the XML configuration.
Reply all
Reply to author
Forward
0 new messages