Resolution: Not a Bug
java -jar jboss-cli-client.jar embed-server --jboss-home=/home/eduda/Projects/wildfly/dist/target/wildfly-A stop-embedded-server $ rm -rf /home/eduda/Projects/wildfly/dist/target/wildfly-A embed-server --jboss-home=/home/eduda/Projects/wildfly/dist/target/wildfly-B Cannot start embedded server: The first directory of the specified module path /home/eduda/Projects/wildfly/dist/target/wildfly-A/modules is invalid or does not exist.
- Run CLI in non-modular class loading mode.
- Run embed-server with --jboss-home pointing to server A
- Stop embed-server
- Remove server A
- Run embed-server with --jboss-home pointing to server B
Expectation: embed-server with --jboss-home pointing to server B will boot.
Reality: The following error message is thrown. As you can see the embed server tries to load modules from server A directory even if the jboss-home was set to server B.
Users impact: Behavior of non-modular class loading  has changed. This change can break user's automation or tests.
Blocker priority was chosen because this is change in behavior against Wildfly 12.
When the embed-server is started for the second time, following warning is logged.
It seems that the change in behavior was caused by commit .