maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John Prystash <>
Subject Re: Maven - Property files Question
Date Fri, 26 Jun 2009 19:27:59 GMT
How about src/main/filters?

From: David Weintraub <>
To: Maven Users List <>
Sent: Friday, June 26, 2009 1:33:52 PM
Subject: Re: Maven - Property files Question

By default, the resources:resources lifecycle automatically copies
everything in the resources folder over to the target/classes folder
when it builds the war or jar.

In order to avoid this, you need to move your property files to
another folder, or if that's not possible, configure the
resources:resources step to skip these files. I recommend that you
create another folder like src/main/properties and stick your property
files in there.

See <>
for information on skipping packaging certain files in your jar/war.

You will also need the assembly plugin to package your war with your
properties files as maybe a zip or tarball. See
<> for
information about the assembly plugin.

Assemblies took me a while to understand. Basically, you create (by
convention) a folder called src/main/assemblies, and you define your
assembly XML files in there. You could have multiple ways of
packaging. For example, you might have one that includes only the
files you install while another includes some documents or source

Normally, you call the assembly XML bin.xml, and the final package
will be something like That is, this is version 1.3
of artifact "foo", and this is a zip file built by the "bin" assembly.
You could have things like, etc.

Then, in your pom.xml, you have to define where the assembly files are
located, and you might also want to modify the lifecycle, so that your
assemblies are built when you do the mvn package. Otherwise, you'll
have to run mvn assembly:assembly.

To give you a better idea, this is what I have in my project's pom.xml
file under the <plugins> section:



The <descriptor> defines where my assembly file lives, and I could
have multiple descriptors.

The <executions> defines that my assembly should be built in the
package phase, so I don't have to remember to run "mvn
assembly:assembly" in order to build the assembly.

The assembly itself is pretty simple:



Hope this helps.

On Thu, Jun 25, 2009 at 4:19 PM, sundar
varadarajan<> wrote:
> Hello,
> I m new to Maven and I m trying to place property and config.xml files
> outside the Jar files. Here is my current directory
> Src
>  main
>  java
>  resources
> test
>  java
>  resources
> under java, i have all the java class files and in resources folder i have
> the properties and springbatch xml files.
> when i package the application, the property files which are under
> src/main/resources is also getting included. I need to place this outside
> the jar file so that the application can pickup when ever i make any changes
> to the property. currently i need to package again whenever a small change
> is made.
> please help.
> Thanks,
> Sundar

David Weintraub

To unsubscribe, e-mail:
For additional commands, e-mail:

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message