105 lines
4.2 KiB
XML

<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>
<groupId>com.inteligr8</groupId>
<artifactId>tomcat-rad</artifactId>
<version>10-2.2</version>
<name>Apache Tomcat for Rapid Application Development</name>
<packaging>pom</packaging>
<properties>
<!-- The release version of the Java Hotswap Docker image -->
<!-- See: https://bitbucket.org/inteligr8/jdk-hotswap-docker -->
<jdk-hotswap.version>2.0.1-jbr-17.0.12</jdk-hotswap.version>
<namespace.prefix>tomcat-rad</namespace.prefix>
<!-- The version of Apache Tomcat to serve as the basis of this Docker image -->
<!-- See: https://tomcat.apache.org/download-10.cgi -->
<tomcat.version>10.1.34</tomcat.version>
<tomcat.majorVersion>10</tomcat.majorVersion>
<tomcat.mirror.baseUrl>https://archive.apache.org/dist/tomcat</tomcat.mirror.baseUrl>
<!-- The Docker image meta-data for pushing the build -->
<image.name>inteligr8/${project.artifactId}</image.name>
<image.tag>${project.version}</image.tag>
<image.registry>docker.inteligr8.com</image.registry>
</properties>
<build>
<resources>
<resource>
<directory>src/main/docker</directory>
<filtering>true</filtering>
<targetPath>${project.build.directory}/resources</targetPath>
</resource>
</resources>
<plugins>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>3.3.1</version>
<executions>
<execution>
<id>copy-resources</id>
<phase>process-resources</phase>
<goals><goal>resources</goal></goals>
<configuration>
<encoding>utf-8</encoding>
<propertiesEncoding>utf-8</propertiesEncoding>
</configuration>
</execution>
</executions>
</plugin>
<!-- This plugin build and pushes the Docker image -->
<plugin>
<groupId>org.eclipse.jkube</groupId>
<artifactId>kubernetes-maven-plugin</artifactId>
<version>1.16.2</version>
<configuration>
<images>
<image>
<name>${image.name}:${image.tag}</name>
<registry>${image.registry}</registry>
</image>
</images>
<contextDir>${project.build.directory}/resources</contextDir>
<buildStrategy>docker</buildStrategy>
<verbose>true</verbose>
</configuration>
<executions>
<!-- This execution builds the Docker image -->
<execution>
<id>docker-build</id>
<phase>package</phase>
<goals><goal>build</goal></goals>
</execution>
<!-- This execution pushes the built Docker image to the configured Docker Registry -->
<execution>
<id>docker-push</id>
<phase>deploy</phase>
<goals><goal>push</goal></goals>
</execution>
</executions>
</plugin>
<!-- This plugin prevents the project from deploying to the Maven Repository, as it is pointless -->
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>3.1.3</version>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>no-docker</id>
<properties>
<fabric8.build.jib>true</fabric8.build.jib>
</properties>
</profile>
</profiles>
</project>