#841 - Deploy documentation and schema through Artifactory.
This commit is contained in:
334
parent/pom.xml
334
parent/pom.xml
@@ -84,6 +84,7 @@
|
||||
<source.level>1.8</source.level>
|
||||
<dist.id>${project.artifactId}</dist.id>
|
||||
<jacoco.destfile>${project.build.directory}/jacoco.exec</jacoco.destfile>
|
||||
<maven.kotlin.skip>false</maven.kotlin.skip>
|
||||
|
||||
<apt>1.1.3</apt>
|
||||
<aspectj>1.9.3</aspectj>
|
||||
@@ -280,17 +281,21 @@
|
||||
<profile>
|
||||
|
||||
<!--
|
||||
Profile to be activated when building the distribution atrifacts.
|
||||
|
||||
Generates reference documentation, aggregates JavaDoc etc. Has to be combined with
|
||||
profiles "release" or "milestone" to deploy artifacts into the appropriate places.
|
||||
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}/generated-asciidoc-sources/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.kotlin.skip>true</maven.kotlin.skip>
|
||||
<maven.install.skip>true</maven.install.skip>
|
||||
<maven.deploy.skip>true</maven.deploy.skip>
|
||||
<skipTests>true</skipTests>
|
||||
</properties>
|
||||
|
||||
@@ -321,16 +326,16 @@
|
||||
<goals>
|
||||
<goal>unpack-dependencies</goal>
|
||||
</goals>
|
||||
<phase>prepare-package</phase>
|
||||
<phase>generate-resources</phase>
|
||||
<configuration>
|
||||
<includeGroupIds>${project.groupId}</includeGroupIds>
|
||||
<includeArtifactIds>spring-data-build-resources</includeArtifactIds>
|
||||
<includeTypes>zip</includeTypes>
|
||||
<excludeTransitive>true</excludeTransitive>
|
||||
<outputDirectory>${shared.resources}</outputDirectory>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<includeGroupIds>${project.groupId}</includeGroupIds>
|
||||
<includeArtifacIds>spring-data-build-resources</includeArtifacIds>
|
||||
<includeTypes>zip</includeTypes>
|
||||
<excludeTransitive>true</excludeTransitive>
|
||||
<outputDirectory>${shared.resources}</outputDirectory>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
<!--
|
||||
@@ -372,11 +377,6 @@
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
<!--
|
||||
Copies all namespaces schemas to target/schemas flatten the directory structure.
|
||||
Depended on by the site.xml assembly descriptor.
|
||||
-->
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-antrun-plugin</artifactId>
|
||||
@@ -409,15 +409,22 @@
|
||||
</execution>
|
||||
|
||||
<execution>
|
||||
<id>collect-schema-files</id>
|
||||
<phase>prepare-package</phase>
|
||||
<id>create-generated-docs-resources</id>
|
||||
<phase>process-resources</phase>
|
||||
<configuration>
|
||||
<target>
|
||||
<copy todir="${project.build.directory}/schemas">
|
||||
<fileset dir="${basedir}" erroronmissingdir="false">
|
||||
<include name="**/src/main/resources/**/config/spring-*.xsd"/>
|
||||
<copy failonerror="false" todir="${generated-asciidoc-sources.directory}/">
|
||||
<fileset dir="${project.root}/src/main/asciidoc" includes="**/*.adoc"/>
|
||||
</copy>
|
||||
<copy failonerror="false" todir="${generated-asciidoc-sources.directory}/images/">
|
||||
<fileset dir="${project.root}/src/main/asciidoc/images"/>
|
||||
</copy>
|
||||
|
||||
<copy todir="${generated-docs.directory}">
|
||||
<fileset dir="${generated-asciidoc-sources.directory}">
|
||||
<include name="css/**"/>
|
||||
<include name="js/**"/>
|
||||
</fileset>
|
||||
<flattenmapper/>
|
||||
</copy>
|
||||
</target>
|
||||
</configuration>
|
||||
@@ -444,6 +451,11 @@
|
||||
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.jfrog.buildinfo</groupId>
|
||||
<artifactId>artifactory-maven-plugin</artifactId>
|
||||
</plugin>
|
||||
|
||||
</plugins>
|
||||
|
||||
<pluginManagement>
|
||||
@@ -545,104 +557,229 @@
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>static</id>
|
||||
<id>docs</id>
|
||||
<goals>
|
||||
<goal>single</goal>
|
||||
</goals>
|
||||
<phase>package</phase>
|
||||
<configuration>
|
||||
<descriptors>
|
||||
<descriptor>${shared.resources}/assemblies/static-resources.xml</descriptor>
|
||||
<descriptor>${shared.resources}/assemblies/docs.xml</descriptor>
|
||||
</descriptors>
|
||||
<finalName>static-resources</finalName>
|
||||
<appendAssemblyId>false</appendAssemblyId>
|
||||
<finalName>${dist.id}</finalName>
|
||||
<appendAssemblyId>true</appendAssemblyId>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
<!-- Deploy to Artifactory -->
|
||||
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>wagon-maven-plugin</artifactId>
|
||||
<configuration>
|
||||
<fromDir>${project.build.directory}</fromDir>
|
||||
<serverId>static-dot-s2</serverId>
|
||||
<url>scp://docs.af.pivotal.io</url>
|
||||
</configuration>
|
||||
<groupId>org.jfrog.buildinfo</groupId>
|
||||
<artifactId>artifactory-maven-plugin</artifactId>
|
||||
<executions>
|
||||
|
||||
<!-- Upload namespace XSDs -->
|
||||
|
||||
<execution>
|
||||
<id>upload-schema</id>
|
||||
<phase>deploy</phase>
|
||||
<id>deploy-docs</id>
|
||||
<goals>
|
||||
<goal>upload</goal>
|
||||
<goal>publish</goal>
|
||||
</goals>
|
||||
<phase>deploy</phase>
|
||||
<configuration>
|
||||
<fromDir>${project.root}/target/schemas</fromDir>
|
||||
<includes>*.xsd,.autoschemaln</includes>
|
||||
<toDir>/var/www/domains/spring.io/www/htdocs/autorepo/schema/${dist.id}/${project.version}</toDir>
|
||||
<optimize>true</optimize>
|
||||
<artifactory>
|
||||
<includeEnvVars>false</includeEnvVars>
|
||||
</artifactory>
|
||||
<deployProperties>
|
||||
<zip.name>${dist.id}</zip.name>
|
||||
<zip.displayname>${dist.id}</zip.displayname>
|
||||
<zip.deployed>false</zip.deployed>
|
||||
<zip.type>docs</zip.type>
|
||||
</deployProperties>
|
||||
<buildInfo>
|
||||
<!-- Retain only a single build -->
|
||||
<buildName>Spring Data Docs ${dist.id} ${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>
|
||||
|
||||
<!-- Distribute static resources -->
|
||||
|
||||
<execution>
|
||||
<id>upload-static-resources</id>
|
||||
<phase>deploy</phase>
|
||||
<goals>
|
||||
<goal>upload</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<fromDir>${project.build.directory}/static-resources</fromDir>
|
||||
<includes>**</includes>
|
||||
<toDir>/var/www/domains/spring.io/www/htdocs/autorepo/docs/${dist.id}/${project.version}</toDir>
|
||||
<optimize>true</optimize>
|
||||
</configuration>
|
||||
</execution>
|
||||
|
||||
<!-- Makes sure resources can be overriden by others -->
|
||||
<execution>
|
||||
<id>make-resources-group-writable</id>
|
||||
<phase>deploy</phase>
|
||||
<goals>
|
||||
<goal>sshexec</goal>
|
||||
</goals>
|
||||
<configuration> <!-- Prevent reformatting, wrap with CDATA -->
|
||||
<commands>
|
||||
<command>
|
||||
<![CDATA[
|
||||
if [ -d /var/www/domains/spring.io/www/htdocs/autorepo/schema/${dist.id}/${project.version}/ ]
|
||||
then
|
||||
find /var/www/domains/spring.io/www/htdocs/autorepo/schema/${dist.id}/${project.version}/ ! -perm -g=w -exec chmod g+w {} \;
|
||||
fi
|
||||
]]>
|
||||
</command>
|
||||
<command>
|
||||
<![CDATA[
|
||||
if [ -d /var/www/domains/spring.io/www/htdocs/autorepo/docs/${dist.id}/${project.version}/ ]
|
||||
then
|
||||
find /var/www/domains/spring.io/www/htdocs/autorepo/docs/${dist.id}/${project.version}/ ! -perm -g=w -exec chmod g+w {} \;
|
||||
fi
|
||||
]]>
|
||||
</command>
|
||||
</commands>
|
||||
</configuration>
|
||||
</execution>
|
||||
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</pluginManagement>
|
||||
</build>
|
||||
</profile>
|
||||
|
||||
<profile>
|
||||
|
||||
<!--
|
||||
Profile to be activated when building the schema artifacts.
|
||||
-->
|
||||
|
||||
<id>distribute-schema</id>
|
||||
|
||||
<properties>
|
||||
<shared.resources>${project.build.directory}/shared-resources</shared.resources>
|
||||
<maven.main.skip>true</maven.main.skip>
|
||||
<maven.test.skip>true</maven.test.skip>
|
||||
<maven.kotlin.skip>true</maven.kotlin.skip>
|
||||
<maven.install.skip>true</maven.install.skip>
|
||||
<maven.deploy.skip>true</maven.deploy.skip>
|
||||
<skipTests>true</skipTests>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.data.build</groupId>
|
||||
<artifactId>spring-data-build-resources</artifactId>
|
||||
<version>2.1.10.BUILD-SNAPSHOT</version>
|
||||
<type>zip</type>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
||||
<plugins>
|
||||
|
||||
<!--
|
||||
Unpacks the content of spring-data-build-resources into the shared resources folder.
|
||||
-->
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>unpack-shared-resources</id>
|
||||
<goals>
|
||||
<goal>unpack-dependencies</goal>
|
||||
</goals>
|
||||
<phase>generate-resources</phase>
|
||||
<configuration>
|
||||
<includeGroupIds>${project.groupId}</includeGroupIds>
|
||||
<includeArtifactIds>spring-data-build-resources</includeArtifactIds>
|
||||
<includeTypes>zip</includeTypes>
|
||||
<excludeTransitive>true</excludeTransitive>
|
||||
<outputDirectory>${shared.resources}</outputDirectory>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
|
||||
<!--
|
||||
Copies all namespaces schemas to target/schemas flatten the directory structure.
|
||||
Depended on by the site.xml assembly descriptor.
|
||||
-->
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-antrun-plugin</artifactId>
|
||||
<executions>
|
||||
|
||||
<execution>
|
||||
<id>collect-schema-files</id>
|
||||
<phase>prepare-package</phase>
|
||||
<configuration>
|
||||
<target>
|
||||
<copy todir="${project.build.directory}/schemas">
|
||||
<fileset dir="${basedir}" erroronmissingdir="false">
|
||||
<include name="**/src/main/resources/**/config/spring-*.xsd"/>
|
||||
</fileset>
|
||||
<flattenmapper/>
|
||||
</copy>
|
||||
</target>
|
||||
</configuration>
|
||||
<goals>
|
||||
<goal>run</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
|
||||
</executions>
|
||||
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.jfrog.buildinfo</groupId>
|
||||
<artifactId>artifactory-maven-plugin</artifactId>
|
||||
</plugin>
|
||||
|
||||
</plugins>
|
||||
|
||||
<pluginManagement>
|
||||
<plugins>
|
||||
|
||||
<!--
|
||||
Creates schema zip.
|
||||
-->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-deploy-plugin</artifactId>
|
||||
<configuration>
|
||||
<skip>true</skip>
|
||||
</configuration>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>schema</id>
|
||||
<goals>
|
||||
<goal>single</goal>
|
||||
</goals>
|
||||
<phase>package</phase>
|
||||
<configuration>
|
||||
<descriptors>
|
||||
<descriptor>${shared.resources}/assemblies/schema.xml</descriptor>
|
||||
</descriptors>
|
||||
<finalName>${dist.id}</finalName>
|
||||
<appendAssemblyId>true</appendAssemblyId>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
<!-- Deploy to Artifactory -->
|
||||
|
||||
<plugin>
|
||||
<groupId>org.jfrog.buildinfo</groupId>
|
||||
<artifactId>artifactory-maven-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>deploy-schema</id>
|
||||
<goals>
|
||||
<goal>publish</goal>
|
||||
</goals>
|
||||
<phase>deploy</phase>
|
||||
<configuration>
|
||||
<artifactory>
|
||||
<includeEnvVars>false</includeEnvVars>
|
||||
</artifactory>
|
||||
<deployProperties>
|
||||
<zip.name>${dist.id}</zip.name>
|
||||
<zip.displayname>${dist.id}</zip.displayname>
|
||||
<zip.deployed>true</zip.deployed>
|
||||
<zip.type>schema</zip.type>
|
||||
</deployProperties>
|
||||
<buildInfo>
|
||||
<!-- Retain only a single build -->
|
||||
<buildName>Spring Data Schema ${dist.id} ${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>*-schema.zip</includePatterns>
|
||||
</publisher>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</pluginManagement>
|
||||
</build>
|
||||
@@ -914,6 +1051,12 @@
|
||||
<version>1.18.4.0</version>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.jfrog.buildinfo</groupId>
|
||||
<artifactId>artifactory-maven-plugin</artifactId>
|
||||
<version>2.6.1</version>
|
||||
</plugin>
|
||||
|
||||
</plugins>
|
||||
|
||||
</pluginManagement>
|
||||
@@ -926,11 +1069,12 @@
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<artifactId>kotlin-maven-plugin</artifactId>
|
||||
<groupId>org.jetbrains.kotlin</groupId>
|
||||
<artifactId>kotlin-maven-plugin</artifactId>
|
||||
<version>${kotlin}</version>
|
||||
<configuration>
|
||||
<jvmTarget>${source.level}</jvmTarget>
|
||||
<skip>${maven.kotlin.skip}</skip>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
|
||||
<id>resources</id>
|
||||
<id>docs</id>
|
||||
<formats>
|
||||
<format>dir</format>
|
||||
<format>zip</format>
|
||||
</formats>
|
||||
<includeBaseDirectory>false</includeBaseDirectory>
|
||||
<fileSets>
|
||||
@@ -34,4 +35,4 @@
|
||||
<outputDirectory>api</outputDirectory>
|
||||
</fileSet>
|
||||
</fileSets>
|
||||
</assembly>
|
||||
</assembly>
|
||||
20
resources/src/main/resources/assemblies/schema.xml
Normal file
20
resources/src/main/resources/assemblies/schema.xml
Normal file
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 https://maven.apache.org/xsd/assembly-1.1.2.xsd">
|
||||
<id>schema</id>
|
||||
<formats>
|
||||
<format>dir</format>
|
||||
<format>zip</format>
|
||||
</formats>
|
||||
<includeBaseDirectory>false</includeBaseDirectory>
|
||||
<fileSets>
|
||||
<fileSet>
|
||||
<directory>${project.root}/target/schemas</directory>
|
||||
<includes>
|
||||
<include>*.xsd</include>
|
||||
<include>.autoschemaln</include>
|
||||
</includes>
|
||||
<outputDirectory />
|
||||
<lineEnding>dos</lineEnding>
|
||||
</fileSet>
|
||||
</fileSets>
|
||||
</assembly>
|
||||
Reference in New Issue
Block a user