You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Robert Taylor <64...@bellsouth.net> on 2005/10/22 14:03:25 UTC

Where should configuration files go?

Greetings,

I'm a recent Ant-to-Maven 2.0 convert and am trying to "mavenize" some 
existing greenfield projects.

In the past I have usually kept my Hibernate *.hbm.xml files in the same 
directory as their corresponding .java files because it facilitates 
referencing. Should I still keep them there, or move them to the 
/resources directory? Personally, I'ld like to keep them close to their 
corresponding .java file.

For testing, should I place files like log4j.properties, 
*-applicationContext.xml (Spring) files, and other configuration type 
files under the /test/resources directory?

thanks,

/robert


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


RE: Where should configuration files go?

Posted by Vincent Massol <vm...@pivolis.com>.

> -----Original Message-----
> From: Jason van Zyl [mailto:jason@maven.org]
> Sent: lundi 24 octobre 2005 04:01
> To: Maven Users List
> Subject: RE: Where should configuration files go?

[snip]

> We might want to align our notions:
> 
> http://maven.apache.org/guides/introduction/introduction-to-the-
> standard-directory-layout.html

Ok, I hadn't noticed the introduction of src/main/config. 
 
> Are we going to make a distinction between resources like i18n files and
> things like log4j.properties files or things like app server
> configurations?

I was planning on putting container configuration files in
src/main/resources in order to reuse the resources tag and use the filtering
mechanism in place. In the use case I'm working on, it'd be fine because I
have a separate project for generate a container distribution.

However I can see cases where you want to have both resources go in the
artifact you're building and where you have config files that should remain
outside of it.

Thus I'd be all for having a separate config/ dir but we'd need to support
it in the same way as we support resources in the pom (including filtering).

> Just throwing this out for comment and clarification before we start
> recommending things wholesale to users.

Good point.

[snip]

-Vincent


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


RE: Where should configuration files go?

Posted by Jason van Zyl <ja...@maven.org>.
On Sat, 2005-10-22 at 14:05 +0200, Vincent Massol wrote:
> Hi Robert,
> 
> > -----Original Message-----
> > From: Robert Taylor [mailto:64rwtaylor05@bellsouth.net]
> > Sent: samedi 22 octobre 2005 14:03
> > To: users@maven.apache.org
> > Subject: Where should configuration files go?
> > 
> > Greetings,
> > 
> > I'm a recent Ant-to-Maven 2.0 convert and am trying to "mavenize" some
> > existing greenfield projects.
> > 
> > In the past I have usually kept my Hibernate *.hbm.xml files in the same
> > directory as their corresponding .java files because it facilitates
> > referencing. Should I still keep them there, or move them to the
> > /resources directory? Personally, I'ld like to keep them close to their
> > corresponding .java file.
> 
> You should move them in the resources directory but you can keep the same
> package. The notion of "close" is subjective. They can be in a different
> directory and still be close in your IDE view for example.
>  
> > For testing, should I place files like log4j.properties,
> > *-applicationContext.xml (Spring) files, and other configuration type
> > files under the /test/resources directory?

We might want to align our notions:

http://maven.apache.org/guides/introduction/introduction-to-the-
standard-directory-layout.html

Are we going to make a distinction between resources like i18n files and
things like log4j.properties files or things like app server
configurations?

Just throwing this out for comment and clarification before we start
recommending things wholesale to users.

> Exactly. Note that those files will need to be accessed using the classpath
> as described on
> http://maven.apache.org/guides/getting-started/index.html#How%20do%20add%20r
> esources%20to%20my%20JAR?
> 
> -Vincent
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 
-- 
jvz.

Jason van Zyl
jason at maven.org
http://maven.apache.org



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


Re: Where should configuration files go?

Posted by Robert Taylor <64...@bellsouth.net>.
Vincent, thanks for advice. I'll put it to good use.

/robert

Vincent Massol wrote:
> Hi Robert,
> 
> 
>>-----Original Message-----
>>From: Robert Taylor [mailto:64rwtaylor05@bellsouth.net]
>>Sent: samedi 22 octobre 2005 14:03
>>To: users@maven.apache.org
>>Subject: Where should configuration files go?
>>
>>Greetings,
>>
>>I'm a recent Ant-to-Maven 2.0 convert and am trying to "mavenize" some
>>existing greenfield projects.
>>
>>In the past I have usually kept my Hibernate *.hbm.xml files in the same
>>directory as their corresponding .java files because it facilitates
>>referencing. Should I still keep them there, or move them to the
>>/resources directory? Personally, I'ld like to keep them close to their
>>corresponding .java file.
> 
> 
> You should move them in the resources directory but you can keep the same
> package. The notion of "close" is subjective. They can be in a different
> directory and still be close in your IDE view for example.
>  
> 
>>For testing, should I place files like log4j.properties,
>>*-applicationContext.xml (Spring) files, and other configuration type
>>files under the /test/resources directory?
> 
> 
> Exactly. Note that those files will need to be accessed using the classpath
> as described on
> http://maven.apache.org/guides/getting-started/index.html#How%20do%20add%20r
> esources%20to%20my%20JAR?
> 
> -Vincent
> 
> 
> ---------------------------------------------------------------------
> 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: Where should configuration files go?

Posted by Vincent Massol <vm...@pivolis.com>.
Hi Robert,

> -----Original Message-----
> From: Robert Taylor [mailto:64rwtaylor05@bellsouth.net]
> Sent: samedi 22 octobre 2005 14:03
> To: users@maven.apache.org
> Subject: Where should configuration files go?
> 
> Greetings,
> 
> I'm a recent Ant-to-Maven 2.0 convert and am trying to "mavenize" some
> existing greenfield projects.
> 
> In the past I have usually kept my Hibernate *.hbm.xml files in the same
> directory as their corresponding .java files because it facilitates
> referencing. Should I still keep them there, or move them to the
> /resources directory? Personally, I'ld like to keep them close to their
> corresponding .java file.

You should move them in the resources directory but you can keep the same
package. The notion of "close" is subjective. They can be in a different
directory and still be close in your IDE view for example.
 
> For testing, should I place files like log4j.properties,
> *-applicationContext.xml (Spring) files, and other configuration type
> files under the /test/resources directory?

Exactly. Note that those files will need to be accessed using the classpath
as described on
http://maven.apache.org/guides/getting-started/index.html#How%20do%20add%20r
esources%20to%20my%20JAR?

-Vincent


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