tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Adrian Stabiszewski" <>
Subject AW: Parallel Deployment
Date Wed, 03 Aug 2011 18:29:11 GMT
> > As I understand it, you have to add the version number after two
> > hashes (##). The version will then be compared as a String.
> > This scheme doesn't fit with my versioning system which uses Maven as
> > build system which uses a hyphen as version separator.
> > Is there some Interface in Tomcat I could implement to integrate my
> > version scheme? Some ContextVersionComparator?
> Do you want to change the ## separator or just how the comparison is done?
> The first is very unlikely to happen. There aren't that many characters
> can be used safely.
> The second might be possible but not per web application as the version
> determination happens much earlier in the process.

Actually I would like to change both, the separator and the comparator. If
it would be possible to extract the logic which decides the version and
which compares the version into an interface, then I think it would be easy
define your own versioning scheme. When I think about it, I would only need
to change the "ContextVersionExtrator".  The class would take the filename
and create a context name and a version number of it. 
For example, if my war filename is "myproject-1.5" it would return
"myproject" and convert the version to some safe string like "105" to be
able to handle versions like 1.10 which would become "110".

> > 1. Allow setting the context name in the META-INF/context.xml of the
> > WAR file.
> > Something like
> >
> > <Context path=""></Context>
> >
> > (which is forbidden atm) would deploy the WAR as a ROOT context.
> Very unlikely to change due to the complications it causes with automated
> deployment. Come up with a solution that allows this without breaking
> deployment or making the code horribly complex then things get rather
> more likely.

To be honest I favored this solution. Now I would even suggest to add the
version as an attribute of the Context tag like:

<Context path="" version="1.05"></Context>

This would reduce the need "for safe characters" in the filename.

When you say if causes complications with automated deployment, what do you
mean by that? Does this happen when Tomcat finds a new WAR File in its
Don't you think that Tomcat relies too much on filenames when it comes to
context names? I think it is good to have some convention over
configuration, but I'm missing the configuration options here.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message