【问题标题】:How to suppress/control logging of Wagon-FTP Maven extension?如何抑制/控制 Wagon-FTP Maven 扩展的日志记录?
【发布时间】:2010-12-30 15:50:35
【问题描述】:

我正在通过 FTP 部署 Maven 站点,使用 Wagon-FTP。工作正常,但输出中充满了 FTP 连接/身份验证详细信息,这有效地向所有人公开了登录名和密码(特别是如果项目是开源的并且其 CI 协议可公开访问):

[...]
[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 /
[...]

是否可以禁止此日志记录?或者配置一下……这是我pom.xml的一段,里面用到了Wagon-FTP:

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

【问题讨论】:

标签: maven-2 maven maven-3 wagon maven-wagon-plugin


【解决方案1】:

不可能,基本上它与 maven 站点插件有关,而不是 wagon ftp(它只是 apache-commons-net ftp 客户端的简单适配器)。请参阅第 310 行中的 source of AbstractDeployPlugin

   Debug debug = new Debug();

   wagon.addSessionListener( debug );

   wagon.addTransferListener( debug ); 

Debug 使用标准输出。

恕我直言,如果 Wagon 源代码中不需要,那么好的解决方案是使用更复杂的 SessionListener 或标志来避免 addSessionListener(debug)。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-10-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-07-22
    • 1970-01-01
    相关资源
    最近更新 更多