How to use Wagon maven plugin with FTPS - maven

I'm using the below configuration to upload files to a remote server through FTPS protocol :
<extensions>
<extension>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-ftp</artifactId>
<version>3.0.0</version>
</extension>
</extensions>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>wagon-maven-plugin</artifactId>
<version>1.0-beta-3</version>
<configuration>
<skip>true</skip>
<url>ftps://username:password#ip_address</url>
<fromDir>${project.build.directory}</fromDir>
<toDir>.</toDir>
</configuration>
<executions>
<execution>
<id>upload</id>
<phase>deploy</phase>
<goals>
<goal>upload</goal>
</goals>
</execution>
</executions>
</plugin>
If i use only FTP instead of FTPS in the url parameter the goal is executed successfully and data are sent to the remote server, but when I use FTPS for security reasons, I get the below error :
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:wagon-maven-plugin:1.0-beta-3:upload (default-cli) on project XXX: The parameters 'url' for goal org.codehaus.mojo:wagon-maven-plugin:1.0-beta-3:upload are missing or invalid
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
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:116)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
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.populatePluginFields(DefaultMavenPluginManager.java:641)
at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getConfiguredMojo(DefaultMavenPluginManager.java:594)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:121)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
'

I solved the issue using the below configuration :
Pom.xml :
<extensions>
<extension>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-ftp</artifactId>
<version>3.0.0</version>
</extension>
</extensions>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>wagon-maven-plugin</artifactId>
<version>1.0-beta-3</version>
<configuration>
<serverId>serverid</serverId>
<skip>true</skip>
<url>ftps://ip_address:port</url>
<fromDir>${project.build.directory}</fromDir>
<toDir>.</toDir>
</configuration>
<executions>
<execution>
<id>upload</id>
<phase>deploy</phase>
<goals>
<goal>upload</goal>
</goals>
</execution>
</executions>
</plugin>
Settings.xml :
<server>
<id>serverid</id>
<username>XXXXXX</username>
<password>XXXXXX</password>
<configuration>
<endpointChecking>false</endpointChecking>
<securityProtocol>TLS</securityProtocol>
<implicit>true</implicit>
<passiveMode>true</passiveMode>
</configuration>
</server>
Thank you !

I don't have an ability to test the answer in my environment, but it seems that Wagon supports FTPS mode with FTP provider.
The documentation however states that you should configure the securityProtocol to be FTPS for this, since the default is TLS.
// settings.xml
<server>
<id>ftp.server.id</id>
<username>username</username>
<password>password</password>
<configuration>
....
<securityProtocol>FTPS</securityProtocol> <-- !!!
</configuration>
</server>

I ran into a similar issue recently. In my case, because my FTP server's certificate was self-signed, I did have to disable endpointChecking:
<endpointChecking>false</endpointChecking>
However, it also appears that the Wagon FTP provider does not support encrypted data connections. I see no mention in the code of
FTPSClient.execProt("P");
Since I am running vsftpd as my FTP server, it was necessary to allow unencrypted data connections server-side as well:
# vsftpd.conf
...
force_local_data_ssl=NO
In my case, the use of the <implicit> setting was counter-productive, as vsftpd by default negotiates the port rather than using the implicit one.

Related

jmeter-analysis-plugin IllegalArgumentException: Null or zero length 'values' argument

