3

I'm using the maven site plugin to create and deploy a site of documentation and resources. There are some javascript files that I would like to filter based on what profile is being used. Problem is, I can't figure out how to get the filtering to work. Has anyone come across this?

I'm using Maven 3 and my resources are all in /src/site/resources which automagically get copied to /target/site by the site plugin.

Thanks!

Josh Johnson
  • 10,729
  • 12
  • 60
  • 83
  • Why do you need to filter site resources? I am curious. – Michael-O Aug 21 '11 at 09:30
  • `var SomeService = function() { var baseUrl = '${someServiceBaseUrl}'; ...` – Josh Johnson Aug 22 '11 at 10:55
  • there is no direct support. BUT the site plugin supports general filtering. This should work out of the box if you have a properties section in your pom (this works for use, I use that). Maybe delcared fiters work too. Just try. – Michael-O Aug 22 '11 at 16:40
  • properties in the pom file doesn't works for me. What do you mean @Michael-O for filters ? – herau Jul 07 '14 at 15:49

1 Answers1

2

The simplest solution is to name the files you would like to filter as: filename.vm which identifies them as velocity macro files which will be filtered automatically.

khmarbaise
  • 92,914
  • 28
  • 189
  • 235