Jboss-as maven plugin: undeploy by reg-ex not working

My ear files have a version in them. For example, myApp-1.0.1.ear or myApp-1.0.2.ear. I try to undeploy with a regex (because I don't know what the current version is) and then deploy.

However, undeploy using regex does not work for me. I am looking for "myApp - *. Ear", however this does not work if the version in pom does not match the version of the current deployment ...

what am I doing wrong?

Here is 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>
...
+4
source share
2 answers

After the source code of the undeploy plugin, you will get here . This is the use of the method String.matches. So you need something like:

      <configuration>
          <match-pattern>myApp.+\.ear</match-pattern>
          <ignoreMissingDeployment>true</ignoreMissingDeployment>
          <matchPatternStrategy>fail</matchPatternStrategy>
      </configuration>

myApp .+ ( char ), \. ( ) ear

java regex.

+1

, , jboss , .

  <plugin>
      <groupId>org.jboss.as.plugins</groupId>
      <artifactId>jboss-as-maven-plugin</artifactId>
      <version>7.8.Final</version>
      <executions>
          <execution>
              <phase>clean</phase>
              <goals>
                  <goal>undeploy-artifact</goal>
              </goals>
              <configuration>
                  <groupId>xxxxx</groupId>
                  <artifactId>xxxxx</artifactId>
                  <version>x.x.x</version>
                  <type>ear</type>
                  <name>xxxxx.ear</name>
                  <match-pattern>myApp-.*</match-pattern>
              </configuration>
          </execution>
      </executions>
  </plugin>
0

All Articles