I am getting an illegal argument exception when running the jmeter-analysis plugin. I have validated all the output .jtl files and it doesn't appear that the xml files are malformed. Below I have posted the maven command I am using to run the performance test suite (which runs fine), as well as my project structure, pom and output. I can't quite figure out what is going on, as everything was actually working before I updated the JMeter test plan in the .jmx. The suite runs fine in the JMeter GUI and runs fine before it gets to the analyze step. Has anyone encountered this before? What can I do to solve this?
Maven
mvn -pl performance-tests clean verify -U -X
Project Structure
Project
Performance Test Module
src
test
jmeter
performance-tests.jmx
resources
properties
artifact_headers.properties
artifact_users.properties
index.html
POM
<?xml version="1.0" encoding="UTF-8"?>
<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">
<parent>
<artifactId>artifact-id</artifactId>
<groupId>com.group.id</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>performance-tests</artifactId>
<profiles>
<profile>
<id>default</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<threads>1</threads>
<loops>1</loops>
<ramp>1</ramp>
<delay>1</delay>
<account></account>
<password></password>
</properties>
</profile>
</profiles>
<properties>
<com.artifact.jmeter.test>${project.basedir}/src/test/jmeter/*.jmx</com.artifact.jmeter.test>
<com.artifact.target.environment>https://dev-dot-api-dot-labs-horizon-1.appspot.com</com.artifact.target.environment>
<com.artifact.jmeter.loops>${loops}</com.artifact.jmeter.loops>
<com.artifact.jmeter.threads>${threads}</com.artifact.jmeter.threads>
<com.artifact.jmeter.ramp>${ramp}</com.artifact.jmeter.ramp>
<com.artifact.jmeter.startup.delay>${delay}</com.artifact.jmeter.startup.delay>
<com.artifact.jmeter.account>${account}</com.artifact.jmeter.account>
<com.artifact.jmeter.password>${password}</com.artifact.jmeter.password>
<reportdirectory>${project.build.directory}/results</reportdirectory>
<kg.apc.version>1.4.0</kg.apc.version>
<commons.lang.version>2.6</commons.lang.version>
<net.minidev.version>2.3</net.minidev.version>
<surefire.version>2.19.1</surefire.version>
</properties>
<dependencies>
<dependency>
<groupId>com.vault</groupId>
<artifactId>vault-lib</artifactId>
<version>2.13</version>
</dependency>
<dependency>
<groupId>org.apache.maven.surefire</groupId>
<artifactId>surefire-junit47</artifactId>
<version>${surefire.version}</version>
</dependency>
<dependency>
<groupId>net.minidev</groupId>
<artifactId>json-smart</artifactId>
<version>${net.minidev.version}</version>
</dependency>
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<version>${commons.lang.version}</version>
</dependency>
<dependency>
<groupId>kg.apc</groupId>
<artifactId>jmeter-plugins-standard</artifactId>
<version>${kg.apc.version}</version>
</dependency>
<dependency>
<groupId>kg.apc</groupId>
<artifactId>jmeter-plugins-extras</artifactId>
<version>${kg.apc.version}</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>com.lazerycode.jmeter</groupId>
<artifactId>jmeter-maven-plugin</artifactId>
<version>2.0.3</version>
<executions>
<execution>
<id>jmeter-tests</id>
<goals>
<goal>jmeter</goal>
</goals>
</execution>
</executions>
<configuration>
<customPropertiesFiles>
<file>${project.build.directory}/jmeter/bin/properties/artifact_headers.properties</file>
<file>${project.build.directory}/jmeter/bin/properties/artifact_users.properties</file>
</customPropertiesFiles>
<propertiesFilesDirectory>${project.build.directory}/jmeter/bin/properties</propertiesFilesDirectory>
<jmeterExtensions>
<extension>commons-lang:commons-lang:2.6</extension>
<extension>net.minidev:json-smart:2.3</extension>
<artifact>kg.apc:jmeter-plugins-standard:1.4.0</artifact>
<artifact>kg.apc:jmeter-plugins-extras:1.4.0</artifact>
<artifact>kg.apc:jmeter-plugins-extras-libs:1.4.0</artifact>
<artifact>org.apache.jmeter:jorphan:3.0</artifact>
</jmeterExtensions>
<propertiesUser>
<jmeter.loops>${com.artifact.jmeter.loops}</jmeter.loops>
<jmeter.threads>${com.artifact.jmeter.threads}</jmeter.threads>
<jmeter.ramp>${com.artifact.jmeter.ramp}</jmeter.ramp>
<jmeter.account>${com.artifact.jmeter.account}</jmeter.account>
<jmeter.password>${com.artifact.jmeter.password}</jmeter.password>
<RESULTS_PATH>${reportdirectory}</RESULTS_PATH>
</propertiesUser>
<propertiesJMeter>
<aggregate_rpt_pct1>80</aggregate_rpt_pct1>
<aggregate_rpt_pct2>90</aggregate_rpt_pct2>
<aggregate_rpt_pct3>99</aggregate_rpt_pct3>
</propertiesJMeter>
<overrideRootLogLevel>warning</overrideRootLogLevel>
<testResultsTimestamp>false</testResultsTimestamp>
<!--<resultsFileFormat>csv</resultsFileFormat>-->
<resultsDirectory>${reportdirectory}</resultsDirectory>
</configuration>
</plugin>
<plugin>
<groupId>com.lazerycode.jmeter</groupId>
<artifactId>jmeter-analysis-maven-plugin</artifactId>
<version>1.0.6</version>
<executions>
<execution>
<phase>verify</phase>
<id>thread</id>
<goals>
<goal>analyze</goal>
</goals>
<configuration>
<!--<source>${project.build.directory}/**/*.jtl</source>-->
<source>${reportdirectory}/performance-tests.jtl</source>
<targetDirectory>${reportdirectory}/generatedreport</targetDirectory>
<sourceDirFailed>false</sourceDirFailed>
<checkResult>
<throughput>
<threshold>-1</threshold>
<toleranceDirection>UPPER_LOWER_TOLERANCE</toleranceDirection>
<tolerance>5</tolerance>
</throughput>
<errors>
<threshold>-1</threshold>
<toleranceDirection>UPPER_LOWER_TOLERANCE</toleranceDirection>
<tolerance>5</tolerance>
</errors>
</checkResult>
<configurationCharts>
<width>950</width>
<height>500</height>
</configurationCharts>
<maxSamples>50000</maxSamples>
<preserveDirectories>false</preserveDirectories>
<sampleNames>
<sampleName>sample</sampleName>
<sampleName>httpSample</sampleName>
</sampleNames>
<processAllFilesFound>true</processAllFilesFound>
<remoteResourcesFromUntilDateFormat>HH:mm_yyyyMMdd</remoteResourcesFromUntilDateFormat>
<writers>
<!--<com.lazerycode.jmeter.analyzer.writer.SummaryTextToStdOutWriter/>-->
<!--<com.lazerycode.jmeter.analyzer.writer.SummaryTextToFileWriter/>-->
<!--<com.lazerycode.jmeter.analyzer.writer.HtmlWriter/>-->
<!--<com.lazerycode.jmeter.analyzer.writer.DetailsToCsvWriter/>-->
<com.lazerycode.jmeter.analyzer.writer.DetailsToHtmlWriter/>
<com.lazerycode.jmeter.analyzer.writer.ChartWriter/>
</writers>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>3.0.1</version>
<executions>
<execution>
<id>copy-resources</id>
<phase>validate</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/jmeter/bin</outputDirectory>
<resources>
<resource>
<directory>${pom.basedir}/src/test/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Stack Trace
[ERROR] Failed to execute goal com.lazerycode.jmeter:jmeter-analysis-maven-plugin:1.0.6:analyze (thread) on project performance-tests: Error analysing: Null or zero length 'values' argument. -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.lazerycode.jmeter:jmeter-analysis-maven-plugin:1.0.6:analyze (thread) on project performance-tests: Error analysing
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
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:116)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
at org.codehaus.classworlds.Launcher.main(Launcher.java:47)
Caused by: org.apache.maven.plugin.MojoExecutionException: Error analysing
at com.lazerycode.jmeter.analyzer.AnalyzeMojo.execute(AnalyzeMojo.java:233)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
... 21 more
Caused by: java.lang.IllegalArgumentException: Null or zero length 'values' argument.
at org.jfree.data.statistics.HistogramDataset.getMinimum(HistogramDataset.java:221)
at org.jfree.data.statistics.HistogramDataset.addSeries(HistogramDataset.java:136)
at com.lazerycode.jmeter.analyzer.writer.ChartWriter.createResponseTimesPlot(ChartWriter.java:188)
at com.lazerycode.jmeter.analyzer.writer.ChartWriter.writeCharts(ChartWriter.java:95)
at com.lazerycode.jmeter.analyzer.writer.ChartWriter.write(ChartWriter.java:65)
at com.lazerycode.jmeter.analyzer.ResultAnalyzer.analyze(ResultAnalyzer.java:47)
at com.lazerycode.jmeter.analyzer.AnalyzeMojo.analyze(AnalyzeMojo.java:318)
at com.lazerycode.jmeter.analyzer.AnalyzeMojo.execute(AnalyzeMojo.java:217)
... 23 more
I have downloaded the plugin and see the exception is happening with ChartWriter component when it doesn't have 'values' to generate charts (I think).
To by-pass it without changing code, you can disable ChartWriter (if you not really need it) by changing in pom as below.
<plugin>
<groupId>com.lazerycode.jmeter</groupId>
<artifactId>jmeter-analysis-maven-plugin</artifactId>
<version>1.0.6</version>
<executions>
<execution>
<id>create-html-report</id>
<phase>test</phase>
<configuration>
<processAllFilesFound>true</processAllFilesFound>
<source>${project.build.directory}/**/*.jtl</source>
<writers>
<com.lazerycode.jmeter.analyzer.writer.SummaryTextToStdOutWriter/>
<com.lazerycode.jmeter.analyzer.writer.SummaryTextToFileWriter/>
<com.lazerycode.jmeter.analyzer.writer.HtmlWriter/>
<com.lazerycode.jmeter.analyzer.writer.DetailsToCsvWriter/>
<com.lazerycode.jmeter.analyzer.writer.DetailsToHtmlWriter/>
**<!--<com.lazerycode.jmeter.analyzer.writer.ChartWriter/>-->**
</writers>
</configuration>
<goals>
<goal>analyze</goal>
</goals>
</execution>
</executions>
</plugin>
I've been struggled with this issue for while, finally figured it out.
I installed JMeter-3.2, but copied a jmx file created during version-3.1. After I created a new jmx file under new version, it works.
Not sure you had same experience. Hope it helps.
Remark: This is not an direct answer to the question, but a possible solution to the given exception of jmeter-analysis-maven-plugin.
In my case all tests fail because of server errors (unauthorized). So you first should check the jtl file (here performance-tests.jtl) for valid entries:
<httpSample t="329" lt="329" ts="1551219503246" s="false" lb="/" rc="401" rm="Unauthorized" tn="performancetest 1-6" dt="text" by="932" ng="9" na="9"/>

