[Solved] Wildfly Embedded and Eclipse


#1

Hi guys,
I am trying to run Wildfly 8.2 embedded and Arquilian. If I run tests from mvn CLI all tests runs pretty well, but if I try to run them from Eclipse using Run As -> JUnit, next exception is thrown:

org.jboss.arquillian.container.spi.ConfigurationException: jbossHome ‘null’ must exist
at org.jboss.arquillian.container.spi.client.deployment.Validate.configurationDirectoryExists(Validate.java:139)

I am sure that this is a problem between surefire plugin and Eclipse and system environment vars, but is there any solution to fix this?

Wildfly profile looks like:

<profile>
  <id>arquillian-wildfly-embedded</id>
  <activation><activeByDefault>true</activeByDefault></activation>
  <build>
    <plugins>
      <plugin>
        <artifactId>maven-dependency-plugin</artifactId>
        <version>2.8</version>
        <executions>
          <execution>
            <id>unpack</id>
            <phase>process-test-classes</phase>
            <goals>
              <goal>unpack</goal>
            </goals>
            <configuration>
              <artifactItems>
                <artifactItem>
                  <groupId>org.wildfly</groupId>
                  <artifactId>wildfly-dist</artifactId>
                  <version>8.2.0.Final</version>
                  <type>zip</type>
                  <overWrite>false</overWrite>
                  <outputDirectory>target</outputDirectory>
                </artifactItem>
              </artifactItems>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>2.18.1</version>
        <configuration>
          <forkMode>once</forkMode>
          <systemPropertyVariables>
            <java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
            <jboss.home>${project.basedir}/target/wildfly-8.2.0.Final</jboss.home>
            <module.path>${project.basedir}/target/wildfly-8.2.0.Final/modules</module.path>
            <arquillian.launch>arquillian-wildfly-embedded</arquillian.launch>
          </systemPropertyVariables>
          <redirectTestOutputToFile>false</redirectTestOutputToFile>
        </configuration>
      </plugin>
    </plugins>
  </build>
  <dependencies>
    <dependency>
      <groupId>org.wildfly</groupId>
      <artifactId>wildfly-arquillian-container-embedded</artifactId>
      <version>8.2.0.Final</version>
    </dependency>
    <dependency>
      <groupId>org.wildfly</groupId>
      <artifactId>wildfly-embedded</artifactId>
      <version>8.2.0.Final</version>
    </dependency>
  </dependencies>
</profile>

Thank you so much.


Wildfly embedded autodownload
#2

You can set jbossHome in arquillian.xml as a container property, that should be picked up by both IDE and Maven. One issue here is that you probably define the artifact version in maven and need to manually sync that with the arquillian.xml property value.

Another option is to filter the test resources via Maven, Eclipse M2E atleast picks up on that. You do that by activating filtering on test resources in Maven and define a property expression in arquillian.xml.


#3

Ok so I need some more hacking hehehe, then more reasons to implement this things in an authomatic way as discussed in the other topic :smile: