[ https://jira.codehaus.org/browse/MSITE-617?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=365045#comment-365045 ]
Nikolay Rybak commented on MSITE-617: ------------------------------------- Haven't had a change to really work on minimal example for quite some time, but finally here it is: https://github.com/GreyTeardrop/maven-site-plugin-issue Setup: parent project has {{<distributionManagement>}} section that refers to variable {{nexus.url}} that comes from {{settings.xml}}. If built via reactor, everything works fine. However, if parent and child are built separately (in reality they have different lifecycles and live in different repositories) then {{site:stage}} and {{site:deploy}} for child project break. Steps to reproduce: # {{cd parent; mvn -gs ../settings.xml install}} # {{cd ../child; mvn -gs ../settings.xml verify site}} # {{mvn -gs ../settings.xml site:deploy}} {noformat} $ mvn -gs ../settings.xml site:deploy [INFO] Scanning for projects... [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building child 1.0.0-SNAPSHOT [INFO] ------------------------------------------------------------------------ [INFO] [INFO] --- maven-site-plugin:3.4:deploy (default-cli) @ child --- SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". SLF4J: Defaulting to no-operation (NOP) logger implementation SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details. http://${nexus.url}/nexus/content/repositories/site/ - Session: Opened [INFO] Pushing D:\Home\Grey\work\Projects\maven-site-plugin-issue\child\target\site [INFO] >>> to http://${nexus.url}/nexus/content/repositories/site/../../../../../nexus:8081/nexus/content/repositories/site/child http://${nexus.url}/nexus/content/repositories/site/ - Session: Disconnecting http://${nexus.url}/nexus/content/repositories/site/ - Session: Disconnected [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 1.418s [INFO] Finished at: Sun Mar 15 21:04:41 EET 2015 [INFO] Final Memory: 11M/166M [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-site-plugin:3.4:deploy (default-cli) on project child: Execution default-cli of goal org.apache.maven.plugins:maven-site-plugin:3.4:deploy failed. NullPointerException -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException {noformat} If Site plugin version is changed to 3.0 beta 3 (using Maven 3.0.4) then {{site:deploy}} and {{site:stage}} work just fine. As far as I understand, as of version 3.0 Site plugin relativizes URLs based on top-level parent site's URL, and seems not to expand variables in {{distributionManagement}} section. > Variable substitution in the site url doesn't work > -------------------------------------------------- > > Key: MSITE-617 > URL: https://jira.codehaus.org/browse/MSITE-617 > Project: Maven Site Plugin > Issue Type: Bug > Components: site:deploy > Affects Versions: 2.3 > Environment: Windows 7 and RHEL6 > Reporter: Claus Nielsen > > {{site:deploy}} fails because variable substitution in the site url no longer > works (it did in version 2.2). > The distributionManagement section in out POM looks something like this: > {code:xml} > <distributionManagement> > <site> > <id>sites</id> > <name>Project Website</name> > > <url>scp://server/sites/${project.artifactId}/${project.version}</url> > </site> > </distributionManagement> > {code} > Copying the site to the above mentioned url fails with this message: > {noformat} > [INFO] Error uploading site > Embedded error: Error performing commands for file transfer > Exit code: 1 - bash: > /sites/${project.artifactId}/${project.version}/../../id-of-the-artifact/0.2.8-SNAPSHOT: > bad substitution > {noformat} > Ie. the substitutiuon variables have not been substituted, instead the > property values have been appended to the url along with a few dots and > dashes. -- This message was sent by Atlassian JIRA (v6.1.6#6162)