newbie variable expansion in pom.xml and arquillian.xml
jrhite_boss Jul 22, 2013 12:26 AMI'm a complete newbie to arquillian and have only the most basic exposure to maven.
I'm try to get at environment variables in arquillian.xml. Specifically my JBOSS_HOME dir. I don't want to hardcode this as I can't make assumptions about how other developers on my team are setup.
I read this related thread, but after some debugging, in the arquillian.xml file it seems that variables like ${JBOSS_HOME} get passed straight through as is and don't get expanded to their actual values. I read a related thread on this:
https://community.jboss.org/thread/174152
My pom.xml looks like:
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.12</version>
<configuration>
<systemPropertyVariables>
<JBOSS_HOME>${env.JBOSS_HOME}</JBOSS_HOME>
</systemPropertyVariables>
<systemProperties>
<arquillian.launch>jbossas-managed</arquillian.launch>
</systemProperties>
<skip>false</skip>
</configuration>
</plugin>
And my arquillian.xml file looks like:
<arquillian xmlns="http://jboss.org/schema/arquillian"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://jboss.org/schema/arquillian
http://jboss.org/schema/arquillian/arquillian_1_0.xsd">
<container qualifier="jbossas-managed" default="true">
<configuration>
<property name="jbossHome">${JBOSS_HOME}</property>
</configuration>
</container>
</arquillian>
When I hardcode the path to jboss_home in my arquillian.xml file my tests run fine. If I don't, I see the error:
org.jboss.arquillian.container.spi.ConfigurationException: jbossHome '${JBOSS_HOME}' must exist
at org.jboss.arquillian.container.spi.client.deployment.Validate.configurationDirectoryExists(Validate.java:139)
<...snip...>
2 questions:
- Why isn't ${JBOSS_HOME} getting expanded in the arquillian.xml file?
- In pom.xml, are the lines:
<systemProperties>
<arquillian.launch>jbossas-managed</arquillian.launch>
</systemProperties>
<skip>false</skip>
even needed?
I've been out of touch with the full-blown JEE world for a while and need to catch up on maven and tools for testing EJB3s, etc...Not sure if maven is worth it, but arquillian sure looks nice!
Thanks much.