backporting wildfly/wildfly-maven-plugin@95bfb7b with minor adaptations