• Post Reply Bookmark Topic Watch Topic
  • New Topic

Copying different resources files Using Maven  RSS feed

Ben Newton
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 774
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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,
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!