Deploying Javadocs via the Maven Wagon WebDAV provider to an NTLM-authenticated server

2.5k Views Asked by At

I'm attempting to use Maven to deploy my Javadocs (which are created successfully) to a Sharepoint server, which requires NTLM authentication. I'm using the Maven Wagon plugin with the WebDAV provider to do this. I am using m2eclipse to set up a run configuration to execute goals within a specific profile.

I've essentially pieced together a solution from various solutions I've found regarding these tools. It sounds as though NTLM may not be supported at all with Maven currently, but other pages have suggested that the tag may allow for this. I've also seen solutions where the deployment site is specified in distribution management, contrary to Apache's usage page for it. At any rate, I'm encountering a number of problems.

First of all, when I run from the run configuration menu (which executes 'clean' and 'package' within the 'release' profile), the Wagon plugin, which contains an execution of the 'wagon:upload' goal within the 'package' phase, the execution is ignored. It creates the project jar and the Javadocs, and attaches the sources, but the Wagon plugin does not execute.

I've also attempted to run the 'wagon:upload' goal on its own once the Javadocs have been created separately, but I encounter this error (in debug):

[DEBUG] Configuring mojo org.codehaus.mojo:wagon-maven-plugin:1.0-beta-3:upload
from plugin realm ClassRealm[plugin>org.codehaus.mojo:wagon-maven-plugin:1.0-bet
a-3, parent: sun.misc.Launcher$AppClassLoader@11b86e7]
[DEBUG] Configuring mojo 'org.codehaus.mojo:wagon-maven-plugin:1.0-beta-3:upload
' with basic configurator -->
[DEBUG]   (f) followSymLink = false
[DEBUG]   (f) fromDir = C:\Documents and Settings\c40208\IBM\rationalsdp\CEC\cec
-diagnostics
[DEBUG]   (f) optimize = false
[DEBUG]   (f) project = MavenProject: com.mycompany.cec:cec-diagnostics:0.5.0-SNAPSH
OT @ C:\Documents and Settings\c40208\IBM\rationalsdp\CEC\cec-diagnostics\pom.xm
l
[DEBUG]   (f) serverId = serverId
[DEBUG]   (f) settings = org.apache.maven.execution.SettingsAdapter@11b86c7
[DEBUG]   (f) skip = false
[DEBUG]   (f) useDefaultExcludes = true
[DEBUG] -- end configuration --
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.687s
[INFO] Finished at: Fri Apr 13 08:54:34 EDT 2012
[INFO] Final Memory: 5M/15M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:wagon-maven-plugin:1.0-beta-3:u
pload (default-cli) on project cec-diagnostics: The parameters 'url' for goal or
g.codehaus.mojo:wagon-maven-plugin:1.0-beta-3:upload are missing or invalid -> [
Help 1]
    org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal o
rg.codehaus.mojo:wagon-maven-plugin:1.0-beta-3:upload (default-cli) on project c
ec-diagnostics: The parameters 'url' for goal org.codehaus.mojo:wagon-maven-plug
in:1.0-beta-3:upload are missing or invalid
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.java:221)
        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.buildProje
ct(LifecycleModuleBuilder.java:84)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProje
ct(LifecycleModuleBuilder.java:59)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBu
ild(LifecycleStarter.java:183)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(Lifecycl
eStarter.java:161)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
        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(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Laun
cher.java:290)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.jav
a:230)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(La
uncher.java:409)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:
352)
Caused by: org.apache.maven.plugin.PluginParameterException: The parameters 'url
' for goal org.codehaus.mojo:wagon-maven-plugin:1.0-beta-3:upload are missing or
 invalid
        at org.apache.maven.plugin.internal.DefaultMavenPluginManager.populatePl
uginFields(DefaultMavenPluginManager.java:576)
        at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getConfigu
redMojo(DefaultMavenPluginManager.java:529)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(Default
BuildPluginManager.java:92)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.java:209)
        ... 19 more
[ERROR]
[ERROR]
[ERROR] For more information about the errors and possible solutions, please rea
d the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginParamete
rException

I know it's a loaded question, but does anyone have any advice or suggestions which might help me along my way?

Here's my POM file:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.mycompany.cec</groupId>
<artifactId>cec-diagnostics</artifactId>
<version>0.5.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>CEC Diagnostics Jar</name>
<description><![CDATA[Assertion capture and analysis library for Java]]]></description>
<inceptionYear>2011</inceptionYear>
<scm>
    <developerConnection>scm:svn:(FQDN)/(path)</developerConnection>
    <url>(FQDN)/(path)</url>
