This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes Ant, Maven and Other Build Tools and the fly likes Copying different resources files Using Maven Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Copying different resources files Using Maven" Watch "Copying different resources files Using Maven" New topic

Copying different resources files Using Maven

Ben Newton

Joined: Feb 11, 2010
Posts: 1
Dear All,

I am new to Maven and i am encountering the following problem at hand.

I have made a multi-module project. The project eventually has to build an EAR artifact from a WAR file.
We have different properties files for different environments i.e.

- Development
- Test
- Production

My resource folder architecture is given as below


Now, i have implemented the Profiles approach provided in Maven and then for copying the resources based on different
environments, i was using maven-resources-plugin.

The issue is that, i want to exclude the folders production and test completely when my development profile is activated.
When the war is made in the classes folder three folders are made also


Where as i want something like this


That is referenced in the application-context.xml. Please help me how can i achieve this effect.

Best Regards,
Prithvi Sehgal
Ranch Hand

Joined: Oct 13, 2009
Posts: 774

Please check this
I am implemented same solution today and another way is to use Maven classifiers.
It is not a good approach to have one project building different archives for you. Not a good
practice, the best solution is that, you should have a separate project for every build. Another way
as i already mentioned, use classifiers.

Hope this helps,

My Blog, Follow me on Twitter,Scjp Tips, When you score low in mocks, Generics,Scjp Notes, JavaStudyGroup
I agree. Here's the link:
subject: Copying different resources files Using Maven
It's not a secret anymore!