This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach 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 Murach's Java Servlets and JSP this week in the Servlets 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
Author

Copying different resources files Using Maven

Ben Newton
Greenhorn

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

resources/development/project.properties
resources/test/project.properties
resources/production/project.properties

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

classes/development/project.properties
classes/production/projection.properties
classes/test/project.properties

Where as i want something like this

classes/project.properties

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

Best Regards,
Ben
Prithvi Sehgal
Ranch Hand

Joined: Oct 13, 2009
Posts: 774
Hello,

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,


Prithvi,
My Blog, Follow me on Twitter,Scjp Tips, When you score low in mocks, Generics,Scjp Notes, JavaStudyGroup
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Copying different resources files Using Maven
 
Similar Threads
Maven src and netbeans
how to copy resources with maven?
Maven resources/filtering/profiles - build ALL profiles?
Problem in accessing the local files & folders in web application
Please tell me solution for this