protected void copyArtifact()

in src/main/java/org/apache/maven/plugins/dependency/fromDependencies/CopyDependenciesMojo.java [253:289]


    protected void copyArtifact(
            Artifact artifact,
            boolean removeVersion,
            boolean prependGroupId,
            boolean useBaseVersion,
            boolean removeClassifier)
            throws MojoExecutionException {

        String destFileName = DependencyUtil.getFormattedFileName(
                artifact, removeVersion, prependGroupId, useBaseVersion, removeClassifier);

        File destDir = DependencyUtil.getFormattedOutputDirectory(
                useSubDirectoryPerScope,
                useSubDirectoryPerType,
                useSubDirectoryPerArtifact,
                useRepositoryLayout,
                stripVersion,
                stripType,
                outputDirectory,
                artifact);
        File destFile = new File(destDir, destFileName);
        if (destFile.exists()) {
            getLog().warn("Overwriting " + destFile);
        }
        try {
            copyUtil.copyArtifactFile(artifact, destFile);

            // Copy the signature file if the copySignatures flag is true
            if (copySignatures) {
                copySignatureFile(artifact, destDir, destFileName);
            }

        } catch (IOException e) {
            throw new MojoExecutionException(
                    "Failed to copy artifact '" + artifact + "' (" + artifact.getFile() + ") to " + destFile, e);
        }
    }