blob: 5da8103996ad05a7c23ed77973b86cadd04019b4 [file] [log] [blame]
<?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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<!--
This is intentionally set to the apache parent as this way
we can release this module separately from the rest of the project
-->
<parent>
<groupId>org.apache</groupId>
<artifactId>apache</artifactId>
<version>23</version>
<relativePath />
</parent>
<groupId>org.apache.plc4x.plugins</groupId>
<artifactId>plc4x-site-skin</artifactId>
<version>1.0-SNAPSHOT</version>
<name>PLC4X Build Tools: PLC4X Site Skin</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<sitePluginVersion>3.7.1</sitePluginVersion>
<mpirVersion>3.0.0</mpirVersion>
<bootstrap.version>4.4.1</bootstrap.version>
<proper.version>1.16.0</proper.version>
<jquery.version>3.4.1</jquery.version>
<fontawesome.version>5.12.0</fontawesome.version>
</properties>
<scm>
<connection>scm:git:https://gitbox.apache.org/repos/asf/plc4x-build-tools.git</connection>
<developerConnection>scm:git:https://gitbox.apache.org/repos/asf/plc4x-build-tools.git</developerConnection>
<url>https://github.com/apache/plc4x-build-tools</url>
<tag>rel/plc4x-site-skin/1.0</tag>
</scm>
<build>
<plugins>
<!--
Download Bootstrap and Fontawesome.
-->
<plugin>
<groupId>com.googlecode.maven-download-plugin</groupId>
<artifactId>download-maven-plugin</artifactId>
<version>1.4.1</version>
<executions>
<execution>
<id>get-bootstrap</id>
<phase>generate-resources</phase>
<goals>
<goal>wget</goal>
</goals>
<configuration>
<url>https://github.com/twbs/bootstrap/releases/download/v${bootstrap.version}/bootstrap-${bootstrap.version}-dist.zip</url>
<unpack>true</unpack>
<outputDirectory>${project.build.directory}/dependency/bootstrap</outputDirectory>
</configuration>
</execution>
<execution>
<id>get-propper</id>
<phase>generate-resources</phase>
<goals>
<goal>wget</goal>
</goals>
<configuration>
<url>https://github.com/popperjs/popper.js/archive/v${proper.version}.zip</url>
<unpack>true</unpack>
<outputDirectory>${project.build.directory}/dependency/popper</outputDirectory>
</configuration>
</execution>
<execution>
<id>get-fontawesome</id>
<phase>generate-resources</phase>
<goals>
<goal>wget</goal>
</goals>
<configuration>
<url>https://use.fontawesome.com/releases/v${fontawesome.version}/fontawesome-free-${fontawesome.version}-web.zip</url>
<unpack>true</unpack>
<outputDirectory>${project.build.directory}/dependency/fontawesome</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>get-jquery</id>
<phase>generate-resources</phase>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.webjars</groupId>
<artifactId>jquery</artifactId>
<version>${jquery.version}</version>
<type>jar</type>
</artifactItem>
</artifactItems>
<outputDirectory>${project.build.directory}/dependency/jquery</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<!--
Copy stuff from the downloaded bootstrap and fontawesome packages and hereby
assemble a local distribution customized to our needs.
-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<executions>
<execution>
<id>copy-site-resources</id>
<phase>process-resources</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${project.build.outputDirectory}</outputDirectory>
<resources>
<resource>
<directory>${project.build.directory}/dependency/bootstrap/bootstrap-${bootstrap.version}-dist</directory>
<includes>
<include>css/*</include>
</includes>
</resource>
<resource>
<directory>${project.build.directory}/dependency/bootstrap/bootstrap-${bootstrap.version}-dist</directory>
<includes>
<include>js/*</include>
</includes>
</resource>
<resource>
<directory>
${project.build.directory}/dependency/fontawesome/fontawesome-free-${fontawesome.version}-web
</directory>
<includes>
<include>css/all.min.css</include>
</includes>
</resource>
<resource>
<directory>
${project.build.directory}/dependency/fontawesome/fontawesome-free-${fontawesome.version}-web/webfonts
</directory>
<targetPath>fonts</targetPath>
</resource>
<resource>
<directory>
${project.build.directory}/dependency/jquery/META-INF/resources/webjars/jquery/${jquery.version}
</directory>
<targetPath>js</targetPath>
</resource>
<resource>
<directory>
${project.build.directory}/dependency/popper/popper.js-${proper.version}/dist/umd
</directory>
<targetPath>js</targetPath>
</resource>
</resources>
</configuration>
</execution>
</executions>
<!--configuration>
<delimiters>
<delimiter>@</delimiter>
</delimiters>
<useDefaultDelimiters>false</useDefaultDelimiters>
</configuration-->
</plugin>
<!--
The bootstrap uses "fonts" as directory for locating fonts and fontawesome uses "webfonts".
This plugin updates the css to also use "fonts".
-->
<plugin>
<groupId>com.google.code.maven-replacer-plugin</groupId>
<artifactId>replacer</artifactId>
<version>1.5.3</version>
<executions>
<execution>
<id>streamline-font-urls</id>
<!-- Only execute this for the parent module -->
<inherited>false</inherited>
<phase>process-resources</phase>
<goals>
<goal>replace</goal>
</goals>
<configuration>
<file>${project.build.outputDirectory}/css/all.min.css</file>
<replacements>
<replacement>
<token>../webfonts/</token>
<value>../fonts/</value>
</replacement>
</replacements>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
<pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) -->
<plugins>
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>3.1.0</version>
</plugin>
<plugin>
<artifactId>maven-site-plugin</artifactId>
<version>3.7.1</version>
</plugin>
<plugin>
<artifactId>maven-invoker-plugin</artifactId>
<version>3.1.0</version>
</plugin>
<!-- see http://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_jar_packaging -->
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>3.0.2</version>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.1</version>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>3.0.2</version>
</plugin>
<plugin>
<artifactId>maven-install-plugin</artifactId>
<version>2.5.2</version>
</plugin>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
</plugin>
</plugins>
</pluginManagement>
</build>
<profiles>
<profile>
<id>run-its</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-invoker-plugin</artifactId>
<configuration>
<debug>true</debug>
<projectsDirectory>src/it</projectsDirectory>
<cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
<preBuildHookScript>setup</preBuildHookScript>
<postBuildHookScript>verify</postBuildHookScript>
<localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath>
<settingsFile>src/it/settings.xml</settingsFile>
<pomIncludes>
<pomInclude>*/pom.xml</pomInclude>
</pomIncludes>
<goals>
<goal>site</goal>
</goals>
</configuration>
<executions>
<execution>
<id>integration-test</id>
<goals>
<goal>install</goal>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>minify</id>
<build>
<resources>
<!-- exclude css and js since will include the minified version -->
<resource>
<directory>${basedir}/src/main/resources</directory>
<excludes>
<exclude>css/**</exclude>
<exclude>js/**</exclude>
</excludes>
<filtering>true</filtering> <!-- add skin-info -->
</resource>
<!-- include the print.css -->
<resource>
<directory>${basedir}/src/main/resources</directory>
<includes>
<include>css/print.css</include>
</includes>
</resource>
<!-- include minified only -->
<resource>
<directory>${project.build.directory}/${project.build.finalName}</directory>
<includes>
<include>css/plc4x-site-skin-${project.version}.min.css</include>
<include>js/plc4x-site-skin-${project.version}.min.js</include>
</includes>
</resource>
</resources>
<plugins>
<plugin>
<groupId>com.samaxes.maven</groupId>
<artifactId>maven-minify-plugin</artifactId>
<version>1.3.5</version>
<executions>
<execution>
<id>default-minify</id>
<phase>generate-resources</phase>
<configuration>
<webappSourceDir>${basedir}/src/main/resources</webappSourceDir>
<cssSourceDir>css</cssSourceDir>
<cssSourceFiles>
<cssSourceFile>maven-base.css</cssSourceFile>
<cssSourceFile>maven-theme.css</cssSourceFile>
</cssSourceFiles>
<cssFinalFile>plc4x-site-skin-${project.version}.css</cssFinalFile>
<!--jsSourceDir>js</jsSourceDir>
<jsSourceFiles>
<jsSourceFile>fluido.js</jsSourceFile>
</jsSourceFiles>
<jsFinalFile>plc4x-site-skin-${project.version}.js</jsFinalFile-->
</configuration>
<goals>
<goal>minify</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<!--
This profile extends the default "apache-release" configuration with automatic checksum-
generation for the release source artifact. It is automatically activated during the
release build and only needed there.
-->
<profile>
<id>apache-release</id>
<build>
<plugins>
<!--
Create MD5 and SHA512 checksum files for the release artifacts.
-->
<plugin>
<groupId>net.nicoulaj.maven.plugins</groupId>
<artifactId>checksum-maven-plugin</artifactId>
<version>1.8</version>
<executions>
<execution>
<goals>
<goal>files</goal>
</goals>
</execution>
</executions>
<configuration>
<algorithms>
<algorithm>SHA-512</algorithm>
</algorithms>
<fileSets>
<fileSet>
<directory>${project.build.directory}</directory>
<includes>
<include>apache-plc4x-site-skin-${project.version}-source-release.zip</include>
</includes>
</fileSet>
</fileSets>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>