Search code examples
mavendeploymentwildflyconflict

Wildfly Deploy Maven - Remove Version


I want to deploy a war that I have created using maven to wildfly using the wildfly-maven-plugin.


The final name of the war is something like: my-war-1.0.war
The war also contains a jboss-web.xml specifying the context root (e.g. /my-war)


Problem Description

If I now deploy the war to wildfly I will get a "my-war-1.0.war" deployment.
If I later want to deploy a new version (e.g. the war is now named my-war-1.1.war) I get a conflict as the context root is already known but the deployment has a new name.


Is there a way using the wildfly-maven-plugin to deploy a "my-war.war" instead?

I need to keep the original final build name inside the maven build for versioning and deploying to our nexus.


Solution

  • I found out that I can use the parameters <name/> and <runtimeName/> inside the <configuration/> of the maven-wildfly-plugin.

    That way I can specify what the deployment should be called on the server and each time just replace it. It is important to have the two parameters end in ".war", otherwise you will get a 404 error.

    Using this method I can keep the original name of the final build result containing the version (my-app-1.0.war) and archive it inside our internal nexus repository.