| POM文件内容: |
<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 ARTIFACT INFORMATION -->
<artifactId>pi4j-core</artifactId>
<name>Pi4J :: Java Library (Core)</name>
<description>Pi4J Java Library for the Raspberry Pi</description>
<packaging>jar</packaging>
<parent>
<groupId>com.pi4j</groupId>
<artifactId>pi4j-parent</artifactId>
<version>0.0.5</version>
</parent>
<!-- PROJECT DEPENDENCIES -->
<dependencies>
<dependency>
<groupId>com.pi4j</groupId>
<artifactId>pi4j-native</artifactId>
<version>${project.version}</version>
<type>so</type>
<classifier>hard-float</classifier>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.pi4j</groupId>
<artifactId>pi4j-native</artifactId>
<version>${project.version}</version>
<type>so</type>
<classifier>soft-float</classifier>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<!-- BUILD INSTRUCTIONS -->
<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>
<filtering>false</filtering>
</resource>
</resources>
<plugins>
<!-- JAVA COMPILER -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
</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>
<!-- GENERATE LICENSE HEADERS IN SOURCE FILES -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>license-maven-plugin</artifactId>
</plugin>
<!-- RETRIEVE THE JNI NATIVE LIBRARY DEPENDENCY -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy</id>
<phase>validate</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<artifactItems>
<!-- we define the libpi4j native project as a dependency so that
native library can be included in the final packaged pi4j.jar -->
<artifactItem>
<groupId>com.pi4j</groupId>
<artifactId>pi4j-native</artifactId>
<version>${project.version}</version>
<type>so</type>
<classifier>hard-float</classifier>
<overWrite>true</overWrite>
<outputDirectory>${project.build.directory}/lib/hard-float</outputDirectory>
<destFileName>libpi4j.so</destFileName>
</artifactItem>
<artifactItem>
<groupId>com.pi4j</groupId>
<artifactId>pi4j-native</artifactId>
<version>${project.version}</version>
<type>so</type>
<classifier>soft-float</classifier>
<overWrite>true</overWrite>
<outputDirectory>${project.build.directory}/lib/soft-float</outputDirectory>
<destFileName>libpi4j.so</destFileName>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
<!-- EMBED THE JNI NATIVE LIBRARY INSIDE THE JAR -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<executions>
<execution>
<id>embed-jni-native-resource</id>
<phase>generate-resources</phase>
<goals>
<goal>add-resource</goal>
</goals>
<configuration>
<resources>
<resource>
<directory>${project.build.directory}/lib</directory>
<targetPath>lib</targetPath>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<!-- OSGi BUNDLE -->
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<configuration>
<instructions>
<Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
<Bundle-Version>${project.version}</Bundle-Version>
<Export-Package>
com.pi4j.util.*,
com.pi4j.jni.*,
com.pi4j.wiringpi.*,
com.pi4j.system.*,
com.pi4j.io.serial.*,
com.pi4j.io.gpio.*,
com.pi4j.io.i2c.*
</Export-Package>
<Private-Package>
</Private-Package>
</instructions>
</configuration>
<executions>
<execution>
<id>bundle-manifest</id>
<phase>process-classes</phase>
<goals>
<goal>manifest</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- INCLUDE OSGi MANIFEST IN JAR -->
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
</archive>
</configuration>
</plugin>
<!-- OPTIONALLY DEPLOY THE FINAL JAR TO THE RASBERRY PI -->
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<!-- copy the compiled JAR file to the Raspberry Pi platform platform -->
<execution>
<id>transfer-compiled-pi4j-jar</id>
<phase>install</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
<taskdef resource="net/sf/antcontrib/antcontrib.properties"
classpathref="maven.plugin.classpath" />
<if>
<equals arg1="${pi.transfer.dev}" arg2="true" />
<then>
<!-- ensure the target directory exists on the Raspberry Pi -->
<sshexec host="${pi.host.dev}" port="${pi.port.dev}" username="${pi.user.dev}"
password="${pi.password.dev}" trust="true" failonerror="false"
verbose="true" command="mkdir --parents ${pi.dirCopyTo.dev}" />
<!-- copy the JAR file to the Raspberry Pi -->
<scp
file="${project.build.directory}/${project.build.finalName}.jar"
todir="${pi.user.dev}:${pi.password.dev}@${pi.host.dev}:${pi.dirCopyTo.dev}"
port="${pi.port.dev}" trust="true" verbose="true" failonerror="true">
</scp>
</then>
</if>
</tasks>
</configuration>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.apache.ant</groupId>
<artifactId>ant-jsch</artifactId>
<version>1.7.1</version>
</dependency>
<dependency>
<groupId>com.jcraft</groupId>
<artifactId>jsch</artifactId>
<version>0.1.42</version>
</dependency>
<dependency>
<groupId>ant-contrib</groupId>
<artifactId>ant-contrib</artifactId>
<version>20020829</version>
</dependency>
</dependencies>
</plugin>
</plugins>
<pluginManagement>
<plugins>
<!--This plugin's configuration is used to store Eclipse m2e settings
only. It has no influence on the Maven build itself. -->
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.apache.felix</groupId>
<artifactId>
maven-bundle-plugin
</artifactId>
<versionRange>
[2.3.7,)
</versionRange>
<goals>
<goal>manifest</goal>
</goals>
</pluginExecutionFilter>
<action>
<ignore></ignore>
</action>
</pluginExecution>
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.codehaus.mojo</groupId>
<artifactId>
build-helper-maven-plugin
</artifactId>
<versionRange>[1.7,)</versionRange>
<goals>
<goal>add-resource</goal>
</goals>
</pluginExecutionFilter>
<action>
<ignore></ignore>
</action>
</pluginExecution>
<pluginExecution>
<pluginExecutionFilter>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-dependency-plugin
</artifactId>
<versionRange>
[2.5.1,)
</versionRange>
<goals>
<goal>copy</goal>
</goals>
</pluginExecutionFilter>
<action>
<ignore></ignore>
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
|