Guimiot Isabelle created MSITE-725:
--------------------------------------
Summary: site deploy, distributionManagement and pom inheritance :
fail to resolve settings.xml properties
Key: MSITE-725
URL: https://jira.codehaus.org/browse/MSITE-725
Project: Maven Site Plugin
Issue Type: Bug
Components: site:deploy
Affects Versions: 3.4, 3.3
Environment: windows / linux
Reporter: Guimiot Isabelle
Priority: Critical
I have a blocker issue with distribution management URL for site deployment,
when I use a property coming from the maven settings.xml file, and I define the
distrib management in a super pom : it fails when running site deploy commands
on sub-projects.
You can reproduce it very easily :
- In the settings, add a property sitePublishDir pointing to
file://C:/whereyoudeploymavensites/
- Create a root project with this pom :
{code}
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>com.test</groupId>
<artifactId>testsite1</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>level 1</name>
<distributionManagement>
<site>
<id>site</id>
<url>${sitePublishDir}</url>
</site>
</distributionManagement>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>3.4</version>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
{code}
- create a sub project with this pom :
{code}
<project>
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.test</groupId>
<artifactId>testsite1</artifactId>
<version>1.0.0-SNAPSHOT</version>
</parent>
<groupId>com.test</groupId>
<artifactId>testsite2</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>level 2</name>
</project>
{code}
Then, run a "clean install site-deploy" command on project root -> it works
Run the same command on the sub project, you get that error :
{code}
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.751 s
[INFO] Finished at: 2014-07-15T12:43:56+02:00
[INFO] Final Memory: 15M/224M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal
org.apache.maven.plugins:maven-site-plugin:3.4:deploy (default-deploy) on
project testsite2: Execution default-deploy of goal
org.apache.maven.plugins:maven-site-plugin:3.4:deploy failed: Base URI is not
absolute: $%7bsitePublishDir%7d -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal
org.apache.maven.plugins:maven-site-plugin:3.4:deploy (default-deploy) on
project testsite2: Execution default-deploy of goal
org.apache.maven.plugins:maven-site-plugin:3.4:deploy failed: Base URI is not
absolute: $%7bsitePublishDir%7d
at
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:224)
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:120)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:347)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:154)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:213)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:157)
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: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.PluginExecutionException: Execution
default-deploy of goal org.apache.maven.plugins:maven-site-plugin:3.4:deploy
failed: Base URI is not absolute: $%7bsitePublishDir%7d
at
org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:143)
at
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
... 19 more
Caused by: java.lang.IllegalArgumentException: Base URI is not absolute:
$%7bsitePublishDir%7d
at
org.apache.maven.doxia.site.decoration.inheritance.URIPathDescriptor.<init>(URIPathDescriptor.java:73)
at
org.apache.maven.plugins.site.deploy.AbstractDeployMojo.getTopLevelProject(AbstractDeployMojo.java:827)
at
org.apache.maven.plugins.site.deploy.SiteDeployMojo.determineDeploySite(SiteDeployMojo.java:67)
at
org.apache.maven.plugins.site.deploy.AbstractDeployMojo.getDeploySite(AbstractDeployMojo.java:235)
at
org.apache.maven.plugins.site.deploy.AbstractDeployMojo.execute(AbstractDeployMojo.java:166)
at
org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:132)
... 20 more
{code}
I precise that I get the exact same error if I duplicate the distribution
management in the sub project pom.
The only ugly workaround I've found so far is to add a -DsitePublishDir=xxx in
the command line : in this case, it works fine, but the sitePublishDir
information is duplicated :(
--
This message was sent by Atlassian JIRA
(v6.1.6#6162)