You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Philippe De Neve (Jira)" <ji...@apache.org> on 2024/10/27 19:13:00 UTC
[jira] [Comment Edited] (MDEP-932) Don't log successful file copies
[ https://issues.apache.org/jira/browse/MDEP-932?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17893282#comment-17893282 ]
Philippe De Neve edited comment on MDEP-932 at 10/27/24 7:12 PM:
-----------------------------------------------------------------
Wondering if the {{silent}} parameter is still relevant after resolution of this ticket?
{{-> mvn help:describe -Dplugin=org.apache.maven.plugins:maven-dependency-plugin:3.8.1 -Dgoal=copy-dependencies -Ddetail}}
{{...}}
{{ silent (Default: false)}}
{{ User property: silent}}
{{ If the plugin should be silent.}}
{{...}}
was (Author: JIRAUSER306977):
Wondering if the {{silent}} parameter still relevant after resolution of this ticket?
{{-> mvn help:describe -Dplugin=org.apache.maven.plugins:maven-dependency-plugin:3.8.1 -Dgoal=copy-dependencies -Ddetail}}
{{...}}
{{ silent (Default: false)}}
{{ User property: silent}}
{{ If the plugin should be silent.}}
{{...}}
> Don't log successful file copies
> --------------------------------
>
> Key: MDEP-932
> URL: https://issues.apache.org/jira/browse/MDEP-932
> Project: Maven Dependency Plugin
> Issue Type: Improvement
> Reporter: Elliotte Rusty Harold
> Assignee: Elliotte Rusty Harold
> Priority: Minor
> Fix For: 3.8.1
>
>
> In AbstractDependencyMojo
> Either a file is copied successfully and no one wants to read this message or it fails and an exception is thrown. Either way, the log message simply isn't needed and gets in the way of debugging real failures.
> /**
> * Does the actual copy of the file and logging.
> *
> * @param artifact represents the file to copy.
> * @param destFile file name of destination file.
> * @throws MojoExecutionException with a message if an error occurs.
> */
> protected void copyFile(File artifact, File destFile) throws MojoExecutionException {
> try {
> getLog().info("Copying "
> + (this.outputAbsoluteArtifactFilename ? artifact.getAbsolutePath() : artifact.getName()) + " to "
> + destFile);
> if (artifact.isDirectory()) {
> // usual case is a future jar packaging, but there are special cases: classifier and other packaging
> throw new MojoExecutionException("Artifact has not been packaged yet. When used on reactor artifact, "
> + "copy should be executed after packaging: see MDEP-187.");
> }
> FileUtils.copyFile(artifact, destFile);
> buildContext.refresh(destFile);
> } catch (IOException e) {
> throw new MojoExecutionException("Error copying artifact from " + artifact + " to " + destFile, e);
> }
> }
--
This message was sent by Atlassian Jira
(v8.20.10#820010)