Skip to content

Commit

Permalink
Gh-6 - Initial skeleton for project reference documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
odrotbohm committed Jul 21, 2022
1 parent 5f83f7a commit 16803a3
Show file tree
Hide file tree
Showing 11 changed files with 389 additions and 24 deletions.
263 changes: 239 additions & 24 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,17 @@
<module>spring-modulith-moments</module>
<module>spring-modulith-starter-jpa</module>
<module>spring-modulith-starter-test</module>
<module>spring-modulith-distribution</module>
</modules>

<properties>

<archunit.version>0.23.1</archunit.version>
<artifactory-maven-plugin.version>3.3.0</artifactory-maven-plugin.version>
<jmolecules-bom.version>2021.2.4</jmolecules-bom.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<spring-doc-resources.version>0.2.5</spring-doc-resources.version>

</properties>

Expand Down Expand Up @@ -95,30 +98,6 @@ limitations under the License.
<module>spring-modulith-integration-test</module>
</modules>

<distributionManagement>
<snapshotRepository>
<id>spring-snapshot</id>
<name>Spring Snapshot Repository</name>
<url>https://repo.spring.io/snapshot</url>
</snapshotRepository>
</distributionManagement>

<repositories>
<repository>
<id>spring-snapshot</id>
<url>https://repo.spring.io/snapshot</url>
<releases>
<enabled>false</enabled>
</releases>
</repository>
<repository>
<id>spring-milestone</id>
<url>https://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
</profile>

<profile>
Expand Down Expand Up @@ -173,6 +152,217 @@ limitations under the License.
</distributionManagement>
</profile>

<profile>

<!--
Profile to be activated when building the docs artifacts.
-->

<id>distribute</id>

<properties>
<shared.resources>${project.build.directory}/shared-resources</shared.resources>
<generated-asciidoc-sources.directory>${project.build.directory}/docs-source</generated-asciidoc-sources.directory>
<generated-docs.directory>${project.build.directory}/generated-docs</generated-docs.directory>
<maven.main.skip>true</maven.main.skip>
<maven.test.skip>true</maven.test.skip>
<maven.install.skip>true</maven.install.skip>
<maven.deploy.skip>true</maven.deploy.skip>
<skipTests>true</skipTests>
</properties>

<build>

<plugins>

<!--
Unpacks the content of spring-doc-resources into the shared resources folder.
-->

<plugin>
<groupId>com.googlecode.maven-download-plugin</groupId>
<artifactId>download-maven-plugin</artifactId>
<executions>
<execution>
<id>unpack-doc-resources</id>
<phase>generate-resources</phase>
<goals>
<goal>wget</goal>
</goals>
<configuration>
<url>https://repo.spring.io/release/io/spring/docresources/spring-doc-resources/${spring-doc-resources.version}/spring-doc-resources-${spring-doc-resources.version}.zip</url>
<unpack>true</unpack>
<outputDirectory>${generated-asciidoc-sources.directory}</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.8</version>
<executions>
<execution>
<id>create-generated-docs-resources</id>
<phase>generate-resources</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>

<!-- All Asciidoctor files to the source directory -->
<copy failonerror="false" todir="${generated-asciidoc-sources.directory}/">
<fileset dir="${project.root}/src/docs/asciidoc" includes="**/*.adoc"/>
</copy>

<!-- All images, too -->
<copy failonerror="false"
todir="${generated-asciidoc-sources.directory}/images/">
<fileset dir="${project.root}/src/docs/asciidoc/images"/>
</copy>

</target>
</configuration>
</execution>
</executions>
</plugin>

</plugins>

<pluginManagement>
<plugins>

<!--
Asciidoctor
-->

<plugin>
<groupId>org.asciidoctor</groupId>
<artifactId>asciidoctor-maven-plugin</artifactId>
<version>2.2.2</version>
<dependencies>
<dependency>
<groupId>org.jruby</groupId>
<artifactId>jruby</artifactId>
<version>9.2.6.0</version>
</dependency>
</dependencies>

<executions>

<execution>
<id>html</id>
<phase>generate-resources</phase>
<goals>
<goal>process-asciidoc</goal>
</goals>
<configuration>
<sourceDirectory>${generated-asciidoc-sources.directory}</sourceDirectory>
<sourceDocumentName>index.adoc</sourceDocumentName>
<outputDirectory>${generated-docs.directory}</outputDirectory>
<sourceHighlighter>highlight.js</sourceHighlighter>
<attributes>
<highlightjsdir>js/highlight</highlightjsdir>
<highlightjs-theme>github</highlightjs-theme>
<linkcss>true</linkcss>
<sectanchors>true</sectanchors>
<stylesdir>./css</stylesdir>
<stylesheet>spring.css</stylesheet>
<toc>left</toc>
</attributes>
</configuration>
</execution>
</executions>

