| <?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 |
| |
| https://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/xsd/maven-4.0.0.xsd"> |
| |
| <modelVersion>4.0.0</modelVersion> |
| |
| <parent> |
| <groupId>org.apache.plc4x.extras</groupId> |
| <artifactId>plc4x-extras-parent</artifactId> |
| <version>0.14.0-SNAPSHOT</version> |
| </parent> |
| |
| <artifactId>plc4j-extras</artifactId> |
| <packaging>pom</packaging> |
| |
| <name>PLC4J-Extras</name> |
| <description>Examples, integration modules and tools for Java.</description> |
| |
| <properties> |
| <project.build.outputTimestamp>2025-08-06T15:45:09Z</project.build.outputTimestamp> |
| </properties> |
| |
| <modules> |
| <module>examples</module> |
| <module>integrations</module> |
| <module>tools</module> |
| </modules> |
| |
| <build> |
| <plugins> |
| <!-- |
| This plugin doesn't really do much, it makes sure the jacoco agent |
| is downloaded and that the path to this is saved in an environment |
| variable, so we can access this later on in the build. |
| --> |
| <plugin> |
| <groupId>org.jacoco</groupId> |
| <artifactId>jacoco-maven-plugin</artifactId> |
| <version>0.8.14</version> |
| <executions> |
| <!-- |
| Prepares the property pointing to the JaCoCo runtime agent which |
| is passed as VM argument when Maven the Surefire plugin is executed. |
| --> |
| <execution> |
| <id>pre-unit-test</id> |
| <phase>generate-test-sources</phase> |
| <goals> |
| <goal>prepare-agent</goal> |
| </goals> |
| <configuration> |
| <!-- |
| Sets the name of the property containing the settings |
| for JaCoCo runtime agent. |
| --> |
| <propertyName>surefireArgLine</propertyName> |
| </configuration> |
| </execution> |
| <!-- |
| Prepares the property pointing to the JaCoCo runtime agent which |
| is passed as VM argument when Maven the Failsafe plugin is executed. |
| --> |
| <execution> |
| <id>pre-integration-test</id> |
| <phase>pre-integration-test</phase> |
| <goals> |
| <goal>prepare-agent-integration</goal> |
| </goals> |
| <configuration> |
| <!-- |
| Sets the name of the property containing the settings |
| for JaCoCo runtime agent. |
| --> |
| <propertyName>failsafeArgLine</propertyName> |
| </configuration> |
| </execution> |
| <execution> |
| <id>report</id> |
| <phase>verify</phase> |
| <goals> |
| <goal>report</goal> |
| </goals> |
| </execution> |
| <!-- |
| Check if the unit-test-coverage is at least a certain minimum. |
| --> |
| <execution> |
| <id>check-coverage</id> |
| <phase>verify</phase> |
| <goals> |
| <goal>check</goal> |
| </goals> |
| <configuration> |
| <!-- TODO: Turn this on as soon as possible. --> |
| <haltOnFailure>false</haltOnFailure> |
| <rules> |
| <rule implementation="org.jacoco.maven.RuleConfiguration"> |
| <element>BUNDLE</element> |
| <limits> |
| <!-- Fail the build if the instruction level coverage is below 80%. --> |
| <limit implementation="org.jacoco.report.check.Limit"> |
| <counter>INSTRUCTION</counter> |
| <value>COVEREDRATIO</value> |
| <minimum>0.50</minimum> |
| </limit> |
| <!-- Fail the build if there are classes without any coverage. --> |
| <limit implementation="org.jacoco.report.check.Limit"> |
| <counter>CLASS</counter> |
| <value>MISSEDCOUNT</value> |
| <maximum>0</maximum> |
| </limit> |
| </limits> |
| </rule> |
| </rules> |
| </configuration> |
| </execution> |
| </executions> |
| </plugin> |
| |
| <!-- |
| As our libraries should be consumable on Java 21, downgrade the compiler settings. |
| --> |
| <plugin> |
| <groupId>org.apache.maven.plugins</groupId> |
| <artifactId>maven-compiler-plugin</artifactId> |
| <executions> |
| <execution> |
| <id>default-compile</id> |
| <phase>compile</phase> |
| <goals> |
| <goal>compile</goal> |
| </goals> |
| <configuration> |
| <!-- Would have loved to suppress the warnings of generated code only --> |
| <showWarnings>false</showWarnings> |
| <release>21</release> |
| </configuration> |
| </execution> |
| <execution> |
| <id>default-testCompile</id> |
| <phase>test-compile</phase> |
| <goals> |
| <goal>testCompile</goal> |
| </goals> |
| <configuration> |
| <!-- Would have loved to suppress the warnings of generated code only --> |
| <showWarnings>false</showWarnings> |
| <release>21</release> |
| </configuration> |
| </execution> |
| </executions> |
| </plugin> |
| |
| <!-- |
| Make the surefire execute all unit-tests |
| --> |
| <plugin> |
| <groupId>org.apache.maven.plugins</groupId> |
| <artifactId>maven-surefire-plugin</artifactId> |
| <configuration> |
| <!-- |
| We have to slightly increase the heap-size or some tests will fail. |
| Notice the @ instead of the $ as prefix? That's late evaluation. |
| --> |
| <argLine>-Xmx512m @{surefireArgLine}</argLine> |
| <includes> |
| <include>**/*Test.java</include> |
| <include>**/*Tests.java</include> |
| <include>**/*Spec.java</include> |
| </includes> |
| </configuration> |
| </plugin> |
| |
| <plugin> |
| <groupId>org.apache.maven.plugins</groupId> |
| <artifactId>maven-failsafe-plugin</artifactId> |
| <configuration> |
| <!-- |
| The failsafe plugin would use the java jigsaw module path, |
| this would make loading the test XML files impossible. |
| So we simply disable this. |
| --> |
| <useModulePath>false</useModulePath> |
| <!-- |
| We have to slightly increase the heap-size or some tests will fail. |
| Notice the @ instead of the $ as prefix? That's late evaluation. |
| --> |
| <argLine>-Xmx512m @{failsafeArgLine}</argLine> |
| <includes> |
| <include>**/*IT.java</include> |
| </includes> |
| </configuration> |
| </plugin> |
| </plugins> |
| </build> |
| |
| </project> |