Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Copying different resources files Using Maven

 
Ben Newton
Greenhorn
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

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
Posts: 774
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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,
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic