On Thu, Mar 20, 2014 at 12:29 AM, Mark Eggers <[email protected]> wrote:
> On 3/19/2014 7:43 PM, marcos wrote: > >> On Wed, Mar 19, 2014 at 8:48 PM, Mark Eggers <[email protected]> >> wrote: >> >> On 3/19/2014 1:45 PM, marcos wrote: >>> >>> Tomcat 7.0.52 >>>> Ant 1.9.2 >>>> Windows 7 >>>> >>>> >>>> I am trying to use an Ant task to deploy a specific version of a tomcat >>>> app. I want to do this bacause of the parallel deployment feature. >>>> >>>> My task so far: >>>> >>>> <target name="tomcat.deploy" > >>>> <deploy url="http://host/manager/text" username="${deploy.user}" >>>> password="${deploy.pass}" path="/" >>>> war="file:${build-directory}/ROOT%23%23${version}.war"/> >>>> </target> >>>> >>>> But it is not working, what can I do to be able to deploy a specifi >>>> version? >>>> >>>> Marcos >>>> >>>> >>>> After reading the documentation here: >>> >>> http://tomcat.apache.org/tomcat-7.0-doc/deployer-howto.html >>> http://wiki.apache.org/tomcat/AntDeploy >>> >>> I came up with the following ant script: >>> >>> <?xml version="1.0"?> >>> <project name="platform" basedir="." default="deployit"> >>> <!-- external tasks and properties --> >>> <property environment="env"/> >>> <property file="build.properties"/> >>> <taskdef classname="org.apache.catalina.ant.DeployTask" >>> name="deploy" >>> >>> classpath="${env.ANT_HOME}/lib/catalina-ant.jar:${env. >>> ANT_HOME}/lib/tomcat-coyote.jar"/> >>> <target name="deployit"> >>> <deploy url="${deploy.url}" >>> username="${deploy.user}" >>> path="${deploy.context}" >>> password="${deploy.password}" >>> war="file:${deploy.war}" >>> version="${deploy.version}"/> >>> </target> >>> </project> >>> >>> And the build.properties file: >>> >>> # >>> # deploying to tomcat >>> # user / password must have roles="manager-script" >>> # >>> deploy.user=foo >>> deploy.password=rah >>> deploy.url=http://localhost:8080/manager/text >>> deploy.context=/RWeb >>> deploy.war=/home/mdeggers/src/ant-src/tc-manage/RWeb.war >>> deploy.version=001 >>> >>> Please note that the classpath attribute may be wrapped in the email. It >>> should be one line. If you're doing lots of these (see below), you may >>> want >>> to use a classpathref attribute instead of a classpath attribute in your >>> taskdef. >>> >>> http://tomcat.apache.org/tomcat-7.0-doc/manager-howto.html >>> >>> This works as advertised on Fedora 20 with JRE/JDK 1.7.0_51, Ant 1.8.2 >>> (haven't upgraded yet), and Tomcat 7.0.52. >>> >>> . . . . just my two cents >>> /mde/ >>> >>> --------------------------------------------------------------------- >>> To unsubscribe, e-mail: [email protected] >>> For additional commands, e-mail: [email protected] >>> >>> >>> Thanks for the help, with the version attribute I got this message: >> "Deploy >> doesn't support the "version" attribute. >> >> What can be wrong? >> >> > What's the taskdef's classpath? Where did you get the JARs used in the > taskdef's classpath? > > I would probably recommend downloading the deployer from: > > http://tomcat.apache.org/download-70.cgi > > Then: > > 1. Unzip the file (you're on Windows, so I guess you'll use the zip > file) > 2. Create an ant path element with an id that includes all those JARs > in the lib directory from the deployer > 3. Use a classpathref in the taskdef statement (rather than a classpath) > > I just did a quick and dirty (copied the JARs from my Tomcat installation) > test above. > > Your mileage may vary. > > . . . . just my two cents. > > /mde/ > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > > I already have the classpathref and all set up, it is all working when I don't specify a version. Then I have updated the jars and the verions seems to be found but I am getting this error always: java.io.FileNotFoundException: http://localhost:8080/manager/text/deploy?path=%2F at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1623) at org.apache.catalina.ant.AbstractCatalinaTask.execute(AbstractCatalinaTask.java:228) at org.apache.catalina.ant.DeployTask.execute(DeployTask.java:195) at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292) at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106) at org.apache.tools.ant.Task.perform(Task.java:348) at org.apache.tools.ant.Target.execute(Target.java:435) at org.apache.tools.ant.Target.performTasks(Target.java:456) at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1393) at org.apache.tools.ant.Project.executeTarget(Project.java:1364) at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41) at org.apache.tools.ant.Project.executeTargets(Project.java:1248) at org.apache.tools.ant.Main.runBuild(Main.java:851) at org.apache.tools.ant.Main.startAnt(Main.java:235) at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280) at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
