如何抑制/控制 Wagon-FTP Maven 扩展的日志记录?
我正在通过 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>
[...]
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>
[...]
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不可能,基本上它与 maven 站点插件有关,而不是 wagon ftp (这只是 apache-commons-net ftp 客户端的一个简单适配器)。请参阅 AbstractDeployPlugin 的来源 来自第 310 行。
其中 Debug 正在使用标准输出。
恕我直言,如果 Wagon 源代码中不需要,最好的解决方案是使用更复杂的 SessionListener 或标志来避免 addSessionListener(debug) 。
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.
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.