How to suppress/control logging of Wagon-FTP Maven extension?

孤人 提交于 2019-12-10 15:29:21

问题


I'm deploying Maven site by FTP, using Wagon-FTP. Works fine, but output is full of FTP connection/authentication details, which effectively expose logins and passwords to everybody (especially if the project is open source and its CI protocols are publicly accessible):

[...]
[INFO] 
[INFO] --- maven-site-plugin:3.0-beta-3:deploy (default-deploy) @ rempl ---
Reply received: 220---------- Welcome to Pure-FTPd [privsep] [TLS] ----------
220-You are user number 1 of 50 allowed.
220-Local time is now 09:08. Server port: 21.
220 You will be disconnected after 15 minutes of inactivity.

Command sent: USER ****

Reply received: 331 User **** OK. Password required

Command sent: PASS ********

Reply received: 230-User **** has group access to: ***
230 OK. Current restricted directory is /
[...]

Is it possible to suppress this logging? Or configure it... This is a section of my pom.xml, where Wagon-FTP is used:

[...]
<build>
    <extensions>
        <extension>
            <groupId>org.apache.maven.wagon</groupId>
            <artifactId>wagon-ftp</artifactId>
            <version>1.0-beta-7</version>
        </extension>
    </extensions>
    [...]
</build>
[...]

回答1:


Not possible, and basically it is related to maven site plugin and not the wagon ftp (which is only a simple adapter for the apache-commons-net ftp client). See the source of AbstractDeployPlugin from line 310.

   Debug debug = new Debug();

   wagon.addSessionListener( debug );

   wagon.addTransferListener( debug ); 

Where Debug is using the standard output.

IMHO the nice solution would be to use a more sophisticated SessionListener or a flag to avoid addSessionListener(debug) if not needed in the Wagon source.



来源:https://stackoverflow.com/questions/4564018/how-to-suppress-control-logging-of-wagon-ftp-maven-extension

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!