Class CopyMojo

java.lang.Object
org.apache.maven.plugin.AbstractMojo
com.coderplus.plugins.CopyMojo
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo

@Mojo(name="copy", defaultPhase=GENERATE_SOURCES, threadSafe=true) public class CopyMojo extends org.apache.maven.plugin.AbstractMojo
Copy files during build
Since:
1.0
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private org.sonatype.plexus.build.incremental.BuildContext
     
    private File
    The target file to which the file should be copied(this shouldn't be a directory but a file which does or does not exist)
    private List<FileSet>
    Collection of FileSets to work on (FileSet contains sourceFile and destinationFile).
    (package private) boolean
    Ignore File Not Found errors during incremental build
    (package private) boolean
    Overwrite files
    private org.apache.maven.project.MavenProject
     
    private File
    The file which has to be copied

    Fields inherited from interface org.apache.maven.plugin.Mojo

    ROLE
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    private void
    copy(File srcFile, File destFile)
     
    void
     

    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 Details

    • sourceFile

      @Parameter(required=false) private File sourceFile
      The file which has to be copied
      Since:
      1.0
    • destinationFile

      @Parameter(required=false) private File destinationFile
      The target file to which the file should be copied(this shouldn't be a directory but a file which does or does not exist)
      Since:
      1.0
    • fileSets

      @Parameter(required=false) private List<FileSet> fileSets
      Collection of FileSets to work on (FileSet contains sourceFile and destinationFile). See Usage for details.
      Since:
      1.0
    • overWrite

      @Parameter(property="copy.overWrite", defaultValue="true") boolean overWrite
      Overwrite files
      Since:
      1.0
    • ignoreFileNotFoundOnIncremental

      @Parameter(property="copy.ignoreFileNotFoundOnIncremental", defaultValue="true") boolean ignoreFileNotFoundOnIncremental
      Ignore File Not Found errors during incremental build
      Since:
      1.0
    • project

      @Component private org.apache.maven.project.MavenProject project
      Since:
      1.0
    • buildContext

      @Component private org.sonatype.plexus.build.incremental.BuildContext buildContext
  • Constructor Details

    • CopyMojo

      public CopyMojo()
  • Method Details

    • execute

      public void execute() throws org.apache.maven.plugin.MojoExecutionException
      Throws:
      org.apache.maven.plugin.MojoExecutionException
    • copy

      private void copy(File srcFile, File destFile) throws org.apache.maven.plugin.MojoExecutionException
      Throws:
      org.apache.maven.plugin.MojoExecutionException