blob: 4f21f7ee31d2a0f8d77650c2f9d966c56f559734 [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<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 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<packaging>pom</packaging>
<groupId>org.apache.sling</groupId>
<artifactId>sling-site</artifactId>
<name>Apache Sling Website</name>
<version>0.1-SNAPSHOT</version>
<properties>
<repos.list.url>https://raw.githubusercontent.com/apache/sling-aggregator/master/default.xml</repos.list.url>
<downloads.dir>${project.build.directory}/downloads</downloads.dir>
<repos.list.fullpath>${downloads.dir}/github-repositories.xml</repos.list.fullpath>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<!-- Must match the JBake output folder -->
<pagefind.site.folder>${project.build.directory}/${project.artifactId}-${project.version}</pagefind.site.folder>
<!-- pagefind needs to run after compile and before package... -->
<pagefind.maven.phase>test</pagefind.maven.phase>
<!-- getting GLIBC_2.28 not found on Jenkins with Node > 16 -->
<pagefind.node.version>v16.6.0</pagefind.node.version>
</properties>
<build>
<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>3.3.2</version>
</plugin>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>3.1.0</version>
</plugin>
<plugin>
<artifactId>maven-enforcer-plugin</artifactId>
<version>3.4.1</version>
</plugin>
<plugin>
<artifactId>maven-scm-publish-plugin</artifactId>
<version>3.2.1</version>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.jbake</groupId>
<artifactId>jbake-maven-plugin</artifactId>
<version>2.7.0-rc.7</version>
<executions>
<execution>
<id>default-generate</id>
<phase>compile</phase>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>
<dependencies>
<!-- add exclusions to prevent using old jffi version: https://github.com/jbake-org/jbake/issues/769 -->
<dependency>
<groupId>org.asciidoctor</groupId>
<artifactId>asciidoctorj</artifactId>
<version>2.5.2</version>
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>3.5.0</version>
<executions>
<execution>
<id>timestamp-property</id>
<goals>
<goal>timestamp-property</goal>
</goals>
<phase>validate</phase>
<configuration>
<name>current.year</name>
<pattern>yyyy</pattern>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-scm-publish-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<content>target/${project.artifactId}-${project.version}</content>
<checkinComment>${msg}</checkinComment>
<pubScmUrl>scm:git:https://gitbox.apache.org/repos/asf/sling-site.git</pubScmUrl>
<scmBranch>asf-site</scmBranch>
<localCheckout>true</localCheckout>
<tryUpdate>true</tryUpdate>
<!-- the setting for website publication must not be removed: https://cwiki.apache.org/confluence/display/INFRA/git+-+.asf.yaml+features#Git.asf.yamlfeatures-WebSiteDeploymentServiceforGitRepositories -->
<ignorePathsToDelete>
<ignore>.asf.yaml</ignore>
</ignorePathsToDelete>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>download-repos-list</id>
<phase>process-resources</phase>
<configuration>
<target>
<mkdir dir="${downloads.dir}"/>
<get src="${repos.list.url}" dest="${repos.list.fullpath}" usetimestamp="true"/>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>publish-site</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<executions>
<execution>
<id>enforce-property</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<requireProperty>
<property>msg</property>
<message>Please specify a commit message for publishing the website (-Dmsg="...")</message>
</requireProperty>
</rules>
<fail>true</fail>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-scm-publish-plugin</artifactId>
<executions>
<execution>
<id>publish-site</id>
<phase>package</phase>
<goals>
<goal>publish-scm</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>run-site</id>
<build>
<plugins>
<plugin>
<groupId>org.jbake</groupId>
<artifactId>jbake-maven-plugin</artifactId>
<executions>
<execution>
<id>run-site</id>
<phase>package</phase>
<goals>
<goal>inline</goal>
</goals>
<configuration>
<port>8820</port>
<listenAddress>0.0.0.0</listenAddress>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>pagefind</id>
<build>
<plugins>
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<version>1.15.0</version>
<configuration>
<npmInheritsProxyConfigFromMaven>false</npmInheritsProxyConfigFromMaven>
<installDirectory>${project.build.directory}</installDirectory>
<workingDirectory>${project.build.directory}</workingDirectory>
</configuration>
<executions>
<execution>
<id>Install node and npm</id>
<goals>
<goal>install-node-and-npm</goal>
</goals>
<phase>${pagefind.maven.phase}</phase>
<configuration>
<nodeVersion>${pagefind.node.version}</nodeVersion>
</configuration>
</execution>
<execution>
<id>Build pagefind index</id>
<goals>
<goal>npx</goal>
</goals>
<phase>${pagefind.maven.phase}</phase>
<configuration>
<arguments>pagefind --site ${pagefind.site.folder}</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>