|
41 | 41 | @Singleton
|
42 | 42 | public class CopyUtil {
|
43 | 43 |
|
44 |
| - private final Logger logger = LoggerFactory.getLogger(CopyUtil.class); |
45 |
| - |
46 | 44 | private final BuildContext buildContext;
|
47 | 45 |
|
| 46 | + private final Logger logger = LoggerFactory.getLogger(CopyUtil.class); |
| 47 | + |
48 | 48 | @Inject
|
49 | 49 | public CopyUtil(BuildContext buildContext) {
|
50 | 50 | this.buildContext = buildContext;
|
51 | 51 | }
|
52 | 52 |
|
53 | 53 | /**
|
54 |
| - * Does the actual copy of the artifact (file) and logging. |
| 54 | + * Copies the artifact (file). |
55 | 55 | *
|
56 |
| - * @param sourceArtifact represents the artifact (file) to copy. |
57 |
| - * @param destination file name of destination file. |
| 56 | + * @param sourceArtifact represents the artifact (file) to copy |
| 57 | + * @param destination file name of destination file |
58 | 58 | * @throws IOException if copy has failed
|
59 | 59 | * @throws MojoExecutionException if artifact file is a directory (which has not been packaged yet)
|
60 | 60 | *
|
61 | 61 | * @since 3.7.0
|
62 | 62 | */
|
63 | 63 | public void copyArtifactFile(Artifact sourceArtifact, File destination) throws IOException, MojoExecutionException {
|
64 |
| - logger.info("Copying artifact '{}' ({}) to {}", sourceArtifact, sourceArtifact.getFile(), destination); |
65 |
| - |
66 | 64 | File source = sourceArtifact.getFile();
|
67 | 65 | if (source.isDirectory()) {
|
68 | 66 | // usual case is a future jar packaging, but there are special cases: classifier and other packaging
|
69 | 67 | throw new MojoExecutionException("Artifact '" + sourceArtifact
|
70 | 68 | + "' has not been packaged yet (is a directory). When used on reactor artifact, "
|
71 | 69 | + "copy should be executed after packaging: see MDEP-187.");
|
72 | 70 | }
|
73 |
| - |
| 71 | + logger.debug("Copying artifact '{}' ({}) to {}", sourceArtifact, sourceArtifact.getFile(), destination); |
74 | 72 | FileUtils.copyFile(source, destination);
|
75 | 73 | buildContext.refresh(destination);
|
76 | 74 | }
|
|
0 commit comments