• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Copying different resources files Using Maven

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 774
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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,
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic