How to auto update versions in application.xml after maven release

Viewed 3096

application.xml file:

<?xml version="1.0" encoding="UTF-8"?>
<application xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/application_6.xsd" version="6">
  <description>DESCRIPTION</description>
  <display-name>xxxsystem-ear</display-name>
  <module>
    <ejb>xxxsystem-ejb-3.1.1-SNAPSHOT.jar</ejb>
  </module>
  <module>
    <web>
      <web-uri>xxxsystem-web-3.1.1-SNAPSHOT.war</web-uri>
      <context-root>/xxxsystem</context-root>
    </web>
  </module>
  <library-directory>lib</library-directory>
</application>

After I run : mvn release:clean mvn release:prepare mvn release:perform

So i have to change the versions of .jar and .war to 3.1.2 in xml file manually.

There is a way to tell maven to change versions in this file for me?

I have to do the same thing with jboss-deployment-structure.xml

<?xml version="1.0" encoding="UTF-8"?>
<jboss-deployment-structure>
    <deployment>
        <exclusions>
            <module name="org.apache.log4j" />
        </exclusions>
    </deployment>

    <sub-deployment name="xxx-ejb-3.1.1-SNAPSHOT.jar">
        <exclusions>
            <module name="org.apache.log4j" />
        </exclusions>
    </sub-deployment>

    <sub-deployment name="xxx-web-3.1.1-SNAPSHOT.war">
        <exclusions>
            <module name="org.apache.log4j" />
        </exclusions>
    </sub-deployment>
</jboss-deployment-structure>

Any ideas?

2 Answers
Related