Discussion:
How to set Tomcat context path?
KC Baltz
2006-02-17 01:22:45 UTC
Permalink
I'm trying to deploy to a remote Tomcat server and I'd like to be able to specify the context path to which my app gets deployed.

I'm using maven with the following plugin configuration:

<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<configuration>
<container>
<containerId>tomcat5x</containerId>
<home>c:/tomcat-5.5.12</home>
</container>
<configuration>
<dir>${project.build.directory}/tomcat</dir>
<type>existing</type>
<properties>
<cargo.servlet.port>8080</cargo.servlet.port>
<cargo.tomcat.manager.url>
http://localhost:8080/manager
</cargo.tomcat.manager.url>
<cargo.tomcat.manager.username>user</cargo.tomcat.manager.username>
<cargo.tomcat.manager.password>pass</cargo.tomcat.manager.password>
</properties>
</configuration>
</configuration>
</plugin>

How can I specify the context? Right now it's defaulting to project-1.0-SNAPSHOT.

K.C.
Vincent Massol
2006-02-17 08:32:52 UTC
Permalink
Hi KC,
-----Original Message-----
Sent: vendredi 17 février 2006 02:23
Subject: [cargo-user] How to set Tomcat context path?
I'm trying to deploy to a remote Tomcat server and I'd like to be able to
specify the context path to which my app gets deployed.
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<configuration>
<container>
<containerId>tomcat5x</containerId>
<home>c:/tomcat-5.5.12</home>
</container>
<configuration>
<dir>${project.build.directory}/tomcat</dir>
<type>existing</type>
<properties>
<cargo.servlet.port>8080</cargo.servlet.port>
<cargo.tomcat.manager.url>
http://localhost:8080/manager
</cargo.tomcat.manager.url>
<cargo.tomcat.manager.username>user</cargo.tomcat.manager.username>
<cargo.tomcat.manager.password>pass</cargo.tomcat.manager.password>
</properties>
</configuration>
</configuration>
</plugin>
How can I specify the context? Right now it's defaulting to project-1.0-
SNAPSHOT.
I'm guessing that you're using the auto-deploy feature of the m2 plugin. Try
adding:

[...]
</properties>
</configuration>
<deployables>
<deployable>
<properties>
<context>context path</context>
</properties>
<deployable>
<deployables>

There are some examples on
http://cargo.codehaus.org/Starting+and+stopping+a+container

-Vincent
KC Baltz
2006-02-17 19:02:52 UTC
Permalink
I'm very new to Cargo and M2. I'm just trying to deploy my WAR to a remote Tomcat server.

I tried your changes and it didn't work. Here's what I have now:

<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<configuration>
<container>
<containerId>tomcat5x</containerId>
<home>c:/tomcat-5.5.12</home>
</container>
<configuration>
<dir>${project.build.directory}/tomcat</dir>
<type>existing</type>
<properties>
<cargo.servlet.port>8080</cargo.servlet.port>
<cargo.tomcat.manager.url>
http://localhost:8080/manager
</cargo.tomcat.manager.url>
<cargo.tomcat.manager.username>
admin
</cargo.tomcat.manager.username>
<cargo.tomcat.manager.password>
admin
</cargo.tomcat.manager.password>
</properties>
<deployables>
<deployable>
<properties>
<context>ivb2-cargo</context>
</properties>
</deployable>
</deployables>
</configuration>
</configuration>
</plugin>

Should the <type> be existing? Should I be specifying my context name elsewhere in the pom?

K.C.


-----Original Message-----
From: Vincent Massol [mailto:vmassol-***@public.gmane.org]
Sent: Friday, February 17, 2006 12:33 AM
To: user-***@public.gmane.org
Subject: RE: [cargo-user] How to set Tomcat context path?


Hi KC,
-----Original Message-----
Sent: vendredi 17 février 2006 02:23
Subject: [cargo-user] How to set Tomcat context path?
I'm trying to deploy to a remote Tomcat server and I'd like to be able to
specify the context path to which my app gets deployed.
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<configuration>
<container>
<containerId>tomcat5x</containerId>
<home>c:/tomcat-5.5.12</home>
</container>
<configuration>
<dir>${project.build.directory}/tomcat</dir>
<type>existing</type>
<properties>
<cargo.servlet.port>8080</cargo.servlet.port>
<cargo.tomcat.manager.url>
http://localhost:8080/manager
</cargo.tomcat.manager.url>
<cargo.tomcat.manager.username>user</cargo.tomcat.manager.username>
<cargo.tomcat.manager.password>pass</cargo.tomcat.manager.password>
</properties>
</configuration>
</configuration>
</plugin>
How can I specify the context? Right now it's defaulting to project-1.0-
SNAPSHOT.
I'm guessing that you're using the auto-deploy feature of the m2 plugin. Try
adding:

