I think I've got this working as I want with the following config. The plugin
order matters, as the antrun-plugin and the site-plugin both bind to the
post-site phase and the ant run-plugin's goal must run first.
<build>
<plugins>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>stage-for-scm-publish</id>
<phase>post-site</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<copy
todir="${project.build.directory}/site/site-versions/${project.version}">
<fileset dir="${project.build.directory}/site">
<exclude name="site-versions"/>
</fileset>
</copy>
</target>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-scm-publish-plugin</artifactId>
<configuration>
<scmBranch>gh-pages</scmBranch>
<pubScmUrl>scm:git:[email protected]:<username>/${project.artifactId}.git</pubScmUrl>
<ignorePathsToDelete>
<ignorePathToDelete>site-versions</ignorePathToDelete>
</ignorePathsToDelete>
</configuration>
<executions>
<execution>
<id>scm-publish</id>
<phase>site-deploy</phase>
<goals>
<goal>publish-scm</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-site-plugin</artifactId>
<configuration>
<skipDeploy>true</skipDeploy>
</configuration>
<executions>
<execution>
<id>stage-for-scm-publish</id>
<phase>post-site</phase>
<goals>
<goal>stage</goal>
</goals>
<configuration>
<skipDeploy>false</skipDeploy>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
On 22 May 2013, at 13:56, Gary Gregory <[email protected]> wrote:
> Please post your finding back here! This is something I'd like to do for
> some of the Apache Commons site too.
>
> Gary
>
>
> On Wed, May 22, 2013 at 8:12 AM, Robert Elliot <[email protected]> wrote:
>
>> Thanks Jörg, that looks like a promising line of investigation.
>>
>> Rob
>>
>> ----- Original Message -----
>>> From: "Jörg Schaible" <[email protected]>
>>> To: [email protected]
>>> Sent: Tuesday, 21 May, 2013 9:46:30 AM
>>> Subject: Re: maven-scm-publish-plugin - prefixing site content with
>> project version?
>>> Hi Rob,
>>>
>>> Robert Elliot wrote:
>>>
>>>> Is the general consensus that this is impossible?
>>>
>>> everything is published by default that is located in target/site. So
>>> you
>>> can solve this by configuring an ant task for the antrun plugin, that
>>> creates a copy in target/site/${version} and bind it to the post-site
>>> lifecycle
>>> (
>> http://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html#Lifecycle_Reference
>> ).
>>>
>>> Cheers,
>>> Jörg
>>>
>>>>
>>>> Rob
>>>>
>>>> ----- Original Message -----
>>>>> From: "Robert Elliot" <[email protected]>
>>>>> To: [email protected]
>>>>> Sent: Saturday, 18 May, 2013 10:29:25 PM
>>>>> Subject: maven-scm-publish-plugin - prefixing site content with
>>>>> project
>>>>> version? Hi,
>>>>>
>>>>> I'm using the maven-scm-publish-plugin to publish to gh-pages.
>>>>>
>>>>> I'd like to publish the site twice - once to the root of the branch
>>>>> (so that http://me.github.com/project-name is the maven site) and
>>>>> once
>>>>> to it prefixed with the version (so that
>>>>> http://me.github.com/project-name/1.2.3/ is also the maven site).
>>>>> Rationale is to have a historical record of what the project looked
>>>>> like, particularly the JavaDoc - it's nice for anyone using my
>>>>> libraries to be able to link their JavaDoc to the correct version
>>>>> of
>>>>> my JavaDoc. I certainly appreciate libraries that allow me to do
>>>>> this.
>>>>>
>>>>> Does this sound like something I ought to be able to do already?
>>>>> And
>>>>> if so, could someone give me a pointer?
>>>>>
>>>>> Thanks,
>>>>> Rob
>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: [email protected]
>>>>> For additional commands, e-mail: [email protected]
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [email protected]
>>> For additional commands, e-mail: [email protected]
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [email protected]
>> For additional commands, e-mail: [email protected]
>>
>>
>
>
> --
> E-Mail: [email protected] | [email protected]
> Java Persistence with Hibernate, Second
> Edition<http://www.manning.com/bauer3/>
> JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
> Spring Batch in Action <http://www.manning.com/templier/>
> Blog: http://garygregory.wordpress.com
> Home: http://garygregory.com/
> Tweet! http://twitter.com/GaryGregory
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]