You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Oren Livne <ol...@aoce.utah.edu> on 2007/12/21 16:15:43 UTC

Global resources for a multi-module project

Dear All,

Question 1:
I am trying to build a multi-module maven 2 project. I would like to 
declare some global resources
that all modules should include in their jars/wars. Let's take as an 
example the following structure:

parent project: parent
modules: module1, module2, module3

I created parent/src/main/resources/application.properties,  ran "mvn 
clean package" and expected
to see in each target directory and jar that file, e.g. 
parent/module1/target/main/resources/application.properties.
But that didn't happen. I tried it with and without declaring

  <build>
    <resources>
      <resource>
        <directory>src/main/resources</directory>
        <filtering>true</filtering>
      </resource>
     </resources>
  </build>

at my top level pom, but that didn't help. How can I declare global 
resources?

Question 2:
I would like to change some resources depending on the deployment 
environment. E.g., application.resources
might contain database connection information, so I thought of putting 
each deployment in a separate dir:

resources.dev/application.resources
resource.production/application.resources
etc.

How can I tell the pom to use only one of those directories as the 
resource directory, depending on
a command line argument? say, "mvn -Dconfig.name=dev" to use 
resources.dev. I am familiar with
filtering, but how do I declare the right resource directory in the pom 
using a filter parameter?

Thanks so much in advance,
Oren

-- 
===========================================================================
PERSISTENT, adj. Remaining infective for a relatively long time in a
vector after an initial period of incubation.  -- Meriam-Webster Dictionary
---------------------------------------------------------------------------
Oren Livne, Ph.D.
RUReady Software Architect
Academic Outreach and Continuing Education, 1901 E South Campus Dr.
Room 2197-D, University of Utah, Salt Lake City, UT 84112-9399
Tel  : (801) 581-6831     Cell: (801) 631-3885     Fax: (801) 585-5414
Email: olivne@aoce.utah.edu              Web:  http://ruready.net/oren
===========================================================================

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