I have what seems like a simple task but is getting out hand. We deploy
servlet war webapps from a multi-module Maven2 build to a central Tomcat 5.x
server. I want to customize the deployment of webapps to a central server
for each developer. Right now I have two profiles setup, dev and staging.
These set properties to send the cargo deployment to either our developer
machine or a staging machine for QA. With 5-6 devs potentially working on
the project I want to customize deployments to the dev machine so that each
war deploys under a custom ctx path with the developers initials. For Eg.
right now all dev profile deploys go out like:


http://devserver:8080/webapp1
http://devserver:8080/webapp2
http://devserver:8080/webapp3

I'd like to set a dev profile called dev-ccc and have it deploy the war
files like so:

http://devserver:8080/ccc-webapp1
http://devserver:8080/ccc-webapp2
http://devserver:8080/ccc-webapp3

So far I have a property set in the default profile of the project root pom
(parent to each webapp pom) called webapp.root.ctx and it is set to "/". The
project root pom inherits from a parent pom which details the all the other
profiles that I want to override the default profile. So if I do a deploy
with the regular dev profile the default profile is also activated which
assumes the ctx path of "/". I created a profile "dev-ccc" in the root
project's parent pom that sets the ctx path to "/ccc-". If I deploy the
servlets with profile dev-ccc the project's super pom webapp.root.ctx is
still set to "/". I verify this using help:effective-pom. It's as if the
properties in the super pom are shadowed by the properties in the project
root pom. I thought it would be the other way around. To further clarify
this is a rough example of my poms:

Team-wide super pom:
<project>
<!-- other stuff -->
         <properties>
            <webapp.root.ctx>/ccc-</webapp.root.ctx>
         </properties>
</project>

Project root pom
<project>
<!-- other stuff -->
         <properties>
            <webapp.root.ctx>/</webapp.root.ctx>
         </properties>
</project>

Webapp1 pom:
<project>
<plugin>
                <groupId>org.codehaus.cargo</groupId>
                <artifactId>cargo-maven2-plugin</artifactId>
                <configuration>
                    <deployer>
                        <deployables>
                            <deployable>
                                <groupId>com.mycomp.web</groupId>
                                <artifactId>webapp1</artifactId>
                                <type>war</type>
                                <properties>
                                   
<context>${webapp.root.ctx}webapp1</context>
                                </properties>
                            </deployable>
                        </deployables>
                    </deployer>
                </configuration>
              <executions>
                <execution>
                  <phase>deploy</phase>
                </execution>
              </executions>
            </plugin>
</project>

Could somebody lend a hand? Thanx a bunch in advance!

-Cliff
-- 
View this message in context: 
http://www.nabble.com/Cargo%3A-custom-ctx-path-for-deployment-tp15705398s177p15705398.html
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to