[
https://issues.apache.org/jira/browse/MSITE-738?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14679240#comment-14679240
]
David Andrianavalontsalama commented on MSITE-738:
--------------------------------------------------
The project’s distributionManagement/site/url is used as a relative path to its
topLevelProject. E.g., if the top project’s site/url is
https://company/repo/sites/pub/xxx/yyy/, and the current project’s site/url is
https://company/repo/sites/private/zzz/ttt/, then what will be pushed is
https://company/repo/sites/pub/xxx/yyy/../../../private/zzz/ttt/pages.html
This seems to cause Sonatype Nexus 2.11.4 to fail during the upload
(NullPointerException in: Target.isPathContained.)
Furthermore, the wrong credentials are applied: Those for the top project’s
site/id, not for the current project’s one.
The “determineDeploySite()” method should at least check that the current
project doesn’t declare a distributionManagement/site, and if it does, return
getSite(project).
> SiteDeployMojo#determineDeploySite code/javadoc inconsistent. Javadoc seems
> more correct
> ----------------------------------------------------------------------------------------
>
> Key: MSITE-738
> URL: https://issues.apache.org/jira/browse/MSITE-738
> Project: Maven Site Plugin
> Issue Type: Bug
> Components: site:deploy
> Affects Versions: 3.4
> Reporter: Grégory Joseph
>
> The javadoc of this method seems to be the desired behavior:
> {code}
> /**
> * Deploy directly to the current project's distribution management site.
> */
> @Override
> protected Site determineDeploySite()
> throws MojoExecutionException
> {
> return getSite( getTopLevelProject( project ) );
> }
> {code}
> However, the code indicates it goes all the way in the parent pom hierarchy ?
> Why ?
> * The outcome is inconsistent with the effective-pom
> * I'd assume if my pom declares a {{distributionManagement/site}} section, it
> should be used, rather than the site plugin trying to be smarter and use the
> parent pom's info then somewhat relativize ? This leads to the same issues I
> bumped into a couple years ago (when I didn't bother plugging my debugger in)
> :
> http://maven.40175.n5.nabble.com/Site-deployment-url-and-inheritance-td5712737.html
> This can cause at least two problems:
> * One can't deploy a site to a host that's different than that of the parent
> pom
> * Permissions on the server-side might not be applied correctly (perhaps the
> project's deployer doesn't have permissions to deploy into the path
> configured in the parent, but does in the path of his project.. however we
> try to deploy to {{...parent/../../project/...}}.
> Additionally, this just get confusing, because {{mvn help:effective-pom}}
> gives me the {{distributionManagement/site}} section I expect, but the site
> plugin ends up doing something else.
> Reverting to {code}
> protected Site determineDeploySite()
> throws MojoExecutionException
> {
> return getSite( project );
> }
> {code}
> Fixes the problem as far as I can tell, since project is already
> resolved/effective model, isn't it ? I'm not sure what sure what commit
> #1480820 was fixing.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)