[...]
</properties>
</configuration>
<deployables>
<deployable>
<properties>
<context>context path</context>
</properties>
<deployable>
<deployables>

There are some examples on
http://cargo.codehaus.org/Starting+and+stopping+a+container

-Vincent
Vincent Massol
2006-02-17 19:47:10 UTC
Permalink
Hi KC,
-----Original Message-----
Sent: vendredi 17 février 2006 20:03
Subject: RE: [cargo-user] How to set Tomcat context path?
I'm very new to Cargo and M2.
That's ok :-)
I'm just trying to deploy my WAR to a
remote Tomcat server.
Your XML is not correct. Please have a look at the documentation:
http://cargo.codehaus.org/Maven2+plugin
http://cargo.codehaus.org/Starting+and+stopping+a+container

Let us know if there's something not clear in the documentation and we'll
fix it.

Thanks
-Vincent
-----Original Message-----
Sent: Friday, February 17, 2006 12:33 AM
Subject: RE: [cargo-user] How to set Tomcat context path?
Hi KC,
-----Original Message-----
Sent: vendredi 17 février 2006 02:23
Subject: [cargo-user] How to set Tomcat context path?
I'm trying to deploy to a remote Tomcat server and I'd like to be able
to
specify the context path to which my app gets deployed.
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<configuration>
<container>
<containerId>tomcat5x</containerId>
<home>c:/tomcat-5.5.12</home>
</container>
<configuration>
<dir>${project.build.directory}/tomcat</dir>
<type>existing</type>
<properties>
<cargo.servlet.port>8080</cargo.servlet.port>
<cargo.tomcat.manager.url>
http://localhost:8080/manager
</cargo.tomcat.manager.url>
<cargo.tomcat.manager.username>user</cargo.tomcat.manager.username>
<cargo.tomcat.manager.password>pass</cargo.tomcat.manager.password>
</properties>
</configuration>
</configuration>
</plugin>
How can I specify the context? Right now it's defaulting to project-
1.0-
SNAPSHOT.
I'm guessing that you're using the auto-deploy feature of the m2 plugin. Try
[...]
</properties>
</configuration>
<deployables>
<deployable>
<properties>
<context>context path</context>
</properties>
<deployable>
<deployables>
There are some examples on
http://cargo.codehaus.org/Starting+and+stopping+a+container
-Vincent
KC Baltz
2006-02-17 22:40:09 UTC
Permalink
The documentation is definitely confusing me, but I'm having trouble putting my finger on specific issues. I can't spot what's wrong with my XML, so it would be helpful if you could point it out. As far as I can tell, it matches the documentation. Heck, it even deploys my app correctly. The only thing it's doing wrong is ignoring the context path I'm trying to set. (I have since noticed that I don't need a <home> element for my container if it's remote)

K.C.

-----Original Message-----
From: Vincent Massol [mailto:vmassol-***@public.gmane.org]
Sent: Friday, February 17, 2006 11:47 AM
To: user-***@public.gmane.org
Subject: RE: [cargo-user] How to set Tomcat context path?


Hi KC,
-----Original Message-----
Sent: vendredi 17 février 2006 20:03
Subject: RE: [cargo-user] How to set Tomcat context path?
I'm very new to Cargo and M2.
That's ok :-)
I'm just trying to deploy my WAR to a
remote Tomcat server.
Your XML is not correct. Please have a look at the documentation:
http://cargo.codehaus.org/Maven2+plugin
http://cargo.codehaus.org/Starting+and+stopping+a+container

Let us know if there's something not clear in the documentation and we'll
fix it.

