3

I added the name parameter on my deployment using Wildfly Maven Plugin:

mvn wildfly:deploy -Dname=myapp  -Dwildfly.hostname=myserver -Dwildfly.username=user -Dwildfly.password=pwd 

However, it keeps on deploying with the Maven version and extension. Here's how it looks in standalone.xml

<deployment name="myapp-1.1-SNAPSHOT.war" runtime-name="myapp-1.1-SNAPSHOT.war">
    <content sha1="17e09de2cd8f78ffd033a90b4e82bdb52eb9485b"/>
</deployment>

The reason is to streamline the deployment process. After a Maven release, the deployment name changes to myapp-1.1.war, and the new development becomes myapp-1.2-SNAPSHOT.war. Instead of undeploying release myapp-1.1.war, and deploying myapp-1.2-SNAPSHOT.war, we want to reduce it to a single step - just redeploy myapp, and it should overwrite the old one.

Btw, if I just deploy, I'll have the two versions.

Just to be clear, this is the goal:

<deployment name="myapp" runtime-name="myapp-1.1-SNAPSHOT.war">
    <content sha1="17e09de2cd8f78ffd033a90b4e82bdb52eb9485b"/>
</deployment>

This seems like a very simple case, and it should work as per the documentation: https://docs.jboss.org/wildfly/plugins/maven/latest/deploy-mojo.html

jersey-city-ninja
  • 1,038
  • 11
  • 23

1 Answers1

1

You can't override the name parameter on the via the command line. You'd need to add a configuration property for the name configuration parameter and override that on the command line.

...
<properties>
    <deployment.name>${project.build.finalName}.${project.packaging}</deployment.name>
</properties>
...
<plugin>
    <groupId>org.wildfly.plugins</groupId>
    <artifactId>wildfly-maven-plugin</artifactId>
    <version>1.1.0.Alpha7</version>
    <configuration>
        <name>${deployment.name}</name>
    </configuration>
</plugin>
...

Then on the command you could use -Ddeployment.name=myapp. One note though is you'll want to use the appropriate file extension, e.g. .war, so the deployment will be processed properly.

James R. Perkins
  • 16,800
  • 44
  • 60
  • Following what you said, I can change the deployment name now, but the runtime-name always copies the name. I've tried different combinations, but still not working. I want the version to remain in the runtime-name. Similar to what was stated in the doc: https://docs.jboss.org/wildfly/plugins/maven/latest/deploy-mojo.html#runtimeName Thanks again in advance, and I appreciate your quick replies. – jersey-city-ninja Apr 08 '16 at 20:42
  • 1
    Are you specifying the `` configuration property or using the `wildfly.deployment.runtime.name` command line property? If not the runtime-name will default to the deployment name. – James R. Perkins Apr 11 '16 at 15:27
  • I have this in my pom.xml: A B ... org.wildfly.plugins wildfly-maven-plugin false ${deployment.name} ${runtime.name} ... runtime name is not respected. It copies the deployment name – jersey-city-ninja Apr 20 '17 at 20:42
  • What version of the plugin? – James R. Perkins Apr 20 '17 at 22:26
  • wildfly-maven-plugin:1.0.2.Final – jersey-city-ninja Apr 20 '17 at 22:44
  • I tried it on version 1.1.0.Final and it works fine. Thanks! :-) – jersey-city-ninja Apr 20 '17 at 22:48