This is an easy filter approach to write the project version into a file.
<build>
<resources>
<resource>
<directory>src/main/webapp</directory>
<includes>
<include>**/*.version</include>
</includes>
<filtering>true</filtering>
</resource>
</resources>
</build>
This is the project structure (left out the unintresting parts)
├───src
│ └───main
│ ├───java
│ │ └─── [...]
│ └───webapp
│ ├───META-INF
│ └───WEB-INF
│ ├───cfg
│ └───portal.version
└─── pom.xml
The content of portal.version
${project.version}
This should be replaced with the artifact version of the pom.xml
, but unfortunately nothing happens. Whats wrong? Thank you in advance