maven-dependency-plugin icon indicating copy to clipboard operation
maven-dependency-plugin copied to clipboard

Improve usage of silent parameter in Copy and Unpack goals

Open slawekjaranowski opened this issue 6 months ago • 6 comments

  • parameter should be defined where is used, so move to child class from root class AbstractDependencyMojo
  • use it during logging of coping or unpacking

slawekjaranowski avatar Sep 13 '25 15:09 slawekjaranowski

@elharo @michael-o I know that you worked on silent parameter, and proposed to deprecate it.

It is directly used only in a few places so I propose move it to place where is used.

I alos remove overvriting logger in Mojo at all - it should be done by -q option.

I would like to have possibility to log what is copied, unpacked - form some of auditing perspective. Using -X debug options is to verbose.

slawekjaranowski avatar Sep 13 '25 20:09 slawekjaranowski

related: https://github.com/apache/maven-dependency-plugin/pull/447

elharo avatar Sep 13 '25 22:09 elharo

I do not want a large set of switches for every imaginable combination of logging this and that but not some other thing. The default is not to log things users don;t need to know and aren't going to act on the vast majority of the time. If you need more than that, turn on the debug logs. Yes, it's verbose but so is logging every file that's copied.

elharo avatar Sep 13 '25 22:09 elharo

I do not want a large set of switches for every imaginable combination of logging this and that but not some other thing.

so I moved it where is used ... we have small number of switches

The default is not to log things users don;t need to know and aren't going to act on the vast majority of the time.

In this case I think it is useful information what happens

If you need more than that, turn on the debug logs. Yes, it's verbose but so is logging every file that's copied.

Similar we can say, if you don't want logs use -q options

slawekjaranowski avatar Sep 14 '25 07:09 slawekjaranowski

@elharo changing log to system-out make be a problematic in Maven4

I don't understood why we can not use silent option where is needed .. eg is used in GoOfflineMojo

how do you want to replace such code:

https://github.com/apache/maven-dependency-plugin/blob/93776499fe324aa31c91c4ae9f0fb48878c8ab35/src/main/java/org/apache/maven/plugins/dependency/resolvers/GoOfflineMojo.java#L96-L104

Do we want to move every message into debug level?

slawekjaranowski avatar Sep 15 '25 22:09 slawekjaranowski

Yes, exactly. Silent is debug, We don't need anything else. Our logs are vastly too noisy with severe consequences for usability.

elharo avatar Sep 15 '25 23:09 elharo