| <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.eclipse.sensinact.gateway.nthbnd</groupId> |
| <artifactId>jsonpath-filtering</artifactId> |
| <version>2.0-SNAPSHOT</version> |
| </parent> |
| |
| <artifactId>jsonpath-filter</artifactId> |
| <packaging>bundle</packaging> |
| |
| <name>sensiNact IoT Gateway - JSON Path filter</name> |
| |
| <properties> |
| <tmp.repository>${project.build.directory}</tmp.repository> |
| </properties> |
| |
| <scm> |
| <connection>scm:git:https://github.com/cmunilla/JPath.git</connection> |
| </scm> |
| |
| <dependencies> |
| <dependency> |
| <groupId>org.eclipse.sensinact.gateway</groupId> |
| <artifactId>sensinact-core</artifactId> |
| <scope>provided</scope> |
| </dependency> |
| <dependency> |
| <groupId>org.eclipse.sensinact.gateway</groupId> |
| <artifactId>sensinact-common</artifactId> |
| <scope>provided</scope> |
| </dependency> |
| <dependency> |
| <groupId>org.eclipse.sensinact.gateway</groupId> |
| <artifactId>sensinact-utils</artifactId> |
| <scope>provided</scope> |
| </dependency> |
| <dependency> |
| <groupId>org.eclipse.sensinact.gateway.tools</groupId> |
| <artifactId>sensinact-test</artifactId> |
| <scope>test</scope> |
| </dependency> |
| <dependency> |
| <groupId>org.apache.felix</groupId> |
| <artifactId>org.apache.felix.main</artifactId> |
| <scope>test</scope> |
| </dependency> |
| <dependency> |
| <groupId>org.apache.felix</groupId> |
| <artifactId>org.apache.felix.log</artifactId> |
| <scope>provided</scope> |
| </dependency> |
| <dependency> |
| <groupId>org.eclipse.sensinact.gateway.protocol</groupId> |
| <artifactId>http</artifactId> |
| <scope>provided</scope> |
| </dependency> |
| <dependency> |
| <groupId>org.apache.felix</groupId> |
| <artifactId>org.apache.felix.http.servlet-api</artifactId> |
| <scope>provided</scope> |
| </dependency> |
| <dependency> |
| <groupId>org.apache.felix</groupId> |
| <artifactId>org.apache.felix.http.jetty</artifactId> |
| <scope>provided</scope> |
| </dependency> |
| <dependency> |
| <groupId>org.skyscreamer</groupId> |
| <artifactId>jsonassert</artifactId> |
| <scope>test</scope> |
| </dependency> |
| <dependency> |
| <groupId>org.eclipse.sensinact.gateway.simulated.devices</groupId> |
| <artifactId>slider</artifactId> |
| <scope>test</scope> |
| </dependency> |
| <dependency> |
| <groupId>org.eclipse.sensinact.gateway.simulated.devices</groupId> |
| <artifactId>light</artifactId> |
| <scope>test</scope> |
| </dependency> |
| <!-- dirty trick to avoid to change the global settings.xml file--> |
| <dependency> |
| <groupId>org.gradle</groupId> |
| <artifactId>gradle-tooling-api</artifactId> |
| </dependency> |
| </dependencies> |
| |
| <build> |
| <plugins> |
| <plugin> |
| <groupId>org.apache.maven.plugins</groupId> |
| <artifactId>maven-scm-plugin</artifactId> |
| <executions> |
| <execution> |
| <id>checkout-jpath</id> |
| <phase>validate</phase> |
| <goals> |
| <goal>checkout</goal> |
| </goals> |
| </execution> |
| </executions> |
| <configuration> |
| <checkoutDirectory>${tmp.repository}/JsonPath</checkoutDirectory> |
| <connectionType>connection</connectionType> |
| <excludes> |
| .git, |
| json-provider-gson, |
| json-provider-jsonsmart, |
| json-provider-tapestry, |
| json-provider-jettison, |
| json-provider-jackson, |
| jpath-web-test, |
| jpath-assert |
| </excludes> |
| </configuration> |
| </plugin> |
| <plugin> |
| <groupId>org.fortasoft</groupId> |
| <artifactId>gradle-maven-plugin</artifactId> |
| <configuration> |
| <tasks> |
| <task>:jpath:compileJava</task> |
| <task>:jpath:assemble</task> |
| <task>:json-provider-jsonorg:compileJava</task> |
| <task>:json-provider-jsonorg:assemble</task> |
| </tasks> |
| <gradleProjectDirectory>${tmp.repository}/JsonPath</gradleProjectDirectory> |
| </configuration> |
| <executions> |
| <execution> |
| <id>jpath-build-libs</id> |
| <phase>validate</phase> |
| <goals> |
| <goal>invoke</goal> |
| </goals> |
| </execution> |
| </executions> |
| </plugin> |
| <plugin> |
| <groupId>org.apache.maven.plugins</groupId> |
| <artifactId>maven-antrun-plugin</artifactId> |
| <executions> |
| <execution> |
| <id>keystoreCopy</id> |
| <phase>generate-test-resources</phase> |
| <configuration> |
| <target description="Copying keystore.jks"> |
| <copy file="../../../sensinact-security/cert/keystore.jks" |
| tofile="${project.build.directory}/felix/bundle/keystore.jks" /> |
| </target> |
| </configuration> |
| <goals> |
| <goal>run</goal> |
| </goals> |
| </execution> |
| |
| <execution> |
| <id>copy-jpath-build-libs</id> |
| <phase>validate</phase> |
| <configuration> |
| <target> |
| <delete file="${project.build.directory}/jpath-1.0.0.jar" /> |
| <copy todir="${project.build.directory}" |
| file="${tmp.repository}/JsonPath/jpath/build/libs/jpath-1.0.0.jar" /> |
| <delete |
| file="${project.build.directory}/json-provider-jsonorg-1.0.0.jar" /> |
| <copy todir="${project.build.directory}" |
| file="${tmp.repository}/JsonPath/json-provider-jsonorg/build/libs/json-provider-jsonorg-1.0.0.jar" /> |
| </target> |
| </configuration> |
| <goals> |
| <goal>run</goal> |
| </goals> |
| </execution> |
| </executions> |
| </plugin> |
| <plugin> |
| <groupId>org.apache.maven.plugins</groupId> |
| <artifactId>maven-surefire-plugin</artifactId> |
| </plugin> |
| <plugin> |
| <groupId>org.apache.felix</groupId> |
| <artifactId>maven-bundle-plugin</artifactId> |
| <extensions>true</extensions> |
| <configuration> |
| <instructions> |
| <_nouses>true</_nouses> |
| <_failok>true</_failok> |
| <_noee>true</_noee> |
| <Bundle-Activator>org.eclipse.sensinact.gateway.nthbnd.filter.jsonpath.osgi.Activator</Bundle-Activator> |
| </instructions> |
| </configuration> |
| <executions> |
| <execution> |
| <goals> |
| <goal>manifest</goal> |
| </goals> |
| <phase>generate-test-resources</phase> |
| <configuration> |
| <manifestLocation>${project.basedir}/target/generated-test-sources/META-INF</manifestLocation> |
| <instructions> |
| <_noee>true</_noee> |
| <_exportcontents>*</_exportcontents> |
| <_nouses>true</_nouses> |
| </instructions> |
| </configuration> |
| </execution> |
| </executions> |
| </plugin> |
| <plugin> |
| <groupId>org.apache.maven.plugins</groupId> |
| <artifactId>maven-dependency-plugin</artifactId> |
| <executions> |
| <execution> |
| <goals> |
| <goal>copy</goal> |
| </goals> |
| <phase>generate-test-resources</phase> |
| <configuration> |
| <artifactItems> |
| <artifactItem> |
| <groupId>org.osgi</groupId> |
| <artifactId>osgi.annotation</artifactId> |
| <outputDirectory>${project.build.directory}/felix/bundle</outputDirectory> |
| <destFileName>osgi.annotation.jar</destFileName> |
| </artifactItem> |
| <artifactItem> |
| <groupId>org.osgi</groupId> |
| <artifactId>org.osgi.service.component</artifactId> |
| <outputDirectory>${project.build.directory}/felix/bundle</outputDirectory> |
| <destFileName>org.osgi.service.component.jar</destFileName> |
| </artifactItem> |
| <artifactItem> |
| <groupId>org.osgi</groupId> |
| <artifactId>org.osgi.service.cm</artifactId> |
| <outputDirectory>${project.build.directory}/felix/bundle</outputDirectory> |
| <destFileName>org.osgi.service.cm.jar</destFileName> |
| </artifactItem> |
| <artifactItem> |
| <groupId>org.osgi</groupId> |
| <artifactId>org.osgi.service.metatype</artifactId> |
| <outputDirectory>${project.build.directory}/felix/bundle</outputDirectory> |
| <destFileName>org.osgi.service.metatype.jar</destFileName> |
| </artifactItem> |
| <artifactItem> |
| <groupId>org.osgi</groupId> |
| <artifactId>org.osgi.namespace.extender</artifactId> |
| <outputDirectory>${project.build.directory}/felix/bundle</outputDirectory> |
| <destFileName>org.osgi.namespace.extender.jar</destFileName> |
| </artifactItem> |
| <artifactItem> |
| <groupId>org.osgi</groupId> |
| <artifactId>org.osgi.util.promise</artifactId> |
| <outputDirectory>${project.build.directory}/felix/bundle</outputDirectory> |
| <destFileName>org.osgi.util.promise.jar</destFileName> |
| </artifactItem> |
| <artifactItem> |
| <groupId>org.osgi</groupId> |
| <artifactId>org.osgi.util.function</artifactId> |
| <outputDirectory>${project.build.directory}/felix/bundle</outputDirectory> |
| <destFileName>org.osgi.util.function.jar</destFileName> |
| </artifactItem> |
| <artifactItem> |
| <groupId>org.osgi</groupId> |
| <artifactId>org.osgi.util.pushstream</artifactId> |
| <outputDirectory>${project.build.directory}/felix/bundle</outputDirectory> |
| <destFileName>org.osgi.util.pushstream.jar</destFileName> |
| </artifactItem> |
| <artifactItem> |
| <groupId>org.osgi</groupId> |
| <artifactId>org.osgi.service.log</artifactId> |
| <outputDirectory>${project.build.directory}/felix/bundle</outputDirectory> |
| <destFileName>org.osgi.service.log.jar</destFileName> |
| </artifactItem> |
| <artifactItem> |
| <groupId>org.apache.felix</groupId> |
| <artifactId>org.apache.felix.log</artifactId> |
| <outputDirectory>${project.build.directory}/felix/bundle</outputDirectory> |
| <destFileName>org.apache.felix.log.jar</destFileName> |
| </artifactItem> |
| <artifactItem> |
| <groupId>org.apache.felix</groupId> |
| <artifactId>org.apache.felix.fileinstall</artifactId> |
| <outputDirectory>${project.build.directory}/felix/bundle</outputDirectory> |
| <destFileName>org.apache.felix.fileinstall.jar</destFileName> |
| </artifactItem> |
| <artifactItem> |
| <groupId>org.apache.felix</groupId> |
| <artifactId>org.apache.felix.configadmin</artifactId> |
| <outputDirectory>${project.build.directory}/felix/bundle</outputDirectory> |
| <destFileName>org.apache.felix.configadmin.jar</destFileName> |
| </artifactItem> |
| <artifactItem> |
| <groupId>org.apache.felix</groupId> |
| <artifactId>org.apache.felix.framework.security</artifactId> |
| <outputDirectory>${project.build.directory}/felix/bundle</outputDirectory> |
| <destFileName>org.apache.felix.framework.security.jar</destFileName> |
| </artifactItem> |
| <artifactItem> |
| <groupId>org.apache.felix</groupId> |
| <artifactId>org.apache.felix.scr</artifactId> |
| <outputDirectory>${project.build.directory}/felix/bundle</outputDirectory> |
| <destFileName>org.apache.felix.scr.jar</destFileName> |
| </artifactItem> |
| <artifactItem> |
| <groupId>org.eclipse.sensinact.gateway</groupId> |
| <artifactId>sensinact-utils</artifactId> |
| <outputDirectory>${project.build.directory}/felix/bundle</outputDirectory> |
| <destFileName>sensinact-utils.jar</destFileName> |
| </artifactItem> |
| <artifactItem> |
| <groupId>org.eclipse.sensinact.gateway</groupId> |
| <artifactId>sensinact-common</artifactId> |
| <outputDirectory>${project.build.directory}/felix/bundle</outputDirectory> |
| <destFileName>sensinact-common.jar</destFileName> |
| </artifactItem> |
| <artifactItem> |
| <groupId>org.eclipse.sensinact.gateway</groupId> |
| <artifactId>sensinact-datastore-api</artifactId> |
| <outputDirectory>${project.build.directory}/felix/bundle</outputDirectory> |
| <destFileName>sensinact-datastore-api.jar</destFileName> |
| </artifactItem> |
| <artifactItem> |
| <groupId>org.eclipse.sensinact.gateway.sthbnd.mqtt</groupId> |
| <artifactId>mqtt-utils</artifactId> |
| <outputDirectory>${project.build.directory}/felix/bundle</outputDirectory> |
| <destFileName>mqtt-utils.jar</destFileName> |
| </artifactItem> |
| <artifactItem> |
| <groupId>org.eclipse.paho</groupId> |
| <artifactId>org.eclipse.paho.client.mqttv3</artifactId> |
| <outputDirectory>${project.build.directory}/felix/bundle</outputDirectory> |
| <destFileName>org.eclipse.paho.client.mqttv3.jar</destFileName> |
| </artifactItem> |
| <artifactItem> |
| <groupId>org.eclipse.sensinact.gateway</groupId> |
| <artifactId>sensinact-core</artifactId> |
| <outputDirectory>${project.build.directory}/felix/bundle</outputDirectory> |
| <destFileName>sensinact-core.jar</destFileName> |
| </artifactItem> |
| <artifactItem> |
| <groupId>org.eclipse.sensinact.gateway</groupId> |
| <artifactId>sensinact-signature-validator</artifactId> |
| <outputDirectory>${project.build.directory}/felix/bundle</outputDirectory> |
| <destFileName>sensinact-signature-validator.jar</destFileName> |
| </artifactItem> |
| <artifactItem> |
| <groupId>org.eclipse.sensinact.gateway</groupId> |
| <artifactId>sensinact-security-none</artifactId> |
| <outputDirectory>${project.build.directory}/felix/bundle</outputDirectory> |
| <destFileName>sensinact-security-none.jar</destFileName> |
| </artifactItem> |
| <artifactItem> |
| <groupId>org.eclipse.sensinact.gateway</groupId> |
| <artifactId>sensinact-generic</artifactId> |
| <outputDirectory>${project.build.directory}/felix/bundle</outputDirectory> |
| <destFileName>sensinact-generic.jar</destFileName> |
| </artifactItem> |
| <artifactItem> |
| <groupId>org.eclipse.sensinact.gateway.nthbnd</groupId> |
| <artifactId>sensinact-northbound-access</artifactId> |
| <outputDirectory>${project.build.directory}/felix/bundle</outputDirectory> |
| <destFileName>sensinact-northbound-access.jar</destFileName> |
| </artifactItem> |
| <artifactItem> |
| <groupId>org.eclipse.sensinact.gateway.nthbnd</groupId> |
| <artifactId>rest-access</artifactId> |
| <outputDirectory>${project.build.directory}/felix/bundle</outputDirectory> |
| <destFileName>rest-access.jar</destFileName> |
| </artifactItem> |
| <artifactItem> |
| <groupId>org.slf4j</groupId> |
| <artifactId>slf4j-api</artifactId> |
| <outputDirectory>${project.build.directory}/felix/bundle</outputDirectory> |
| <destFileName>slf4j-api.jar</destFileName> |
| </artifactItem> |
| <artifactItem> |
| <groupId>org.slf4j</groupId> |
| <artifactId>slf4j-simple</artifactId> |
| <outputDirectory>${project.build.directory}/felix/bundle</outputDirectory> |
| <destFileName>slf4j-simple.jar</destFileName> |
| </artifactItem> |
| <artifactItem> |
| <groupId>org.eclipse.sensinact.gateway.protocol</groupId> |
| <artifactId>http</artifactId> |
| <outputDirectory>${project.build.directory}/felix/bundle</outputDirectory> |
| <destFileName>http.jar</destFileName> |
| </artifactItem> |
| <artifactItem> |
| <groupId>org.apache.felix</groupId> |
| <artifactId>org.apache.felix.http.servlet-api</artifactId> |
| <outputDirectory>${project.build.directory}/felix/bundle</outputDirectory> |
| <destFileName>org.apache.felix.http.servlet-api.jar</destFileName> |
| </artifactItem> |
| <artifactItem> |
| <groupId>org.apache.felix</groupId> |
| <artifactId>org.apache.felix.http.jetty</artifactId> |
| <outputDirectory>${project.build.directory}/felix/bundle</outputDirectory> |
| <destFileName>org.apache.felix.http.jetty.jar</destFileName> |
| </artifactItem> |
| <artifactItem> |
| <groupId>org.eclipse.sensinact.gateway.simulated.devices</groupId> |
| <artifactId>slider</artifactId> |
| <outputDirectory>${project.build.directory}/felix/bundle</outputDirectory> |
| <destFileName>slider.jar</destFileName> |
| </artifactItem> |
| <artifactItem> |
| <groupId>org.eclipse.sensinact.gateway.simulated.devices</groupId> |
| <artifactId>light</artifactId> |
| <outputDirectory>${project.build.directory}/felix/bundle</outputDirectory> |
| <destFileName>light.jar</destFileName> |
| </artifactItem> |
| </artifactItems> |
| </configuration> |
| </execution> |
| </executions> |
| <extensions>true</extensions> |
| </plugin> |
| <plugin> |
| <groupId>org.codehaus.gmaven</groupId> |
| <artifactId>groovy-maven-plugin</artifactId> |
| <executions> |
| <execution> |
| <id>integrate-jpath-build-libs</id> |
| <phase>validate</phase> |
| <goals> |
| <goal>execute</goal> |
| </goals> |
| <configuration> |
| <source> |
| String basedir = project.basedir.absolutePath.replace('\\','/'); |
| File jpathDependencyFile = new File(new File(basedir),"target/jpath-1.0.0.jar"); |
| |
| if(!jpathDependencyFile.exists()) |
| { |
| project.getCompileSourceRoots().clear(); |
| project.getTestCompileSourceRoots().clear(); |
| |
| org.apache.maven.plugin.internal.DefaultPluginManager manager = session.getContainer().lookup(org.apache.maven.plugin.PluginManager.class.getName()); |
| log.info('{}',manager); |
| |
| } else { |
| org.apache.maven.artifact.Artifact artifact = |
| new org.apache.maven.artifact.DefaultArtifact('com.jayway.jsonpath','jpath', |
| org.apache.maven.artifact.versioning.VersionRange.createFromVersionSpec('1.0.0'), |
| org.apache.maven.artifact.Artifact.SCOPE_SYSTEM, |
| 'jar', '', new org.apache.maven.artifact.handler.DefaultArtifactHandler('jar') { |
| @Override |
| public boolean isAddedToClasspath() |
| { |
| return true; |
| } |
| |
| @Override |
| public boolean isIncludesDependencies() |
| { |
| return true; |
| } |
| |
| @Override |
| public String getDirectory() |
| { |
| return jpathDependencyFile.getParentFile().getAbsolutePath(); |
| } |
| }, false); |
| artifact.setFile(jpathDependencyFile); |
| project.getDependencyArtifacts().add(artifact); |
| |
| File providerDependencyFile = new File(new File(basedir),"target/json-provider-jsonorg-1.0.0.jar"); |
| artifact = new org.apache.maven.artifact.DefaultArtifact('com.jayway.jsonpath', 'json-provider-jsonorg', |
| org.apache.maven.artifact.versioning.VersionRange.createFromVersionSpec('1.0.0'), |
| org.apache.maven.artifact.Artifact.SCOPE_SYSTEM, |
| 'jar', '', |
| new org.apache.maven.artifact.handler.DefaultArtifactHandler('jar') |
| { |
| @Override |
| public boolean isAddedToClasspath() |
| { |
| return true; |
| } |
| |
| @Override |
| public boolean isIncludesDependencies() |
| { |
| return true; |
| } |
| |
| @Override |
| public String getDirectory() |
| { |
| return providerDependencyFile.getParentFile().getAbsolutePath(); |
| } |
| }, |
| false); |
| artifact.setFile(providerDependencyFile); |
| project.getDependencyArtifacts().add(artifact); |
| } |
| </source> |
| </configuration> |
| </execution> |
| <execution> |
| <id>copy-dependency</id> |
| <phase>generate-test-resources</phase> |
| <goals> |
| <goal>execute</goal> |
| </goals> |
| <configuration> |
| <source> |
| String basedir = project.basedir.absolutePath.replace('\\','/'); |
| File jpathDependencyFile = new File(new File(basedir),"target/jpath-1.0.0.jar"); |
| File dir = new File(new File(basedir),'target/felix/bundle'); |
| if (!dir.exists()) { |
| dir.mkdirs(); |
| } |
| def newFile = new File(new File(basedir),'target/felix/bundle/jpath.jar'); |
| newFile.createNewFile(); |
| output = newFile.newOutputStream(); |
| jpathDependencyFile.newInputStream().eachByte(1024, {data, lenth -> output.write(data, 0, lenth)}); |
| output.close(); |
| |
| File providerDependencyFile = new File(new File(basedir),"target/json-provider-jsonorg-1.0.0.jar"); |
| newFile = new File(new File(basedir),'target/felix/bundle/json-provider-jsonorg.jar'); |
| newFile.createNewFile(); |
| output = newFile.newOutputStream(); |
| providerDependencyFile.newInputStream().eachByte(1024, {data, lenth -> output.write(data, 0, lenth)}); |
| output.close(); |
| </source> |
| </configuration> |
| </execution> |
| </executions> |
| </plugin> |
| </plugins> |
| </build> |
| </project> |