</scm>
<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <spring.framework.version>3.0.5.RELEASE</spring.framework.version>
    <jar.plugin.version>2.4</jar.plugin.version>
    <bundle.plugin.version>2.3.6</bundle.plugin.version>
    <surefire.plugin.version>2.12</surefire.plugin.version>
    <testng.version>6.3.1</testng.version>
    <javadoc.plugin.version>2.8.1</javadoc.plugin.version>
    <source.plugin.version>2.1.2</source.plugin.version>
    <wagon.plugin.version>1.0-beta-3</wagon.plugin.version>
    <project.info.reports.plugin.version>2.4</project.info.reports.plugin.version>
    <site.plugin.version>3.0</site.plugin.version>
    <pdf.plugin.version>1.2</pdf.plugin.version>
    <confluence.plugin.version>3.1.3</confluence.plugin.version>
    <confluence.root>http://confluence.sys.mycompany.com/confluence</confluence.root>
    <confluence.space>SEI</confluence.space>
</properties>
<dependencies>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-core</artifactId>
        <version>${spring.framework.version}</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-context</artifactId>
        <version>${spring.framework.version}</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-context-support</artifactId>
        <version>${spring.framework.version}</version>
    </dependency>
    <dependency>
        <groupId>org.testng</groupId>
        <artifactId>testng</artifactId>
        <version>${testng.version}</version>
    </dependency>
</dependencies>
<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-jar-plugin</artifactId>
            <version>${jar.plugin.version}</version>
            <configuration>
                <archive>
                    <index>true</index>
                    <manifest>
                        <addClasspath>true</addClasspath>
                    </manifest>
                    <manifestEntries>
                        <Specification-Title>${project.name}</Specification-Title>
                        <Specification-Version>${project.version}</Specification-Version>
                        <Specification-Vendor>${project.organization.name}</Specification-Vendor>
                        <Implementation-Title>${project.name}</Implementation-Title>
                        <Implementation-Version>${project.version}</Implementation-Version>
                    </manifestEntries>
                </archive>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.apache.felix</groupId>
            <artifactId>maven-bundle-plugin</artifactId>
            <version>${bundle.plugin.version}</version>
            <executions>
                <execution>
                    <id>bundle-manifest</id>
                    <phase>process-classes</phase>
                    <goals>
                        <goal>manifest</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
    </plugins>
    <extensions>
        <extension>
            <groupId>org.apache.maven.wagon</groupId>
            <artifactId>wagon-webdav-jackrabbit</artifactId>
            <version>2.2</version>
        </extension>
    </extensions>
</build>
<profiles>
    <profile>
        <id>release</id>
        <build>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>${javadoc.plugin.version}</version>
                    <executions>
                        <execution>
                            <id>attach-javadocs</id>
                            <goals>
                                <goal>jar</goal>
                            </goals>
                        </execution>
                    </executions>
                    <configuration>
                        <additionalJOption>-J-Dhttp.auth.ntlm.domain=dav:https//(domain)</additionalJOption>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>${source.plugin.version}</version>
                    <executions>
                        <execution>
                            <id>attach-sources</id>
                            <goals>
                                <goal>jar-no-fork</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>wagon-maven-plugin</artifactId>
                    <version>${wagon.plugin.version}</version>
                    <executions>
                        <execution>
                            <id>upload-javadocs</id>
                            <phase>package</phase>
                            <goals>
                                <goal>upload</goal>
                            </goals>
                            <configuration>
                                <serverId>(serverId)</serverId>
                                <fromDir>${project.build.directory}/apidocs</fromDir>
                                <includes>*</includes>
                                <excludes>pom.xml</excludes>
                                <url>dav:https://(domain)/(path)</url>
                                <toDir>(path)</toDir>
                                <optimize>true</optimize>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-site-plugin</artifactId>
                    <version>${site.plugin.version}</version>
                </plugin>
            </plugins>
        </build>
    </profile>
</profiles>
<reporting>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-project-info-reports-plugin</artifactId>
            <version>${project.info.reports.plugin.version}</version>
            <reportSets>
                <reportSet>
                    <reports>
                        <report>summary</report>
                        <report>project-team</report>
                        <report>plugins</report>
                        <report>dependencies</report>
                        <report>scm</report>
                        <report>cim</report>
                        <report>issue-tracking</report>
                    </reports>
                </reportSet>
            </reportSets>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>${javadoc.plugin.version}</version>
            <configuration>
                <show>public</show>
            </configuration>
        </plugin>
    </plugins>
</reporting>
<repositories>
    (repositories)
</repositories>
<distributionManagement>
    (repositories)
</distributionManagement>
<developers>
    (developers)
</developers>
</project>

Hopefully it's understood what's going on despite the fact that I had to censor company-related sites. Additionally, I added proxy and server configurations to settings.xml, as follows:

<proxy>
    <active>true</active>
    <protocol>https</protocol>
    <host>(host address)</host>
    <port>9090</port>
    <username>(username)</username>
    <password>(password)</password>
    <nonProxyHosts>*.mycompany.com</nonProxyHosts>
</proxy>

Server:

<server>
    <id>(the same serverId from the POM)</id>
    <username>(username)</username>
    <password>(password)</password>
</server>

Thanks a lot.

1

There are 1 best solutions below

2
On

Your URL should look like this <url>dav:http://...</url>.

Try beta-4 first and then set per command like -Dwagon.url=. If it still does not work you have to file a ticket at Codehaus's JIRA. The source code seems fine. This is an injection problem. Can you try another Maven version?