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

I am deploying a Maven site over FTP using Wagon-FTP . It works fine, but the output is full of data on the FTP / authentication connection, which effectively reveals logins and passwords to everyone (especially if the project is open source and its CI protocols are available to the public):

[...] [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 magazine? Or configure it ... This is the 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> [...] 
+4
source share
1 answer

It is impossible, and this is mainly due to the maven site plugin, and not to wagon ftp (which is just a simple adapter for the apache-commons-net ftp client). See source AbstractDeployPlugin from line 310.

  Debug debug = new Debug(); wagon.addSessionListener( debug ); wagon.addTransferListener( debug ); 

Where Debug uses standard output.

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

+2
source

Source: https://habr.com/ru/post/1333801/


All Articles