Closed agoncal closed 11 years ago
We should use this instead:
add a phase
and commands must be set under
<plugin>
<!--To run the app with JBoss : jboss-as:run -->
<groupId>org.jboss.as.plugins</groupId>
<artifactId>jboss-as-maven-plugin</artifactId>
<version>7.4.Final</version>
<executions>
<execution>
<id>run-app</id>
<goals>
<goal>run</goal>
</goals>
<phase>package</phase>
<configuration>
<jvm-args>-Xms512M -Xmx1303M -XX:MaxPermSize=256M -Duser.country=EN -Duser.language=en</jvm-args>
<beforeDeployment>
<commands>
<command>/subsystem=datasources/data-source=CelerioDS:add(connection-url="jdbc:h2:mem:CelerioDS", jndi-name=java:jboss/datasources/CelerioDS, driver-name=h2, user-name=sa, password=sa)</command>
<command>/subsystem=datasources/data-source=CelerioDS:enable</command>
<command>/subsystem=logging/logger=fr.bdf.celerio:add(level=DEBUG)</command>
</commands>
</beforeDeployment>
</configuration>
</execution>
</executions>
</plugin>
Closing this as I've been neglecting the issues here. If it's still an issue please reopen.
Hi,
I'm trying to start a JBoss, configure it, deploy and application, and then hold the server up and running (something like jetty:run so developpers can quickly run an application). So for that I'm using
mvn jboss-as:run
with the 'beforeDeployment' element. It looks like this :This doesn't seem to work because the plugin starts JBoss, deploys the application and then complains that the DataSource is not available. I could find any example nor test case for this (https://github.com/jbossas/jboss-as-maven-plugin/tree/master/src/test/resources/unit/common).
And what I really would like is to execute a script before deployment. Looking at the code, this looks possible (https://github.com/jbossas/jboss-as-maven-plugin/blob/master/src/main/java/org/jboss/as/plugin/cli/Commands.java#L118) but again, I could make it work.