TL;DR:
- stop all running servers;
mvn clean install -s settings-example.xml- now you can run the unit tests from Eclipse with
Run as unit tests(don’t clean the project first or it will delete the target folder with the server).
Explanation:
It’s not an embedded server, the build downloads the WildFly distribution and Arquillian starts and stop it. You could use a remote server but this example is configured to download a new server and add the required modules to it. You can see the server under the folder /target/wildfly-13.0.0.Final.
This is done using the wildfly-server-provisioning-maven-plugin.
I think it’s better if you stop already running servers before running the build and make sure that the maven build is successful.
Once you have built the project you can run the tests in Eclipse without issues. You don’t have to use the “Run on server” but simply “Run as Junit Tests”. Eclipse won’t download the server for you.
The project is configured to use the dependency wildfly-arquillian-container-managed, this means that it will look for a local stopped WildFly server and managed the itsd lifecycle. You need to stop already running servers (or change the port of the one used for tests like you did) if you don’t want problems.
If you want to use a different local server, you can update the arquillian.xml file and change the property
<property name="jbossHome">/path/local/wildfly</property>
to the path to you local server. Now it uses a variable to point to the downloaded one.
You can also run the tests on a remote, already running, server. In this case, you need to update the pom.xml
and replace the dependency wildfly-arquillian-container-managed with wildfly-arquillian-container-remote.
I haven’t try this yet, so you might need to update something else. I will make sure to create different profiles in the future to make the example clearer
Keep in mind that right now this example won’t work with WildFly 14, I just pushed a patch to fix this and it’s going to be released in the next Hibernate OGM version: https://github.com/hibernate/hibernate-ogm/commit/51879a401e1e07c7faecb57fe4559b9c434a5112
It’s mainly a problem related to the modules, so, if you update the modules in your local WildFly, you should be able to make it work. But I would suggest to keep this for after you have already made it work on WildFly 13.
I will try to release a new version of OGM soon, so that this issue can be fixed.
I hope this answer all the questions, thanks a lot for you feedback by the way. Now I have a better idea
of what I need to update in the project example. Don’t esitate to ask for further clarifications.