gpt4 book ai didi

maven-2 - 如何抑制/控制 Wagon-FTP Maven 扩展的日志记录?

转载 作者:行者123 更新时间:2023-12-01 04:14:16 29 4
gpt4 key购买 nike

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

[...]
[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 站点插件有关,而不是 wagon ftp(它只是 apache-commons-net ftp 客户端的简单适配器)。见source of AbstractDeployPlugin从第 310 行开始。

   Debug debug = new Debug();

wagon.addSessionListener( debug );

wagon.addTransferListener( debug );

在哪里 Debug正在使用标准输出。

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

关于maven-2 - 如何抑制/控制 Wagon-FTP Maven 扩展的日志记录?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4564018/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com