You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Jim Collings <jl...@gmail.com> on 2010/02/18 19:54:15 UTC

Deployment Properties file

OK, so I've a project that uses two different containers. Sun
Webserver 7 and Weblogic. I'm trying to set up an automated deployment
that is easily configurable for the individual developers, cause they
all have their stuff in different places.  What I want is a properties
file that the dev can stash in his home directory which will be read
by Maven to establish installation parameters and JVM options for each
container. Later on, I'll put an example file in subversion.  So....
one thing at a time.  First off, I need to know how I can snatch the
properties out of a properties file.

What are some good ways to do this? Since the artefacts that are
deployed are in sub-modules, this seems like a good place to grab
those properties.


Jim C.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Deployment Properties file

Posted by Manfred Moser <ma...@mosabuam.com>.
On Thursday February 18 2010, Jim Collings wrote:
> OK, so I've a project that uses two different containers. Sun
> Webserver 7 and Weblogic. I'm trying to set up an automated
> deployment that is easily configurable for the individual
> developers, cause they all have their stuff in different places. 
> What I want is a properties file that the dev can stash in his
> home directory which will be read by Maven to establish
> installation parameters and JVM options for each container. Later
> on, I'll put an example file in subversion.  So.... one thing at a
> time.  First off, I need to know how I can snatch the properties
> out of a properties file.
> 
> What are some good ways to do this? Since the artefacts that are
> deployed are in sub-modules, this seems like a good place to grab
> those properties.

Just define the properties in the pom file instead. Potentially in 
different profiles. The users can then override the properties by 
setting them in the settings.xml.

manfred

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Deployment Properties file

Posted by Jim Collings <jl...@gmail.com>.
> Profiles are used to just swap between configurations, run plugins that normally don't run, etc.
>
> Stuff you'd like to be able to switch on and off.
>
> If your goal is to just load properties, that seems like a good approach.
>
> Now if you had a properties file for each server type, then you'd put each property file loading configuration in a profile devoted to that app server (but from what I can tell, you get that already).

Well, the objective is to eventually have all our projects
configurable like this. We have a dang large number of projects so
keeping each one down to one file would probably be wise. Besides I
don't want the devs having to look in more than one place for config
of one project. Ideally this would be two projects, but that is not my
call. I just have to roll with it. ;-)

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


RE: Deployment Properties file

Posted by EJ Ciramella <ec...@upromise.com>.
Profiles are used to just swap between configurations, run plugins that normally don't run, etc.

Stuff you'd like to be able to switch on and off.

If your goal is to just load properties, that seems like a good approach.

Now if you had a properties file for each server type, then you'd put each property file loading configuration in a profile devoted to that app server (but from what I can tell, you get that already).



-----Original Message-----
From: Jim Collings [mailto:jlistnews@gmail.com] 
Sent: Thursday, February 18, 2010 2:23 PM
To: Maven Users List
Subject: Re: Deployment Properties file

>> all have their stuff in different places.  What I want is a properties
>> file that the dev can stash in his home directory which will be read
>> by Maven to establish installation parameters and JVM options for each
>
> Maybe use settings.xml in user home dir? Otherwise this calls for a profile.
> Wayne

Profiles? Aren't those used for different platforms?  I think you
mistake my meaning. We have a project that has two subcomponents, one
of which runs on a full J2EE container, Weblogic and the other which
runs on Sun Webserver 7.

BTW, this seems to work OK:

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>properties-maven-plugin</artifactId>
                <version>1.0-alpha-2</version>
                <executions>
                    <execution>
                        <phase>initialize</phase>
                        <goals>
                            <goal>read-project-properties</goal>
                        </goals>
                        <configuration>
                            <files>
                                <file>${env.HOME}/.somefile.properties</file>
                            </files>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Deployment Properties file

Posted by Jim Collings <jl...@gmail.com>.
On Thu, Feb 18, 2010 at 2:56 PM, Wayne Fay <wa...@gmail.com> wrote:
>> Profiles? Aren't those used for different platforms?  I think you
>> mistake my meaning. We have a project that has two subcomponents, one
>> of which runs on a full J2EE container, Weblogic and the other which
>> runs on Sun Webserver 7.
>
> Any time you are thinking "I need to do X for some builds of this
> project and Y for others" your first thought should be profiles.
>
> Wayne

Right and it's current incarnation is all one build. I didn't make it,
I'm just coping with it. ;-)

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Deployment Properties file

Posted by Wayne Fay <wa...@gmail.com>.
> Profiles? Aren't those used for different platforms?  I think you
> mistake my meaning. We have a project that has two subcomponents, one
> of which runs on a full J2EE container, Weblogic and the other which
> runs on Sun Webserver 7.

Any time you are thinking "I need to do X for some builds of this
project and Y for others" your first thought should be profiles.

Wayne

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Deployment Properties file

Posted by Jim Collings <jl...@gmail.com>.
>> all have their stuff in different places.  What I want is a properties
>> file that the dev can stash in his home directory which will be read
>> by Maven to establish installation parameters and JVM options for each
>
> Maybe use settings.xml in user home dir? Otherwise this calls for a profile.
> Wayne

Profiles? Aren't those used for different platforms?  I think you
mistake my meaning. We have a project that has two subcomponents, one
of which runs on a full J2EE container, Weblogic and the other which
runs on Sun Webserver 7.

BTW, this seems to work OK:

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>properties-maven-plugin</artifactId>
                <version>1.0-alpha-2</version>
                <executions>
                    <execution>
                        <phase>initialize</phase>
                        <goals>
                            <goal>read-project-properties</goal>
                        </goals>
                        <configuration>
                            <files>
                                <file>${env.HOME}/.somefile.properties</file>
                            </files>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Deployment Properties file

Posted by Wayne Fay <wa...@gmail.com>.
> all have their stuff in different places.  What I want is a properties
> file that the dev can stash in his home directory which will be read
> by Maven to establish installation parameters and JVM options for each

Maybe use settings.xml in user home dir? Otherwise this calls for a profile.

Wayne

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org