This can be achieved in Maven by several techniques. The commonality in them being being the regular expression based replacement:
1 Maven Regex Replacement using the [Maven Replacer Plugin][1]
2 Maven Antrun Plugin
Have an ANT target to replace the commented html. For example:
<fileset id="html.fileset"
dir="${build.dir}"
includes="**/*.jsp, **/*.php, **/*.html"/>
<!-- HTML Comments -->
<replaceregexp replace="" flags="g"
match="\<![ \r\n\t]*(--([^\-]|[\r\n]|-[^\-])*--[ \r\n\t]*)\>">
<fileset refid="html.fileset"/>
</replaceregexp>
<!-- Empty lines -->
<replaceregexp match="^\s+[\r\n]" replace="" flags="mg">
<fileset refid="html.fileset"/>
</replaceregexp>
Ant target Source: Link
Invoke this target using the Maven-antrun-plugin.