pi4j-test
Used in:
components
- OverviewOverview
- VersionsVersions
- DependentsDependents
- DependenciesDependencies
<dependency>
<groupId>com.pi4j</groupId>
<artifactId>pi4j-test</artifactId>
<version>4.0.2</version>
</dependency><?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>
<!-- MAVEN PARENT POM -->
<parent>
<artifactId>pi4j-parent</artifactId>
<groupId>com.pi4j</groupId>
<version>4.0.2</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>pi4j-test</artifactId>
<name>Pi4J :: TESTING :: Unit/Integration Tests</name>
<description>Pi4J Unit and Integration Tests</description>
<dependencies>
<dependency>
<groupId>com.pi4j</groupId>
<artifactId>pi4j-core</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
</dependency>
<!-- include Pi4J Plugins (Platforms and I/O Providers) -->
<dependency>
<groupId>com.pi4j</groupId>
<artifactId>pi4j-plugin-mock</artifactId>
<version>${project.version}</version>
</dependency>
<!-- include Pi4J Plugins (Platforms and I/O Providers) -->
<dependency>
<groupId>com.pi4j</groupId>
<artifactId>pi4j-library-pigpio</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.pi4j</groupId>
<artifactId>pi4j-library-linuxfs</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.pi4j</groupId>
<artifactId>pi4j-library-gpiod</artifactId>
<version>${project.version}</version>
</dependency>
<!--
include Pi4J native libraries
-->
<!-- pigpio -->
<dependency>
<groupId>com.pi4j</groupId>
<artifactId>pi4j-library-pigpio</artifactId>
<version>${project.version}</version>
<classifier>armhf</classifier>
<type>so</type>
</dependency>
<dependency>
<groupId>com.pi4j</groupId>
<artifactId>pi4j-library-pigpio</artifactId>
<version>${project.version}</version>
<classifier>aarch64</classifier>
<type>so</type>
</dependency>
<!-- linuxfs -->
<dependency>
<groupId>com.pi4j</groupId>
<artifactId>pi4j-library-linuxfs</artifactId>
<version>${project.version}</version>
<classifier>armhf</classifier>
<type>so</type>
</dependency>
<dependency>
<groupId>com.pi4j</groupId>
<artifactId>pi4j-library-linuxfs</artifactId>
<version>${project.version}</version>
<classifier>aarch64</classifier>
<type>so</type>
</dependency>
<!-- gpiod -->
<dependency>
<groupId>com.pi4j</groupId>
<artifactId>pi4j-library-gpiod</artifactId>
<version>${project.version}</version>
<classifier>armhf</classifier>
<type>so</type>
</dependency>
<dependency>
<groupId>com.pi4j</groupId>
<artifactId>pi4j-library-gpiod</artifactId>
<version>${project.version}</version>
<classifier>aarch64</classifier>
<type>so</type>
</dependency>
<dependency>
<groupId>com.pi4j</groupId>
<artifactId>pi4j-plugin-gpiod</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.pi4j</groupId>
<artifactId>pi4j-plugin-linuxfs</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.pi4j</groupId>
<artifactId>pi4j-plugin-ffm</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
<build>
<resources>
<resource>
<directory>${project.build.directory}</directory>
<filtering>false</filtering>
<includes>
<include>LICENSE.txt</include>
<include>NOTICE.txt</include>
<include>README.md</include>
</includes>
</resource>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>**/**</include>
</includes>
</resource>
</resources>
<plugins>
<!-- JAVA COMPILER -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
</plugin>
<!-- MAVEN RUN JUNIT5 TESTS -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<argLine>
--illegal-access=permit
--add-opens com.pi4j.test/com.pi4j.test=com.pi4j,ALL-UNNAMED
--add-opens com.pi4j.test/com.pi4j.test.context=com.pi4j,ALL-UNNAMED
--add-opens com.pi4j.test/com.pi4j.test.io.i2c=com.pi4j,ALL-UNNAMED
--add-opens com.pi4j.test/com.pi4j.test.io.serial=com.pi4j,ALL-UNNAMED
--add-opens com.pi4j.test/com.pi4j.test.platform=com.pi4j,ALL-UNNAMED
--add-opens com.pi4j.test/com.pi4j.test.provider=com.pi4j,ALL-UNNAMED
--add-opens com.pi4j.test/com.pi4j.test.registry=com.pi4j,ALL-UNNAMED
</argLine>
</configuration>
</plugin>
<!-- INCLUDE SOURCE JAR -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
</plugin>
<!-- INCLUDE JAVADOC JAR -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
</plugin>
<!-- DEFAULT JAR EXECUTABLE CLASS -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>${exec-maven-plugin.version}</version>
<executions>
<execution>
<goals>
<goal>java</goal>
</goals>
</execution>
</executions>
<configuration>
<mainClass>com.pi4j.test.Main</mainClass>
<arguments>
</arguments>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>${maven-antrun-plugin.version}</version>
<executions>
<execution>
<id>copy-assetsPYSH</id>
<phase>package</phase>
<configuration>
<target>
<mkdir dir="${project.build.directory}/distribution"/>
<copy todir="${project.build.directory}/distribution" overwrite="true" flatten="true">
<fileset dir="assets" includes="*.py"> </fileset>
</copy>
<copy todir="${project.build.directory}/distribution" overwrite="true" flatten="true">
<fileset dir="assets" includes="*.sh"> </fileset>
</copy>
<chmod dir="${project.build.directory}/distribution" perm="ugo+rx" includes="**/*.py"/>
<chmod dir="${project.build.directory}/distribution" perm="ugo+rx" includes="**/*.sh"/>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>${maven-dependency-plugin.version}</version>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>process-sources</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/distribution</outputDirectory>
<includeScope>runtime</includeScope>
<excludeTransitive>false</excludeTransitive>
<overWriteReleases>false</overWriteReleases>
<overWriteSnapshots>true</overWriteSnapshots>
<overWriteIfNewer>true</overWriteIfNewer>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<profiles>
<!-- Transfer and run JAR with dependencies on remote Raspberry Pi -->
<profile>
<id>remote-run</id>
<build>
<plugins>
<!-- Copy runtime dependencies into distribution folder -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>process-sources</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/distribution</outputDirectory>
<includeScope>runtime</includeScope>
<excludeTransitive>false</excludeTransitive>
<overWriteReleases>false</overWriteReleases>
<overWriteSnapshots>true</overWriteSnapshots>
<overWriteIfNewer>true</overWriteIfNewer>
</configuration>
</execution>
</executions>
</plugin>
<!-- Build final JAR file -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<outputDirectory>${project.build.directory}/distribution</outputDirectory>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>transfer</id>
<phase>install</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<!-- Stop all running Java processes -->
<sshexec host="${raspberrypi.ipnumber}" port="${raspberrypi.port}"
username="${raspberrypi.username}" password="${raspberrypi.password}"
trust="true"
failonerror="false" usepty="true" useSystemIn="false"
suppresssystemerr="true" suppresssystemout="true"
command="sudo killall -9 java"/>
<!-- Ensure target directory exists on raspberrypi -->
<sshexec host="${raspberrypi.ipnumber}" port="${raspberrypi.port}"
username="${raspberrypi.username}" password="${raspberrypi.password}"
trust="true"
command="mkdir --parents ${raspberrypi.deploydirectory}; rm -f ${raspberrypi.deploydirectory}/*"/>
<!-- Transfer distribution folder to raspberrypi via SCP -->
<scp trust="true"
todir="${raspberrypi.username}:${raspberrypi.password}@${raspberrypi.ipnumber}:${raspberrypi.deploydirectory}"
port="${raspberrypi.port}">
<fileset dir="${project.build.directory}/distribution"/>
</scp>
<!-- Run application on Raspberry Pi -->
<sshexec host="${raspberrypi.ipnumber}" port="${raspberrypi.port}"
username="${raspberrypi.username}" password="${raspberrypi.password}"
trust="true"
failonerror="false" usepty="true" useSystemIn="true"
command="sudo java -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005 --module-path ${raspberrypi.deploydirectory} --module ${launcher.class} ${launcher.args}"/>
</target>
</configuration>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.apache.ant</groupId>
<artifactId>ant-jsch</artifactId>
<version>${ant-jsch.version}</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>