com.dhptech.maven.stripbom
Class StripBOMMojo

java.lang.Object
  extended by org.apache.maven.plugin.AbstractMojo
      extended by com.dhptech.maven.stripbom.StripBOMMojo
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo

public class StripBOMMojo
extends org.apache.maven.plugin.AbstractMojo

Goal to strip BOMs from UTF-8 text files.


Field Summary
protected static byte[] UTF8_BOM
           
 
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
 
Constructor Summary
StripBOMMojo()
           
 
Method Summary
 void execute()
          Strips the BOMs, if found, from the specified files.
 File getFile()
          Get the single file to strip.
 List<org.apache.maven.shared.model.fileset.FileSet> getFiles()
          The list of fileSets that will specify the files to strip BOMs from.
 boolean isFailBuild()
          True if the build should fail when BOMs are found in any of the files processed.
 boolean isWarnOnly()
          True if we should only warn about BOMs and not actually strip them.
 void setFailBuild(boolean failBuild)
          Sets the failBuild property.
 void setFile(File file)
          Set the single file to strip.
 void setFiles(List<org.apache.maven.shared.model.fileset.FileSet> files)
          Sets the file set list.
 void setWarnOnly(boolean warnOnly)
          Set to true to warn only on finding a BOM.
 
Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UTF8_BOM

protected static final byte[] UTF8_BOM
Constructor Detail

StripBOMMojo

public StripBOMMojo()
Method Detail

getFiles

public List<org.apache.maven.shared.model.fileset.FileSet> getFiles()
The list of fileSets that will specify the files to strip BOMs from.

Returns:
the file sets.

setFiles

public void setFiles(List<org.apache.maven.shared.model.fileset.FileSet> files)
Sets the file set list.

Parameters:
files - the file sets.

getFile

public File getFile()
Get the single file to strip.

Returns:

setFile

public void setFile(File file)
Set the single file to strip.

Parameters:
file -

isWarnOnly

public boolean isWarnOnly()
True if we should only warn about BOMs and not actually strip them.

Returns:
true if warnOnly is true.

setWarnOnly

public void setWarnOnly(boolean warnOnly)
Set to true to warn only on finding a BOM.

Parameters:
warnOnly - true if we should only warn when finding a BOM.

isFailBuild

public boolean isFailBuild()
True if the build should fail when BOMs are found in any of the files processed.

Returns:
the value of the failBuild property.

setFailBuild

public void setFailBuild(boolean failBuild)
Sets the failBuild property.

Parameters:
failBuild - the new value for the failBuild property
See Also:
isFailBuild()

execute

public void execute()
             throws org.apache.maven.plugin.MojoExecutionException
Strips the BOMs, if found, from the specified files.

Throws:
org.apache.maven.plugin.MojoExecutionException


Copyright © 2004-2012 The Kuali Foundation. All Rights Reserved.