Bug 55035

Summary: Deploy ROOT webapp with version through text manager using Ant
Product: Tomcat 7 Reporter: Sergey Tcherednichenko <sergeytch>
Component: ManagerAssignee: Tomcat Developers Mailing List <dev>
Status: RESOLVED FIXED    
Severity: major CC: sergeytch
Priority: P2    
Version: 7.0.40   
Target Milestone: ---   
Hardware: PC   
OS: All   
Attachments: Ant "deploy" task should also take "version" as a parameter, and can extend AbstractCatalinaCommandTask

Description Sergey Tcherednichenko 2013-05-31 16:05:20 UTC
Currently Ant "deploy" task does not support separate parameter "version" and, thanks to URLEncoder, there is no workaround for that.

But for apps with not empty context it's possible to define version using ##, like setting path to "/someContext#someVersion".

For apps with empty context we receive error:

Case #1:
<deploy url="{tomcat.manager}/text" username="${username}", password="${password}" path="/ROOT##12345" war="${pathtowar}" />

Result:
Failed to deploy application at context path /ROOT##12345

Case #1:
<deploy url="{tomcat.manager}/text" username="${username}", password="${password}" path="/##12345" war="${pathtowar}" />

Result:
Failed to deploy application at context path /##12345
Comment 1 Sergey Tcherednichenko 2013-05-31 21:33:07 UTC
Created attachment 30353 [details]
Ant "deploy" task should also take "version" as a parameter, and can extend AbstractCatalinaCommandTask

This patch makes DeployTask to extend AbstractCatalinaCommandTask, so path and version parameters are set uniformly ("version" parameter was missing in the deploy task, and usage like ${context}##{version} did not work fine for the root context).
Comment 2 Mark Thomas 2013-06-03 21:04:50 UTC
Thanks for the patch (it was inverted by the way). It has been applied to trunk and 7.0.x and will be included in 7.0.41 onwards.
Comment 3 Sergey Tcherednichenko 2013-06-04 11:08:28 UTC
thanks for including it to trunk :) and sorry for the problem with patch :)

though, this is a fix for ant task property "version", but the issue with using "/##someversion" path is not fixed by this patch. Should I create another issue, or maybe just call such usage as deprecated?
Comment 4 Mark Thomas 2013-06-04 11:13:00 UTC
I'd say treat using ##version in a path as deprecated / unsupported.