I want to version my WAR to make DevOps lives easier, i.e.: foo-3.2.0.war. In pom.xml, I have:
<build>
<finalName>foo</finalName>
but also
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>${maven-war-plugin.version}</version>
<configuration>
<warName>${project.artifactId}-${project.version}</warName>
that imparts the current version in pom.xml to the WAR filename. So far, so good.
The problem becomes that the version is required in the URL when deployed to Tomcat. I want my application accessed thus: http://hostname:port/foo
and not http://hostname:port/foo-3.2.0
(etc.) because I'd have to annoy my consumer with the version change.
Is it possible to work around this problem without just going back to an unversioned WAR file?
You can use ${project.artifactId}##${project.version}
as naming scheme.
The part after ##
will not be part of the context name (cf. parallel deployment).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With