<configuration>
<doctype>book</doctype>
<attributes>
<docinfo>shared</docinfo>
<icons>font</icons>
<sectids>false</sectids>
<imagesdir>images</imagesdir>
<version>${project.version}</version>
<projectName>${project.name}</projectName>
<projectVersion>${project.version}</projectVersion>
<springVersion>${spring.version}</springVersion>
<toclevels>4</toclevels>
<numbered>true</numbered>
</attributes>
</configuration>

</plugin>

<!--
Creates two zip files for download as well as API and reference documentation distribution.
-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<id>docs</id>
<goals>
<goal>single</goal>
</goals>
<phase>package</phase>
<configuration>
<descriptors>
<descriptor>src/docs/resources/assemblies/docs.xml</descriptor>
</descriptors>
<finalName>spring-modulith-${project.version}</finalName>
<appendAssemblyId>true</appendAssemblyId>
</configuration>
</execution>
</executions>
</plugin>

<!-- Deploy to Artifactory -->

<plugin>
<groupId>org.jfrog.buildinfo</groupId>
<artifactId>artifactory-maven-plugin</artifactId>
<version>${artifactory-maven-plugin.version}</version>
<executions>
<execution>
<id>deploy-docs</id>
<goals>
<goal>publish</goal>
</goals>
<phase>deploy</phase>
<configuration>
<artifactory>
<includeEnvVars>false</includeEnvVars>
</artifactory>
<deployProperties>
<zip.name>spring-modulith-docs</zip.name>
<zip.displayname>spring-modulith-docs</zip.displayname>
<zip.deployed>false</zip.deployed>
<zip.type>docs</zip.type>
</deployProperties>
<buildInfo>
<!-- Retain only a single build -->
<buildName>Spring Modulith Docs ${project.version}</buildName>
<buildRetentionCount>1</buildRetentionCount>
</buildInfo>
<publisher>
<contextUrl>{{artifactory.server}}</contextUrl>
<username>{{artifactory.username}}</username>
<password>{{artifactory.password}}</password>
<repoKey>{{artifactory.distribution-repository}}</repoKey>
<snapshotRepoKey>{{artifactory.distribution-repository}}</snapshotRepoKey>
<includePatterns>*-docs.zip</includePatterns>
</publisher>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
</build>
</profile>

</profiles>

<dependencyManagement>
Expand Down Expand Up @@ -301,4 +491,29 @@ limitations under the License.
<tag>main</tag>
</scm>

<distributionManagement>
<snapshotRepository>
<id>spring-snapshot</id>
<name>Spring Snapshot Repository</name>
<url>https://repo.spring.io/snapshot</url>
</snapshotRepository>
</distributionManagement>

<repositories>
<repository>
<id>spring-snapshot</id>
<url>https://repo.spring.io/snapshot</url>
<releases>
<enabled>false</enabled>
</releases>
</repository>
<repository>
<id>spring-milestone</id>
<url>https://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>

</project>
38 changes: 38 additions & 0 deletions spring-modulith-distribution/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">

<modelVersion>4.0.0</modelVersion>

<artifactId>spring-modulith-distribution</artifactId>

<packaging>pom</packaging>

<name>Spring Modulith - Distribution</name>
<description>Reference documentation and Javadoc</description>

<parent>
<groupId>org.springframework.experimental</groupId>
<artifactId>spring-modulith</artifactId>
<version>0.1.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

<properties>
<project.root>${basedir}/..</project.root>
</properties>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.asciidoctor</groupId>
<artifactId>asciidoctor-maven-plugin</artifactId>
</plugin>
</plugins>
</build>

</project>
11 changes: 11 additions & 0 deletions src/docs/asciidoc/00-preface.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[preface]
[[preface]]
= Preface

[[preface.subheadline]]
== Subheadline
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

10 changes: 10 additions & 0 deletions src/docs/asciidoc/10-fundamentals.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[[fundamentals]]
= Fundamentals

[[fundamentals.subheadline]]
== Subheadline
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

10 changes: 10 additions & 0 deletions src/docs/asciidoc/20-verification.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[[verification]]
= Verifying Application Module Structure

[[verification.subheadline]]
== Subheadline
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

9 changes: 9 additions & 0 deletions src/docs/asciidoc/30-testing.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[[testing]]
= Integration Testing Application Modules

[[testing.subheadline]]
== Subheadline
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
9 changes: 9 additions & 0 deletions src/docs/asciidoc/40-events.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[[events]]
= Working with Application Events

[[events.subheadline]]
== Subheadline
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
9 changes: 9 additions & 0 deletions src/docs/asciidoc/50-moments.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[[moments]]
= Moments -- a Passage of Time Events API

[[moments.subheadline]]
== Subheadline
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Loading

0 comments on commit 16803a3

Please sign in to comment.