Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How do I eliminate certain files from my Maven WAR final build?

 
Dave Alvarado
Ranch Hand
Posts: 436
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I'm using Maven 3.0.4. I have some environment specific properties files (e.g. dev_hibernate.cfg.xml), all of which located in my src/main/resources directory. When building my war, I would like these environment specific files removed and so I have this in my pom.xml file …



However, when I run "mvn clean package" the .xml and .properties files are still appearing in my WAR's WEB-INF/classes directory. Can anyone tell what is wrong with the expression above or if there is a better way to do this?

Thanks, - Dave
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34973
379
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you include the <artifactId> for that plugin to make the example runnable on another machine?
 
Dave Alvarado
Ranch Hand
Posts: 436
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I edited my question to include the artifactId.
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why are you copying the files again after deleting them???
 
James Boswell
Bartender
Posts: 1051
5
Chrome Eclipse IDE Hibernate
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm going to take a guess that the WAR file has been created during the package phase before your ant tasks are run. Perhaps try running your ant tasks in the prepare-package phase.
 
Dave Alvarado
Ranch Hand
Posts: 436
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Winner! Thanks, -

ps - Based on the profile used, I'm copying the files from my src/main/resources directory to the WEB-INF/classes directory. However, I don't want to include the other properties files for profiles that aren't used.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic