RE: Determining top-level parent pom directory

2007-09-19 Thread Tim Foster
Wayne or anyone elsesuggestions?

Tim

-Original Message-
From: Tim Foster [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, September 18, 2007 4:18 PM
To: Maven Users List
Subject: RE: Determining top-level parent pom directory

Okay.  I'm trying to dynamically create a properties file, e.g.,
my.properties, into which I can define properties that can be referenced
at all levels of the hierarchy.  This file would live in a location
relative to the top-level pom file.  The default definitions of the
properties are determined by reading a default.properties file, but the
values can be overridden by environment variables.  So, I'm using the
maven-antrun-plugin to create this properties file, but I don't know how
to reference it from the lower-level poms.

Thanks,

Tim

-Original Message-
From: Wayne Fay [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, September 18, 2007 3:58 PM
To: Maven Users List
Subject: Re: Determining top-level parent pom directory

Tell us more about what you're trying to do.

Wayne

On 9/18/07, Tim Foster [EMAIL PROTECTED] wrote:
 In a multi-module pom hierarchy, what is the best way to
 determine/reference the top-level pom directory?

 Tim


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



Re: Determining top-level parent pom directory

2007-09-19 Thread Wendy Smoak
On 9/18/07, Tim Foster [EMAIL PROTECTED] wrote:
 Okay.  I'm trying to dynamically create a properties file, e.g.,
 my.properties, into which I can define properties that can be referenced
 at all levels of the hierarchy.  This file would live in a location
 relative to the top-level pom file.  The default definitions of the
 properties are determined by reading a default.properties file, but the
 values can be overridden by environment variables.  So, I'm using the
 maven-antrun-plugin to create this properties file, but I don't know how
 to reference it from the lower-level poms.

Is this properties file a build-time thing, or something that you need
to package up to deliver with your project?

IOW, what problem are you trying to solve?  You're still describing an
implementation.

-- 
Wendy

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



RE: Determining top-level parent pom directory

2007-09-19 Thread Tim Foster
Thanks for your reply.  I want the properties to be available both at
build time (e.g., to be used in packaging) and runtime (e.g., to be used
to locate other resources that are relative to directory property
values).

Tim

-Original Message-
From: Wendy Smoak [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, September 19, 2007 9:36 AM
To: Maven Users List
Subject: Re: Determining top-level parent pom directory

On 9/18/07, Tim Foster [EMAIL PROTECTED] wrote:
 Okay.  I'm trying to dynamically create a properties file, e.g.,
 my.properties, into which I can define properties that can be
referenced
 at all levels of the hierarchy.  This file would live in a location
 relative to the top-level pom file.  The default definitions of the
 properties are determined by reading a default.properties file, but
the
 values can be overridden by environment variables.  So, I'm using the
 maven-antrun-plugin to create this properties file, but I don't know
how
 to reference it from the lower-level poms.

Is this properties file a build-time thing, or something that you need
to package up to deliver with your project?

IOW, what problem are you trying to solve?  You're still describing an
implementation.

-- 
Wendy

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


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



Re: Determining top-level parent pom directory

2007-09-19 Thread Wendy Smoak
On 9/19/07, Tim Foster [EMAIL PROTECTED] wrote:

 Thanks for your reply.  I want the properties to be available both at
 build time (e.g., to be used in packaging) and runtime (e.g., to be used
 to locate other resources that are relative to directory property
 values).

I still don't have the full picture of what you need.  In general,
finding the top of the project is problematic-- there's no guarantee
the entire project is sitting on disk, ideally the build should work
if you check out a portion of it, by retrieving snapshots of the other
modules from a repository.

Seems like you need to generate the .properties file and then get it
on the classpath, rather than worry about exactly where to find it.
One way to do that is to put the .properties file in a jar that is
then depended on by other modules.

-- 
Wendy

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



Re: Determining top-level parent pom directory

2007-09-19 Thread Wayne Fay
You could turn this single file into its own module and deploy etc it
on its own in a jar file. Then use remote-resources plugin or
assembly:unpack or a similar approach to bring that file into each
submodule as needed.

You generally should not expect that a Maven build of a module
necessarily has all of the parents and other modules in the filesystem
available. So simply stating ../../../main/resources/file.properties
(as an example) as the location of the file is going to be a bad idea
in the long run. Instead you should create builds that are generally
independent (except for their dependencies).

Wayne

On 9/19/07, Wendy Smoak [EMAIL PROTECTED] wrote:
 On 9/19/07, Tim Foster [EMAIL PROTECTED] wrote:

  Thanks for your reply.  I want the properties to be available both at
  build time (e.g., to be used in packaging) and runtime (e.g., to be used
  to locate other resources that are relative to directory property
  values).

 I still don't have the full picture of what you need.  In general,
 finding the top of the project is problematic-- there's no guarantee
 the entire project is sitting on disk, ideally the build should work
 if you check out a portion of it, by retrieving snapshots of the other
 modules from a repository.

 Seems like you need to generate the .properties file and then get it
 on the classpath, rather than worry about exactly where to find it.
 One way to do that is to put the .properties file in a jar that is
 then depended on by other modules.

 --
 Wendy

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



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



Re: Determining top-level parent pom directory

2007-09-18 Thread Wayne Fay
Tell us more about what you're trying to do.

Wayne

On 9/18/07, Tim Foster [EMAIL PROTECTED] wrote:
 In a multi-module pom hierarchy, what is the best way to
 determine/reference the top-level pom directory?

 Tim

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



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



RE: Determining top-level parent pom directory

2007-09-18 Thread Tim Foster
Okay.  I'm trying to dynamically create a properties file, e.g.,
my.properties, into which I can define properties that can be referenced
at all levels of the hierarchy.  This file would live in a location
relative to the top-level pom file.  The default definitions of the
properties are determined by reading a default.properties file, but the
values can be overridden by environment variables.  So, I'm using the
maven-antrun-plugin to create this properties file, but I don't know how
to reference it from the lower-level poms.

Thanks,

Tim

-Original Message-
From: Wayne Fay [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, September 18, 2007 3:58 PM
To: Maven Users List
Subject: Re: Determining top-level parent pom directory

Tell us more about what you're trying to do.

Wayne

On 9/18/07, Tim Foster [EMAIL PROTECTED] wrote:
 In a multi-module pom hierarchy, what is the best way to
 determine/reference the top-level pom directory?

 Tim

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



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


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