Difference between revisions of "Multi-Module Maven with github pages"

From BITPlan Wiki
Jump to navigation Jump to search
Line 58: Line 58:
 
** https://github.com/trajano/app/blob/wagon-git-example/pom.xml
 
** https://github.com/trajano/app/blob/wagon-git-example/pom.xml
 
** https://github.com/khuxtable/wagon-gitsite (2011)
 
** https://github.com/khuxtable/wagon-gitsite (2011)
 +
** https://mvnrepository.com/artifact/com.github.stephenc.wagon/wagon-gitsite (2014-11)

Revision as of 17:35, 23 August 2018

Motivation

The issues

led to the creation of the example project:

in which the github maven site plugin is defined with the configuration

<!-- git hub site plugin https://github.com/github/maven-plugins -->
<plugin>
  <groupId>com.github.github</groupId>
  <artifactId>site-maven-plugin</artifactId>
  <version>${site-maven-plugin.version}</version>
  <configuration>
    <message>Creating site for ${github.owner} ${github.project}
      ${project.version}</message>
    <repositoryName>${github.project}</repositoryName>      <!-- github repo name -->
    <repositoryOwner>${github.owner}</repositoryOwner>    <!-- github username -->
  </configuration>
  <executions>
    <execution>
      <goals>
        <goal>site</goal>
      </goals>
      <phase>site</phase>
    </execution>
  </executions>
</plugin>

Following the suggestion of https://stackoverflow.com/a/19336536/1497139 led to adding

  <distributionManagement>
    <site>
      <id>${project.artifactId}-site</id>
      <url>${project.baseUri}</url>
    </site>
  </distributionManagement>

to the parent pom.xml

mvn clean site 
... wait a long while ...

[INFO] Multi-Module ....................................... SUCCESS [04:22 min]
[INFO] Multi-Module 1 ..................................... SUCCESS [04:09 min]
[INFO] Multi-Module 2 ..................................... SUCCESS [04:09 min]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 12:42 min

and you end up with Module 2 overriding the results of the Multi-Module and Module 1 results

Stackoverflow questions