|
View:
New views
3 Messages
—
Rating Filter:
Alert me
|
|
|
Deploying to Multiple Servers at OnceHello!
I am trying to deploy a WAR to multiple servers at once. Each server has an identical configuration, same authentication information...only the URL is different. The way I have been trying to do this is with profiles such as the following: <profile> <id>env-foo1</id> <properties> <deploy.env>dev</deploy.env> <tomcat.manager>http://foo1/manager</tomcat.manager> <tomcat.manager.username>foo</tomcat.manager.username> <tomcat.manager.password>bar</tomcat.manager.password> </properties> <build> <plugins> <plugin> <groupId>org.codehaus.cargo</groupId> <artifactId>cargo-maven2-plugin</artifactId> </plugin> </plugins> </build> </profile> I have N of these profiles, one for each server (env-foo1 with <tomcat.manager>http://foo1/manager</tomcat.manager>, env-foo2 with <tomcat.manager>http://foo2/manager</tomcat.manager>, etc.). What I am trying to do is tto deploy to all of these servers at once, so that instead of using -Penv-foo1,env-foo2,env-foo3... I can instead use something like -DallFooServers to deploy the whole batch (meaning the individual URLs are managed only in the POM, rather than both in the POM and at the command line). I tried creating several of these profiles and giving them all a common <activation>, but Maven would just pick one of them and run it, ignoring the others. Does anyone know of a way to do this? Thanks very much in advance! -Richard |
|
|
Re: Deploying to Multiple Servers at OnceOn Wed, 2009-01-21 at 13:20 -0800, rfeldman wrote: > Hello! > > I am trying to deploy a WAR to multiple servers at once. Each server has an > identical configuration, same authentication information...only the URL is > different. > > The way I have been trying to do this is with profiles such as the > following: > > <profile> > <id>env-foo1</id> > <properties> > <deploy.env>dev</deploy.env> > <tomcat.manager>http://foo1/manager</tomcat.manager> > <tomcat.manager.username>foo</tomcat.manager.username> > <tomcat.manager.password>bar</tomcat.manager.password> > </properties> > <build> > <plugins> > <plugin> > <groupId>org.codehaus.cargo</groupId> > <artifactId>cargo-maven2-plugin</artifactId> > </plugin> > </plugins> > </build> > </profile> > > I have N of these profiles, one for each server (env-foo1 with > <tomcat.manager>http://foo1/manager</tomcat.manager>, env-foo2 with > <tomcat.manager>http://foo2/manager</tomcat.manager>, etc.). > > What I am trying to do is tto deploy to all of these servers at once, so > that instead of using -Penv-foo1,env-foo2,env-foo3... I can instead use > something like -DallFooServers to deploy the whole batch (meaning the > individual URLs are managed only in the POM, rather than both in the POM and > at the command line). > > I tried creating several of these profiles and giving them all a common > <activation>, but Maven would just pick one of them and run it, ignoring the > others. So will doing -Penv-foo1,env-foo2 will correctly start up two servers, or are you having issues with that also? If using the above profiles are starting the servers properly and you just want to have a nice profile option for all of them, then its a maven configuration problem and not a cargo one. Can you give a bit more detail? > Does anyone know of a way to do this? > > Thanks very much in advance! > > -Richard --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email |
|
|
Re: Deploying to Multiple Servers at OnceOn Thursday 22 January 2009 Matt Wringe wrote:
> On Wed, 2009-01-21 at 13:20 -0800, rfeldman wrote: > > Hello! > > > > I am trying to deploy a WAR to multiple servers at once. Each server > > has an identical configuration, same authentication information...only > > the URL is different. > > > > The way I have been trying to do this is with profiles such as the > > following: > > > > <profile> > > <id>env-foo1</id> > > <properties> > > <deploy.env>dev</deploy.env> > > <tomcat.manager>http://foo1/manager</tomcat.manager> > > <tomcat.manager.username>foo</tomcat.manager.username> > > <tomcat.manager.password>bar</tomcat.manager.password> > > </properties> > > <build> > > <plugins> > > <plugin> > > <groupId>org.codehaus.cargo</groupId> > > <artifactId>cargo-maven2-plugin</artifactId> > > </plugin> > > </plugins> > > </build> > > </profile> > > > > I have N of these profiles, one for each server (env-foo1 with > > <tomcat.manager>http://foo1/manager</tomcat.manager>, env-foo2 with > > <tomcat.manager>http://foo2/manager</tomcat.manager>, etc.). > > > > What I am trying to do is tto deploy to all of these servers at once, > > so that instead of using -Penv-foo1,env-foo2,env-foo3... I can instead > > use something like -DallFooServers to deploy the whole batch (meaning > > the individual URLs are managed only in the POM, rather than both in > > the POM and at the command line). > > > > I tried creating several of these profiles and giving them all a common > > <activation>, but Maven would just pick one of them and run it, > > ignoring the others. > > So will doing -Penv-foo1,env-foo2 will correctly start up two servers, > or are you having issues with that also? properties. Activating more than one profile is very likely to just override the properties defined by some other profile. So once maven is going to call your plugin, your configuration contains only the property values defined by the profile activated last. The above is just my guess, coming from my understanding of maven profiles. I didn't test anything. hth, - martin |
| Free embeddable forum powered by Nabble | Forum Help |