Maven Deploy to Nexus Fails When Deploying Artifact with Classifier

All,
I have a Spring Boot Application which needs to be deployed to Nexus as both a library and an executable jar. Spring provides a way to have both using the following bit of code in the POM file.
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>1.5.3.RELEASE</version>
<configuration>
<classifier>exec</classifier>
</configuration>
</plugin>
</plugins>
</build>
This produces the following two JARs.
(a) target/[artifact]-[version].jar
(b) target/[artifact]-[version]-exec.jar
Previous to adding the code to the POM, I am able to deploy artifact (a) to Nexus without issue. However, once I add the code, I get the following exception.
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy (default-deploy) on project [artifact-id]: Failed to deploy artifacts: Could not find artifact [group-id]:[artifact-id]:jar:exec:[version]-[iteration] in nexus.ftc.lab ([nexus-url])
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
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:116)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoExecutionException: Failed to deploy artifacts: Could not find artifact [group-id]:[artifact-id]:jar:exec:[version]-[iteration] in nexus.ftc.lab ([nexus-url])
at org.apache.maven.plugin.deploy.DeployMojo.deployProject(DeployMojo.java:284)
at org.apache.maven.plugin.deploy.DeployMojo.execute(DeployMojo.java:169)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
... 20 more
Caused by: org.apache.maven.artifact.deployer.ArtifactDeploymentException: Failed to deploy artifacts: Could not find artifact [group-id]:[artifact-id]:jar:exec:[version]-[iteration] in nexus.ftc.lab ([nexus-url])
at org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:143)
at org.apache.maven.plugin.deploy.AbstractDeployMojo.deploy(AbstractDeployMojo.java:171)
at org.apache.maven.plugin.deploy.DeployMojo.deployProject(DeployMojo.java:279)
... 23 more
Caused by: org.eclipse.aether.deployment.DeploymentException: Failed to deploy artifacts: Could not find artifact [group-id]:[artifact-id]:jar:exec:[version]-[iteration] in nexus.ftc.lab ([nexus-url])
at org.eclipse.aether.internal.impl.DefaultDeployer.deploy(DefaultDeployer.java:317)
at org.eclipse.aether.internal.impl.DefaultDeployer.deploy(DefaultDeployer.java:245)
at org.eclipse.aether.internal.impl.DefaultRepositorySystem.deploy(DefaultRepositorySystem.java:413)
at org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:139)
... 25 more
Caused by: org.eclipse.aether.transfer.ArtifactNotFoundException: Could not find artifact [group-id]:[artifact-id]:jar:exec:[version]-[iteration] in nexus.ftc.lab ([nexus-url])
at io.takari.aether.connector.AetherRepositoryConnector$2.wrap(AetherRepositoryConnector.java:893)
at io.takari.aether.connector.AetherRepositoryConnector$2.wrap(AetherRepositoryConnector.java:1)
at io.takari.aether.connector.AetherRepositoryConnector$PutTask.flush(AetherRepositoryConnector.java:743)
at io.takari.aether.connector.AetherRepositoryConnector.put(AetherRepositoryConnector.java:345)
at org.eclipse.aether.internal.impl.DefaultDeployer.deploy(DefaultDeployer.java:311)
... 28 more
To add to the intrigue. I tried building another JAR using more standard code. When I deploy using this, it works fine.
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<classifier>client</classifier>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
One more update, when I try the below, it fails with the same exception.
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<shadedArtifactAttached>true</shadedArtifactAttached>
<shadedClassifierName>fat</shadedClassifierName>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
This issue was caused by request filtering limits in an IIS proxy.
By default, the maximum allowed content length was 30 MB. This was blocking my post of a ~90 MB jar file. Increasing the limit to 512 MB fixed the problem.

