My ear files have version in them. For example, myApp-1.0.1.ear or myApp-1.0.2.ear. I'm trying to undeploy by regex(cause I don't know what the current version is), and then deploy.
However, undeploy by regex is not working for me. I'm looking for 'myApp-*.ear', however it doesn't work unless the version in pom matches the version of current deployment...
what am I doing wrong?
Here's my pom.xml
...
<version>1.0.0</version>
...
<plugin>
<groupId>org.jboss.as.plugins</groupId>
<artifactId>jboss-as-maven-plugin</artifactId>
<version>7.4.Final</version>
<executions>
<execution>
<phase>clean</phase>
<goals>
<goal>undeploy</goal>
</goals>
<configuration>
<match-pattern>myApp-*.ear</match-pattern>
<ignoreMissingDeployment>true</ignoreMissingDeployment>
<matchPatternStrategy>fail</matchPatternStrategy>
</configuration>
</execution>
<execution>
<id>install-application</id>
<phase>install</phase>
<goals>
<goal>deploy</goal>
</goals>
</execution>
</executions>
...
Following the source code of the undeploy plugin will bring you here. That use
String.matches
method. So what you need is something like:Where
myApp
literal is followed by.+
(any char one or more times),\.
(dot literal) andear
literalThis post have some good information about java regex.