The execute-commands goal allows you to execute commands, in the CLI format, on the running JBoss Application Server.
The example below shows how to add a debug logger with a debug log file:
<project>
...
<build>
...
<plugins>
...
<plugin>
<groupId>org.jboss.as.plugins</groupId>
<artifactId>jboss-as-maven-plugin</artifactId>
<version>7.4.Final</version>
<configuration>
<execute-commands>
<commands>
<command>/subsystem=logging/file-handler=debug:add(level=DEBUG,autoflush=true,file={"relative-to"=>"jboss.server.log.dir", "path"=>"debug.log"})</command>
<command>/subsystem=logging/logger=org.jboss.as:add(level=DEBUG,handlers=[debug])</command>
</commands>
</execute-commands>
</configuration>
</plugin>
...
</plugins>
...
</build>
...
</project>The example below shows how to execute commands from a CLI script:
<project>
...
<build>
...
<plugins>
...
<plugin>
<groupId>org.jboss.as.plugins</groupId>
<artifactId>jboss-as-maven-plugin</artifactId>
<version>7.4.Final</version>
<configuration>
<execute-commands>
<scripts>
<script>config.cli</command>
</scripts>
</execute-commands>
</configuration>
</plugin>
...
</plugins>
...
</build>
...
</project>Example of a CLI script to set the transaction timeout to 600 seconds.
batch #set default transaction timeout /subsystem=transactions :write-attribute(name=default-timeout, value=600) #... # Execute and reload run-batch :reload