MSITE-546 defines exactly what I observed, NPE when configuration is provided. At this moment this issue blocks me to use Maven 3. Site deployment is done by Bamboo installed as windows service and there is no good place for know_hosts file. NullKnownHostProvider is the only way which I've found to avoid interactive ssh session.
For m2 it could be a version incompatibility. But even when I configured extension to use 1.0-beta-4 version, exception was thrown. As Lukas said, I don't need ssh extension to deploy site, so the issue is not critical. But wagon providers (or extensions generally) should be isolated from regular dependencies. BTW. Why m-deploy-p requires extensions for deployment but m-site-p not? Thanks, Marcin On 25 January 2011 16:20, Lukas Theussl <ltheu...@apache.org> wrote: > > For the NPE in m3, this has just been filed: > http://jira.codehaus.org/browse/MSITE-546 > > For m2, I'm not sure I understand you correctly, first you say it works, > then you say it doesn't with the ssh extension (which you shouldn't need for > scp). Maybe it's a version incompatibility, the current site plugin (m2) has > a dependency on wagon-provider-api-1.0-beta-4. > > HTH, > -Lukas > > > Marcin Kuthan wrote: >> >> Hi >> >> I'm working on corporate pom and I would keep common corporate pom >> version for Maven 2 and Maven 3. But I can't configure site deployment >> with scp wagon provider for Maven 2 and 3. >> >> To avoid interaction during scp deployment I configured server with >> NullKnownHostProvider in settings.xml. >> >> <server> >> <id>site</id> >> <username>site</username> >> <password>password</password> >> <configuration> >> <knownHostsProvider >> >> implementation="org.apache.maven.wagon.providers.ssh.knownhost.NullKnownHostProvider"> >> <hostKeyChecking>no</hostKeyChecking> >> </knownHostsProvider> >> </configuration> >> </server> >> >> With Maven 2 I'm able to deploy site successfully but Maven 3 throws NPE: >> >> [ERROR] Failed to execute goal >> org.apache.maven.plugins:maven-site-plugin:3.0-beta-3:stage-deploy >> (default-cli) on project corporate-pom: Execution default-cli of goal >> org.apache.maven.plugins:maven-site-plugin:3.0-beta-3:stage-deploy >> failed. NullPointerException -> [Help 1] >> org.apache.maven.lifecycle.LifecycleExecutionException: Failed to >> execute goal >> org.apache.maven.plugins:maven-site-plugin:3.0-beta-3:stage-deploy >> (default-cli) on project corporate-pom: Execution default-cli of goal >> org.apache.maven.plugins:maven-site-plugin:3.0-beta-3:stage-deploy >> failed. >> at >> org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:225) >> at >> org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153) >> at >> org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145) >> at >> org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84) >> at >> org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59) >> at >> org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183) >> at >> org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161) >> at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:319) >> at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156) >> at org.apache.maven.cli.MavenCli.execute(MavenCli.java:534) >> at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196) >> at org.apache.maven.cli.MavenCli.main(MavenCli.java:141) >> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >> at >> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) >> at >> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) >> at java.lang.reflect.Method.invoke(Method.java:597) >> at >> org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290) >> at >> org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230) >> at >> org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409) >> at >> org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352) >> Caused by: org.apache.maven.plugin.PluginExecutionException: Execution >> default-cli of goal >> org.apache.maven.plugins:maven-site-plugin:3.0-beta-3:stage-deploy >> failed. >> at >> org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:116) >> at >> org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209) >> ... 19 more >> Caused by: java.lang.NullPointerException >> at >> org.apache.maven.plugins.site.SiteDeployMojo.configureWagon(SiteDeployMojo.java:474) >> at >> org.apache.maven.plugins.site.SiteStageDeployMojo.deployStagingSite(SiteStageDeployMojo.java:185) >> at >> org.apache.maven.plugins.site.SiteStageDeployMojo.execute(SiteStageDeployMojo.java:145) >> at >> org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:107) >> ... 20 more >> >> I was surprised that for site deployment with scp there is no need to >> add wagon-ssh extension to my pom (at least for Maven 3). But if I >> declare extension: >> >> <extension> >> <groupId>org.apache.maven.wagon</groupId> >> <artifactId>wagon-ssh</artifactId> >> <version>1.0-beta-7</version> >> </extension> >> >> Site deployment with Maven 2 also fails (Maven3 throws NPE again): >> >> [INFO] Trace >> org.apache.maven.lifecycle.LifecycleExecutionException: Unable to >> configure Wagon: 'scp' >> at >> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:719) >> at >> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:569) >> at >> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:539) >> at >> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387) >> at >> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348) >> at >> org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180) >> at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328) >> at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138) >> at org.apache.maven.cli.MavenCli.main(MavenCli.java:362) >> at >> org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60) >> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >> at >> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) >> at >> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) >> at java.lang.reflect.Method.invoke(Method.java:597) >> at >> org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315) >> at org.codehaus.classworlds.Launcher.launch(Launcher.java:255) >> at >> org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430) >> at org.codehaus.classworlds.Launcher.main(Launcher.java:375) >> Caused by: org.apache.maven.plugin.MojoExecutionException: Unable to >> configure Wagon: 'scp' >> at >> org.apache.maven.plugins.site.SiteStageDeployMojo.deployStagingSite(SiteStageDeployMojo.java:168) >> at >> org.apache.maven.plugins.site.SiteStageDeployMojo.execute(SiteStageDeployMojo.java:137) >> at >> org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490) >> at >> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694) >> ... 17 more >> Caused by: org.apache.maven.artifact.manager.WagonConfigurationException: >> While configuring wagon for 'rmavm233': Unable to apply wagon >> configuration. >> at >> org.apache.maven.artifact.manager.DefaultWagonManager.configureWagon(DefaultWagonManager.java:1124) >> at >> org.apache.maven.artifact.manager.DefaultWagonManager.getWagon(DefaultWagonManager.java:137) >> at >> org.apache.maven.plugins.site.SiteStageDeployMojo.deployStagingSite(SiteStageDeployMojo.java:159) >> ... 20 more >> Caused by: >> org.codehaus.plexus.component.configurator.ComponentConfigurationException: >> Invalid parameter supplied while setting >> >> 'org.apache.maven.wagon.providers.ssh.knownhost.NullKnownHostProvider@15fd309' >> to >> org.apache.maven.wagon.providers.ssh.jsch.ScpWagon.setKnownHostsProvider( >> java.lang.Class ) >> at >> org.codehaus.plexus.component.configurator.converters.ComponentValueSetter.setValueUsingSetter(ComponentValueSetter.java:185) >> at >> org.codehaus.plexus.component.configurator.converters.ComponentValueSetter.configure(ComponentValueSetter.java:212) >> at >> org.codehaus.plexus.component.configurator.converters.composite.ObjectWithFieldsConverter.processConfiguration(ObjectWithFieldsConverter.java:137) >> at >> org.apache.maven.artifact.manager.WagonComponentConfigurator.configureComponent(WagonComponentConfigurator.java:44) >> at >> org.codehaus.plexus.component.configurator.AbstractComponentConfigurator.configureComponent(AbstractComponentConfigurator.java:54) >> at >> org.codehaus.plexus.component.configurator.AbstractComponentConfigurator.configureComponent(AbstractComponentConfigurator.java:47) >> at >> org.apache.maven.artifact.manager.DefaultWagonManager.configureWagon(DefaultWagonManager.java:1114) >> ... 22 more >> Caused by: java.lang.IllegalArgumentException: argument type mismatch >> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >> at >> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) >> at >> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) >> at java.lang.reflect.Method.invoke(Method.java:597) >> at >> org.codehaus.plexus.component.configurator.converters.ComponentValueSetter.setValueUsingSetter(ComponentValueSetter.java:177) >> ... 28 more >> >> I've checked wagon-ssh 1.0-beta-6, 1.0-beta-7, define wagonVersion >> property, no luck. >> >> Questions: >> 1. How to set NullKnownHostProvider for Maven 3 site deployments? >> 2. How to avoid conflicts between wagon provider defined as extension >> and maven site plugin wagon dependencies? >> >> All tests were executed on: >> >> http://code.google.com/p/m4enterprise/source/browse/trunk/corporate-pom/pom.xml >> >> Thanks in advance, >> Marcin >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org >> For additional commands, e-mail: users-h...@maven.apache.org >> > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@maven.apache.org > For additional commands, e-mail: users-h...@maven.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org