Add maven's output directory to exec:java classpath

I want to add the target/classes directory to maven's exec:java classpath. The compilation and runtime dependencies are handled fine, but the resources copied from src/*/resources are not available during execution. I am almost sure it is because the plugins' classpath includes only the project dependencies and not the target/classes directory. I'd like to be able to run the application during development as mvn clean compile exec:java
while leaving all properties files, and other files in the resources directories.
I've tried several variations of exec configuration but I can't seem to get it right:
my pom.xml:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<configuration>
<executable>java</executable>
<mainClass>Example</mainClass>
<arguments>
<argument>-cp</argument>
<classpath/>
<argument>%classpath:target/classes</argument>
<argument>someFile.txt</argument>
</arguments>
</configuration>
</plugin>
I don't think this one is correct syntax because I'm getting an ArrayStoreException:
java.lang.ArrayStoreException
at java.lang.System.arraycopy(Native Method)
at java.util.Arrays.copyOf(Arrays.java:2763)
at java.util.ArrayList.toArray(ArrayList.java:305)
at org.codehaus.plexus.component.configurator.converters.composite.ArrayConverter.fromConfiguration(ArrayConverter.java:141)
at org.codehaus.plexus.component.configurator.converters.ComponentValueSetter.configure(ComponentValueSetter.java:247)
at org.codehaus.plexus.component.configurator.converters.composite.ObjectWithFieldsConverter.processConfiguration(ObjectWithFieldsConverter.java:137)
at org.codehaus.plexus.component.configurator.BasicComponentConfigurator.configureComponent(BasicComponentConfigurator.java:56)
at org.apache.maven.plugin.DefaultPluginManager.populatePluginFields(DefaultPluginManager.java:1357)
at org.apache.maven.plugin.DefaultPluginManager.getConfiguredMojo(DefaultPluginManager.java:724)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:468)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
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.jav
I used example configuration poms from here and here.
By default the target/classes and all the dependencies are in the classpath when you use exec-maven-plugin plugin.
I have similar setup and following config works for me. In my Test class I read one xml file as Thread.currentThread().getContextClassLoader().getResourceAsStream("mapping.xml"). I have kept the file in src/main/resources which after build is available under target/classes.
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<executions>
<execution>
<goals>
<goal>exec</goal>
</goals>
</execution>
</executions>
<configuration>
<executable>java</executable>
<mainClass>com.Test</mainClass>
</configuration>
</plugin>