Thanks
-Vincent
-----Original Message-----
Sent: Friday, February 17, 2006 12:33 AM
Subject: RE: [cargo-user] How to set Tomcat context path?
Hi KC,
-----Original Message-----
Sent: vendredi 17 février 2006 02:23
Subject: [cargo-user] How to set Tomcat context path?
I'm trying to deploy to a remote Tomcat server and I'd like to be able
to
specify the context path to which my app gets deployed.
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<configuration>
<container>
<containerId>tomcat5x</containerId>
<home>c:/tomcat-5.5.12</home>
</container>
<configuration>
<dir>${project.build.directory}/tomcat</dir>
<type>existing</type>
<properties>
<cargo.servlet.port>8080</cargo.servlet.port>
<cargo.tomcat.manager.url>
http://localhost:8080/manager
</cargo.tomcat.manager.url>
<cargo.tomcat.manager.username>user</cargo.tomcat.manager.username>
<cargo.tomcat.manager.password>pass</cargo.tomcat.manager.password>
</properties>
</configuration>
</configuration>
</plugin>
How can I specify the context? Right now it's defaulting to project-
1.0-
SNAPSHOT.
I'm guessing that you're using the auto-deploy feature of the m2 plugin.
Try
[...]
</properties>
</configuration>
<deployables>
<deployable>
<properties>
<context>context path</context>
</properties>
<deployable>
<deployables>
There are some examples on
http://cargo.codehaus.org/Starting+and+stopping+a+container
-Vincent
KC Baltz
2006-02-17 23:31:31 UTC
Permalink
OK, it figures that immediately after I send my email that I would find the working Tomcat5x example for remote deployment. (http://cargo.codehaus.org/Deploying+to+a+running+container)

Here's why I was confused. On the main Maven2 plugin page (http://cargo.codehaus.org/Maven2+plugin), there are two sections that have bulleted links, Table of Contents and Features. The links under ToC are links within the page. The links under features are to other pages. Based on my experience with the links in the ToC, I assumed the links under Features pointed to content in the current page, so I just scrolled down expecting to find it. I'm not really sure how to fix the problem. I know that using a higher contrast color for links (black versus red is hard to diffenetiate) and underlining them would make them more obvious.

Is the documentation for Tomcat 5x support correct that Hot Deploy is unsupported? Isn't that what I'm doing when I deploy a war to a remote Tomcat instance?

K.C.

-----Original Message-----
From: KC Baltz [mailto:KC.Baltz-MPyUUWtI7O3QT0dZR+***@public.gmane.org]
Sent: Friday, February 17, 2006 2:40 PM
To: user-***@public.gmane.org
Subject: RE: [cargo-user] How to set Tomcat context path?


The documentation is definitely confusing me, but I'm having trouble putting my finger on specific issues. I can't spot what's wrong with my XML, so it would be helpful if you could point it out. As far as I can tell, it matches the documentation. Heck, it even deploys my app correctly. The only thing it's doing wrong is ignoring the context path I'm trying to set. (I have since noticed that I don't need a <home> element for my container if it's remote)

K.C.

-----Original Message-----
From: Vincent Massol [mailto:vmassol-***@public.gmane.org]
Sent: Friday, February 17, 2006 11:47 AM
To: user-***@public.gmane.org
Subject: RE: [cargo-user] How to set Tomcat context path?


Hi KC,
-----Original Message-----
Sent: vendredi 17 février 2006 20:03
Subject: RE: [cargo-user] How to set Tomcat context path?
I'm very new to Cargo and M2.
That's ok :-)
I'm just trying to deploy my WAR to a
remote Tomcat server.
Your XML is not correct. Please have a look at the documentation:
http://cargo.codehaus.org/Maven2+plugin
http://cargo.codehaus.org/Starting+and+stopping+a+container

Let us know if there's something not clear in the documentation and we'll
fix it.

Thanks
-Vincent
-----Original Message-----
Sent: Friday, February 17, 2006 12:33 AM
Subject: RE: [cargo-user] How to set Tomcat context path?
Hi KC,
-----Original Message-----
Sent: vendredi 17 février 2006 02:23
Subject: [cargo-user] How to set Tomcat context path?
I'm trying to deploy to a remote Tomcat server and I'd like to be able
to
specify the context path to which my app gets deployed.
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<configuration>
<container>
<containerId>tomcat5x</containerId>
<home>c:/tomcat-5.5.12</home>
</container>
<configuration>
<dir>${project.build.directory}/tomcat</dir>
<type>existing</type>
<properties>
<cargo.servlet.port>8080</cargo.servlet.port>
<cargo.tomcat.manager.url>
http://localhost:8080/manager
</cargo.tomcat.manager.url>
<cargo.tomcat.manager.username>user</cargo.tomcat.manager.username>
<cargo.tomcat.manager.password>pass</cargo.tomcat.manager.password>
</properties>
</configuration>
</configuration>
</plugin>
How can I specify the context? Right now it's defaulting to project-
1.0-
SNAPSHOT.
I'm guessing that you're using the auto-deploy feature of the m2 plugin.
Try
[...]
</properties>
</configuration>
<deployables>
<deployable>
<properties>
<context>context path</context>
</properties>
<deployable>
<deployables>
There are some examples on
http://cargo.codehaus.org/Starting+and+stopping+a+container
-Vincent
Vincent Massol
2006-02-18 22:15:20 UTC
Permalink
Hi KC,
-----Original Message-----
Sent: samedi 18 février 2006 00:32
Subject: RE: [cargo-user] How to set Tomcat context path?
OK, it figures that immediately after I send my email that I would find
the working Tomcat5x example for remote deployment.
(http://cargo.codehaus.org/Deploying+to+a+running+container)
Here's why I was confused. On the main Maven2 plugin page
(http://cargo.codehaus.org/Maven2+plugin), there are two sections that
have bulleted links, Table of Contents and Features. The links under ToC
are links within the page. The links under features are to other pages.
Based on my experience with the links in the ToC, I assumed the links
under Features pointed to content in the current page, so I just scrolled
down expecting to find it. I'm not really sure how to fix the problem. I
know that using a higher contrast color for links (black versus red is
hard to diffenetiate) and underlining them would make them more obvious.
I agree. I think we need to reorganize the documentation for the m2 plugin.
Is the documentation for Tomcat 5x support correct that Hot Deploy is
unsupported? Isn't that what I'm doing when I deploy a war to a remote
Tomcat instance?
You're right, this is not up to date. Actually the container information
needs to be updated as most are out of date. Things that need to be updated:

- new columns for other extensions like maven2
- new lines for new features like remote container support
- updated properties

Feel all free to make the change, it's a wiki after all :-) If anyone needs
access I'll add him to the correct group. The pages are edited by clicking
on the Edit link in the bottom right corner of the page. I'll also try to
give it a shot but it's a lot of work so any help is most welcome.

Thanks
-Vincent
-----Original Message-----
Sent: Friday, February 17, 2006 2:40 PM
Subject: RE: [cargo-user] How to set Tomcat context path?
The documentation is definitely confusing me, but I'm having trouble
putting my finger on specific issues. I can't spot what's wrong with my
XML, so it would be helpful if you could point it out. As far as I can
tell, it matches the documentation. Heck, it even deploys my app
correctly. The only thing it's doing wrong is ignoring the context path
I'm trying to set. (I have since noticed that I don't need a <home>
element for my container if it's remote)
K.C.
-----Original Message-----
Sent: Friday, February 17, 2006 11:47 AM
Subject: RE: [cargo-user] How to set Tomcat context path?
Hi KC,
-----Original Message-----
Sent: vendredi 17 février 2006 20:03
Subject: RE: [cargo-user] How to set Tomcat context path?
I'm very new to Cargo and M2.
That's ok :-)
I'm just trying to deploy my WAR to a
remote Tomcat server.
http://cargo.codehaus.org/Maven2+plugin
http://cargo.codehaus.org/Starting+and+stopping+a+container
Let us know if there's something not clear in the documentation and we'll
fix it.
Thanks
-Vincent
-----Original Message-----
Sent: Friday, February 17, 2006 12:33 AM
Subject: RE: [cargo-user] How to set Tomcat context path?
Hi KC,
-----Original Message-----
Sent: vendredi 17 février 2006 02:23
Subject: [cargo-user] How to set Tomcat context path?
I'm trying to deploy to a remote Tomcat server and I'd like to be able
to
specify the context path to which my app gets deployed.
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<configuration>
<container>
<containerId>tomcat5x</containerId>
<home>c:/tomcat-5.5.12</home>
</container>
<configuration>
<dir>${project.build.directory}/tomcat</dir>
<type>existing</type>
<properties>
<cargo.servlet.port>8080</cargo.servlet.port>
<cargo.tomcat.manager.url>
http://localhost:8080/manager
</cargo.tomcat.manager.url>
<cargo.tomcat.manager.username>user</cargo.tomcat.manager.username>
<cargo.tomcat.manager.password>pass</cargo.tomcat.manager.password>
</properties>
</configuration>
</configuration>
</plugin>
How can I specify the context? Right now it's defaulting to project-
1.0-
SNAPSHOT.
I'm guessing that you're using the auto-deploy feature of the m2 plugin.
Try
[...]
</properties>
</configuration>
<deployables>
<deployable>
<properties>
<context>context path</context>
</properties>
<deployable>
<deployables>
There are some examples on
http://cargo.codehaus.org/Starting+and+stopping+a+container
-Vincent
Continue reading on narkive:
Loading...