Class CopyUtil


  • @Named
    @Singleton
    public class CopyUtil
    extends java.lang.Object
    Provide a copyFile method in one place.
    Since:
    3.7.0
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private org.sonatype.plexus.build.incremental.BuildContext buildContext  
      private org.slf4j.Logger logger  
    • Constructor Summary

      Constructors 
      Constructor Description
      CopyUtil​(org.sonatype.plexus.build.incremental.BuildContext buildContext)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void copyArtifactFile​(org.apache.maven.artifact.Artifact sourceArtifact, java.io.File destination)
      Copies the artifact (file).
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • buildContext

        private final org.sonatype.plexus.build.incremental.BuildContext buildContext
      • logger

        private final org.slf4j.Logger logger
    • Constructor Detail

      • CopyUtil

        @Inject
        public CopyUtil​(org.sonatype.plexus.build.incremental.BuildContext buildContext)
    • Method Detail

      • copyArtifactFile

        public void copyArtifactFile​(org.apache.maven.artifact.Artifact sourceArtifact,
                                     java.io.File destination)
                              throws java.io.IOException,
                                     org.apache.maven.plugin.MojoExecutionException
        Copies the artifact (file).
        Parameters:
        sourceArtifact - represents the artifact (file) to copy
        destination - file name of destination file
        Throws:
        java.io.IOException - if copy has failed
        org.apache.maven.plugin.MojoExecutionException - if artifact file is a directory (which has not been packaged yet)
        Since:
        3.7.0