Open jdillon opened 12 years ago
You can place in them different sub-directories by specifying a path
element in each module's site plugin configuration.
Any reason its not using the standard mechanism to handle this similar to:
https://github.com/stephenc/wagon-gitsite
site-deploy should handle this automatically and configure the locations appropriately.
+1 - its much boilerplate code in order to ensure that every module gets deployed to the correct folder. This is especially annoying as providing multi-module-sites is already not a piece of cake.
Eventually I have found a workaround reading and understanding Maven > Guide to creating a site:
If subprojects inherit the site URL from a parent POM, they will automatically append their
<artifactId>
to form their effective deployment location.
Having this and trying to deploy to a GH-pages subdirectory site/<version>
you need to do these steps in your root POM (and without the need to do additional configuration in the sub-POMs):
Configure <distributionManagement>
as dummy to get the URL from:
<distributionManagement>
<site>
<id>github-pages-site</id>
<name>Deployment through GitHub's site deployment plugin</name>
<url>site/${project.version}</url>
</site>
</distributionManagement>
Disable deployment for the maven-site-plugin
(in this example you also see how to add markdown to your site):
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>3.1</version>
<dependencies>
<dependency>
<!--
| allows markdown syntax for site generation. To use it place files below
| src/site/markdown/[filename].md
-->
<groupId>org.apache.maven.doxia</groupId>
<artifactId>doxia-module-markdown</artifactId>
<version>1.3</version>
</dependency>
</dependencies>
<configuration>
<skipDeploy>true</skipDeploy>
</configuration>
</plugin>
Configure the site-maven-plugin
as follows:
<plugin>
<groupId>com.github.github</groupId>
<artifactId>site-maven-plugin</artifactId>
<version>0.7</version>
<configuration>
<message>Creating site for ${project.artifactId}, ${project.version}</message>
<!-- this does the trick to place every module in the correct subfolder -->
<path>${project.distributionManagement.site.url}</path>
<merge>true</merge>
</configuration>
<executions>
<execution>
<id>github-site</id>
<goals>
<goal>site</goal>
</goals>
<phase>site-deploy</phase>
</execution>
</executions>
</plugin>
Would be great to support the deploy-site workflow out of the box. A few months ago, I just combined it with a few lines of inlay-ant (described over http://goo.gl/2xE7C), but I think, Mark's solution is much more elegant.
I vote for this issue, as I would expect it to behave just as maven-site-plugin does, deploying child modules under the parent directory, without the need of extra configuration in the pom files. Thanks for this plugin :)
Same for me. It's really hard to get things working, even @mmichaelis's solution doesn't seem to work, or hardly, for our projects. I believe this site plugin is the best way to make people re-adopt the site phase in maven and GH's plugin is really worth solving this problem.
I think it would be handy to have <skip>true</skip>
available for the plugin so that it would ignore the plugin it if set to true.
I was able to get a multi-module build to work with @mmichaelis comments, the problem is the site cannot be deployed to the root of the gh-pages branch. So I had to create a initial index.html to point to /site
I really like the idea of this plugin, but I second the comments above that this should be implemented in a wagon (using GitHubClient seems super slow as well)
I gave https://github.com/stephenc/wagon-gitsite a shot but it did not work with an enterprise instance. It looks like it would be trivial to patch it, but the project looks dead (anyone have any thoughts on this?).
+1 waiting for a fix
+1
@bdemers You can remove the /site prefix by taking it out of the configuration:
<distributionManagement>
<site>
<id>github-pages-site</id>
<name>Deployment through GitHub's site deployment plugin</name>
<url>${project.version}</url>
</site>
</distributionManagement>
Is there a sample project on github that demonstrates the multimodule functionality?
:+1: And include documentation!
I created my own wagon implementation to handle github pages https://github.com/trajano/wagon-git and works with multi-module and inherited site projects.
+1 for a fix
+1
@jdillon @bdemers (and for other's FYI) I also had difficulty using @stephenc's wagon plugin, but I did get @trajano's wagon to work after a little fiddling with the ssh. The (presently undocumented) trick for me was to add a server in ~/.m2/settings.xml
. This wagon is nice because it doesn't require a prefix or anything and the site looks "normal" in all regards.
I would imagine it can work with any git repository using the git:ssh type connection. https://github.com/trajano/wagon-git
Notes from my POM:
Set up distribution management in the normal maven way:
<distributionManagement>
<site>
<id>github-project-site</id>
<name>Deployment through GitHub's site deployment plugin</name>
<url>git:ssh://git@github.com/ekohlwey/myproject.git?gh-pages#</url>
</site>
</distributionManagement>
Set up the git site plugin in the normal maven way
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>3.4</version>
<dependencies>
<dependency>
<groupId>org.apache.maven.doxia</groupId>
<artifactId>doxia-module-markdown</artifactId>
<version>1.6</version>
</dependency>
<dependency>
<groupId>net.trajano.wagon</groupId>
<artifactId>wagon-git</artifactId>
<version>2.0.0</version>
</dependency>
</dependencies>
</plugin>
Add a server in ~/.m2/settings.xml
<server>
<id>github-project-site</id>
<username>git</username>
</server>
+1 for this
The current version 2.0.1 simplifies the work a bit for github specific sites as documented in http://site.trajano.net/wagon-git/
The URL is just in the form:
This also works with CNAMEd URIs such as http://site.trajano.net/trajano/ whose https://github.com/trajano/trajano/blob/master/pom.xml#L75 shows the pom.xml being used.
wagon-git (2.0.2) looks promising but always fails for me due to auth. failure (I believe I tried all possible username/password/passphrase/none.. combinations in my settings.xml server; git commands and 'ssh -T git@github.com' works fine.)
[INFO] >>> to github:http://whatever.github.io/proj/./
github:http://whatever.github.io/proj/ - Session: Disconnecting
github:http://whatever.github.io/proj/ - Session: Disconnected
...
@ed the documentation has been updated
On Thu, Mar 26, 2015 at 3:16 PM, Igor Rodchenkov notifications@github.com wrote:
wagon-git (2.0.2) looks promising but always fails for me due to auth. failure (I believe I tried all possible username/password/passphrase/none.. combinations in my settings.xml server; git commands and 'ssh -T git@github.com' works fine.) [INFO] >>> to github:http://whatever.github.io/proj/./ github:http://whatever.github.io/proj/ - Session: Disconnecting
github:http://whatever.github.io/proj/ - Session: Disconnected...
Reply to this email directly or view it on GitHub: https://github.com/github/maven-plugins/issues/22#issuecomment-86676866
Which documentation? (https://github.com/trajano/wagon-git is still the same as yesterday)
It's been updated a while back. I forgot to note on the ticket. This is in regards to @ed comment.
On Thu, Mar 26, 2015 at 3:44 PM, Igor Rodchenkov notifications@github.com wrote:
Which documentation? (https://github.com/trajano/wagon-git is still the same as yesterday)
Reply to this email directly or view it on GitHub: https://github.com/github/maven-plugins/issues/22#issuecomment-86687794
I have 10 pom.xml files in a project, and I get exactly 10 commits & pushes when I run mvn site
. What is a good way to condense all this into 1 commit and 1 push, or at the very least, multiple commits and 1 push (multiple pushes are bad for heroku)? I tried the wagon plugin but didn't notice any difference (i.e. there were still multiple pushes and the diffs between output docs were essentially identical).
:+1:
Any update on this issue? Or is the recommendation now not to use the plugin but the standard site plugin with wagon-git?
Hi,
Using mostly mmichaelis's and anjackson's comments in this thread, I finally found a configuration that works ok for our project (the site is deployed to the gh-pages branch https://github.com/PathwayCommons/cpath2/tree/gh-pages, and shows up online http://pathwaycommons.github.io/cpath2/6.1.0-SNAPSHOT/)
See in the pom.xml: https://github.com/PathwayCommons/cpath2/blob/master/pom.xml#L385 https://github.com/PathwayCommons/cpath2/blob/master/pom.xml#L855 https://github.com/PathwayCommons/cpath2/blob/master/pom.xml#L996 etc. (but you need to edit the project.distributionmanagement.url if you want to perform site:stage first; see the comments there)
All the best, Igor R.
On Fri, Jun 12, 2015 at 6:07 PM, Florian Brunner notifications@github.com wrote:
Any update on this issue? Or is the recommendation now not to use the plugin but the standard site plugin with wagon-git?
— Reply to this email directly or view it on GitHub https://github.com/github/maven-plugins/issues/22#issuecomment-111630118 .
A simple solution is to cleverly use the path and url
<plugin>
<groupId>com.github.github</groupId>
<artifactId>site-maven-plugin</artifactId>
<version>0.12</version>
<configuration>
<message>Creating site for ${project.url} version ${project.version}</message>
<host>${github.host}</host>
<server>${github.server.id}</server>
<path>${github.site.path}</path>
<merge>true</merge>
</configuration>
<executions>
<execution>
<goals>
<goal>site</goal>
</goals>
<phase>site</phase>
</execution>
</executions>
</plugin>
<url>https://github.com/XsubinX/multi-module-parent</url>
<properties>
<github.host>github.com</github.host>
<github.server.id>github</github.server.id> <!-- id as in your settings.xml-->
<github.site.path>${project.version}</github.site.path>
</properties>
_Do not add url. Let it inherit from parent_
<properties>
<github.site.path>${project.version}/${project.artifactId}</github.site.path>
</properties>
That's an excellent answer, sounds like what I was long looking for, and I am going to try this a.s.a.p.
Thanks a lot.
On Thu, Jan 21, 2016 at 11:45 AM, Subin Sugunan notifications@github.com wrote:
A simple solution is to cleverly use the path and url
com.github.github site-maven-plugin 0.12 Creating site for ${project.url} version ${project.version} ${github.host} ${github.server.id} ${github.site.path} true site site In parent
https://github.com/XsubinX/multi-module-parent github.com github ${project.version} In child projects
Do not add url. Let it inherit from parent
${project.version}/${project.artifactId} — Reply to this email directly or view it on GitHub https://github.com/github/maven-plugins/issues/22#issuecomment-173630031 .
I have done a somewhat detailed analysis and came up with a decent work-around
Hello everyone,
Now year 2021, 9 years after the issue was opened, would it be possible to have true support for multi-module site deployment for site plugin please?
Many thanks!
When running the github site plugin on a mutli-module build (such as https://github.com/sonatype/install4j-support) each module's site will be deployed into the top-level directory, clobbering the previous module and generally making an unusable site.