How to Generate REST Docs with Enunciate for a Spring-Jersey Project?

I'm struggling with something that I thought is quite simple - to generate documentation for a set of already existing REST services, which are basically just POJOs annotates with JAX-RS annotations. I'm using Jersey as an implementation provider. The REST API is deployed as part of a Spring web application.
I want to generate only the documentation for the REST services POJOs, so my enunciate.xml configuration is something like that:
<?xml version="1.0"?>
<enunciate label="novaglobalapi" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://enunciate.codehaus.org/schemas/enunciate-1.25.xsd">
<api-classes>
<include pattern="com.something.api.rest.*"/>
</api-classes>
<modules>
<docs docsDir="restapi" title="REST API"/>
</modules>
</enunciate>
I've configured my pom.xml as suggested in the enunciate documentation:
<build>
...
<plugin>
<groupId>org.codehaus.enunciate</groupId>
<artifactId>maven-enunciate-plugin</artifactId>
<version>1.25</version>
<executions>
<execution>
<goals>
<goal>docs</goal>
</goals>
</execution>
</executions>
<configuration>
<configFile>enunciate.xml</configFile>
</configuration>
</plugin>
...
</build>
But when I run mvn enunciate:docs, I'm getting the following build error:
[ERROR] Failed to execute goal org.codehaus.enunciate:maven-enunciate-plugin:1.25:docs (default-cli) on project NovaGlobalSSOAPI: Problem assembling the enunciate app. invalid LOC header (bad signature) -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.enunciate:maven-enunciate-plugin:1.25:docs (default-cli) on project NovaGlobalSSOAPI: Problem assembling the enunciate app.
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)
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: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(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.MojoExecutionException: Problem assembling the enunciate app.
at org.codehaus.enunciate.DocsMojo.execute(DocsMojo.java:99)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
... 19 more
Caused by: java.util.zip.ZipException: invalid LOC header (bad signature)
at java.util.zip.ZipFile.read(Native Method)
at java.util.zip.ZipFile.access$1200(ZipFile.java:31)
at java.util.zip.ZipFile$ZipFileInputStream.read(ZipFile.java:459)
at java.util.zip.ZipFile$1.fill(ZipFile.java:242)
at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:141)
at java.io.DataInputStream.readFully(DataInputStream.java:178)
at java.util.jar.JarFile.getBytes(JarFile.java:362)
at java.util.jar.JarFile.getManifestFromReference(JarFile.java:161)
at java.util.jar.JarFile.getManifest(JarFile.java:148)
at org.codehaus.enunciate.main.Enunciate.scanClasspath(Enunciate.java:409)
at org.codehaus.enunciate.main.Enunciate.doGenerate(Enunciate.java:319)
at org.codehaus.enunciate.ConfigMojo$MavenSpecificEnunciate.doGenerate(ConfigMojo.java:634)
at org.codehaus.enunciate.main.Enunciate$Stepper.step(Enunciate.java:1706)
at org.codehaus.enunciate.main.Enunciate$Stepper.stepTo(Enunciate.java:1738)
at org.codehaus.enunciate.DocsMojo.execute(DocsMojo.java:95)
... 21 more
I can not figure out, what am I doing wrong. Any ideas?
Does it happen if you configure the documentation directory?
<build>
...
<plugin>
<groupId>org.codehaus.enunciate</groupId>
<artifactId>maven-enunciate-plugin</artifactId>
<version>1.25</version>
<executions>
<execution>
<goals>
<goal>docs</goal>
</goals>
</execution>
</executions>
<configuration>
<!-- the directory where to put the docs -->
<docsDir>${project.build.directory}/docs</docsDir>
<configFile>enunciate.xml</configFile>
</configuration>
</plugin>
...
</build>
Edit: forgot to close docsDir
Use the following code in your maven pom:
<build>
<plugins>
<plugin>
<groupId>com.webcohesion.enunciate</groupId>
<artifactId>enunciate-maven-plugin</artifactId>
<version>${enunciate.version}</version>
<configuration>
<sourcepath-includes>
<sourcepath-include>
<groupId>com.your.company.web.rest</groupId>
</sourcepath-include>
<sourcepath-include>
<groupId>com.external</groupId>
<artifactId>external</artifactId>
</sourcepath-include>
</sourcepath-includes>
</configuration>
<executions>
<execution>
<goals>
<goal>assemble</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
With the following property:
<properties><enunciate.version>2.10.1</enunciate.version></properties>
In your maven home make sure you have an xml file called enunciate.xml with the following lines of code:
<enunciate xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://enunciate.webcohesion.com/schemas/enunciate-2.0.0-M.4.xsd">
<title>Your Company REST API</title>
<description package="com.your.company.web.api"/>
<copyright>www.yourcompany.com</copyright>
<api-classes>
<include pattern="com.your.company.web.rest.*"/>
</api-classes>
<modules>
<docs docsDir="src/main/webapp/restapi" title="Your Company REST API"/>
<jackson disabled="true"/>
<swagger basePath="/yourcompany/api/"/>
</modules>
</enunciate>

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

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.
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?

Resources