[ 
https://issues.apache.org/jira/browse/MSITE-587?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15883520#comment-15883520
 ] 

Peter Rebholz commented on MSITE-587:
-------------------------------------

Not sure if I'm doing this right but...

I think this issue requires consideration for a fix in a future release. The 
reason being is that wagon implementations may prompt for user input (e.g. SCP) 
and, if you are running in a non-interactive session (e.g. Jenkins build), this 
results in an infinite loop of prompts due to how the input prompt is 
implemented (I believe this is in one of the plexus components). The prompting 
behavior should also be fixed to not prompt infinitely, however, the batch flag 
should be respected by the site plugin, allowing the caller to have some 
control over whether the deploy tasks try to prompt or not.

In a build environment like Jenkins, this bug causes an infinite loop that 
fills up the disk with server logs.

Wagon already supports non-interactive executions if the `interactive` property 
is set appropriately. Unfortunately, the site plugin does not propagate the 
batch mode flag to this property.

I'm attaching two files:

1. A simple project with a Vagrantfile that can be used to reproduce the bug. 
To test, extract the archive, execute `vagrant up` from within the project 
directory to start up the vagrant instance. Then, add a `server` entry to  your 
`settings.xml` file with credentials for the vagrant instance (username: 
vagrant, password: vagrant). Execute `mvn -B site-deploy < /dev/null` to 
attempt to deploy in batch mode with /dev/null as standard in. The result is 
you'll be spammed with prompts to add an entry to `known_hosts`.

2. A simple patch to the site plugin that fixes that specific issue. Although, 
it does break one of the WebDav tests and I haven't figured out why. After 
applying the patch, building the plugin, and attempting to perform a batch 
`site-deploy` again (assuming the project is now depending on the version of 
the site plugin you built) you'll get an error instead of an infinite stream of 
prompts.

> site-deploy ignores --batch-mode
> --------------------------------
>
>                 Key: MSITE-587
>                 URL: https://issues.apache.org/jira/browse/MSITE-587
>             Project: Maven Site Plugin
>          Issue Type: Bug
>    Affects Versions: 3.0-beta-3
>            Reporter: Benson Margulies
>         Attachments: batch-mode.patch, site-deploy-example.tar.gz
>
>
> Trying to do a site-deploy on org.apache.maven.plugins:maven-plugins:21 with 
> /opt/apache-maven-3.0.3/bin/mvn site-deploy -Preporting 
> -DstagingRepositoryId=apache.website -X --batch-mode 
> Instead of using the password from my settings.xml, or even my public key 
> info for ssh, or failing due to --batch-mode, it prompts. This is wrong.
> [DEBUG] Configuring mojo 
> 'org.apache.maven.plugins:maven-site-plugin:3.0-beta-3:deploy' with basic 
> configurator -->
> [DEBUG]   (f) chmod = true
> [DEBUG]   (f) chmodMode = g+w,a+rX
> [DEBUG]   (f) chmodOptions = -Rf
> [DEBUG]   (f) inputDirectory = 
> /Users/benson/asf/mvn/plugins/plugins/maven-plugins/target/checkout/target/site
> [DEBUG]   (f) mavenSession = org.apache.maven.execution.MavenSession@5a749436
> [DEBUG]   (f) project = MavenProject: 
> org.apache.maven.plugins:maven-plugins:21 @ 
> /Users/benson/asf/mvn/plugins/plugins/maven-plugins/target/checkout/pom.xml
> [DEBUG]   (f) settings = org.apache.maven.execution.SettingsAdapter@7b8353cf
> [DEBUG] -- end configuration --
> [DEBUG] The site will be deployed to url 
> 'scp://people.apache.org/www/maven.apache.org/plugins/' with id 
> 'apache.website'
> [DEBUG] repository protocol scp
> [DEBUG] getProxy 'protocol' : scp
> [DEBUG] getProxy 'protocol' : scp no ProxyInfo found
> [DEBUG] found proxyInfo null
> [DEBUG] authenticationInfo with id 'apache.website' : bimargulies
> [DEBUG]  configureWagon
> [DEBUG] configureWagon server github-project-site
> [DEBUG] configureWagon server apache.cxf.site
> [DEBUG] configureWagon server sonatype-nexus-snapshots
> [DEBUG] configureWagon server sonatype-nexus-staging
> [DEBUG] configureWagon server apache.releases.https
> [DEBUG] configureWagon server apache.snapshots.https
> [DEBUG] configureWagon server neethi-website
> [DEBUG] configureWagon server apache.website
> [DEBUG] configureWagon server java.net-maven2-repository
> [DEBUG] configureWagon server codehausSnap
> [DEBUG] configureWagon server basis.3rdParty
> [DEBUG] configureWagon server basis.releases
> [DEBUG] configureWagon server basistech.3rdparty
> [DEBUG] configureWagon server basistech.snapshot.repo
> [DEBUG] configureWagon server basistech.repo
> [DEBUG] configureWagon server org.sleuthkit.sleuthkit-hadoop.website
> [DEBUG] configureWagon server codehaus.org
> [DEBUG] configureWagon server codehaus-nexus-staging
> [DEBUG] configureWagon server codehaus-nexus-snapshots
> [DEBUG] connect with authenticationInfo and without proxyInfo
> : Keyboard interactive required, supplied password is ignored
> Password: :



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to