| <?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 |
| |
| http://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> |
| <artifactId>metron-rpm</artifactId> |
| <packaging>pom</packaging> |
| <name>metron-rpm</name> |
| <version>0.6.0</version> |
| <parent> |
| <groupId>org.apache.metron</groupId> |
| <artifactId>metron-deployment</artifactId> |
| <version>0.6.0</version> |
| <relativePath>../../..</relativePath> |
| </parent> |
| <description>RPM Builder for Apache Metron</description> |
| <properties> |
| <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> |
| <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> |
| <rpm.docker.tag>rpm-docker</rpm.docker.tag> |
| <metron_dir>${project.parent.relativePath}/..</metron_dir> |
| </properties> |
| <build> |
| <plugins> |
| <plugin> |
| <groupId>org.apache.maven.plugins</groupId> |
| <artifactId>maven-antrun-plugin</artifactId> |
| <version>1.1</version> |
| <executions> |
| <execution> |
| <phase>validate</phase> |
| <goals> |
| <goal>run</goal> |
| </goals> |
| <configuration> |
| <tasks> |
| <echo>******** Displaying value of property ********</echo> |
| <echo>${metron_dir}</echo> |
| </tasks> |
| </configuration> |
| </execution> |
| </executions> |
| </plugin> |
| <plugin> |
| <artifactId>maven-clean-plugin</artifactId> |
| <version>3.0.0</version> |
| <configuration> |
| <filesets> |
| <fileset> |
| <directory>BUILD</directory> |
| <followSymlinks>false</followSymlinks> |
| </fileset> |
| <fileset> |
| <directory>BUILDROOT</directory> |
| <followSymlinks>false</followSymlinks> |
| </fileset> |
| <fileset> |
| <directory>RPMS</directory> |
| <followSymlinks>false</followSymlinks> |
| </fileset> |
| <fileset> |
| <directory>RPMS/noarch</directory> |
| <followSymlinks>false</followSymlinks> |
| </fileset> |
| <fileset> |
| <directory>SOURCES</directory> |
| <followSymlinks>false</followSymlinks> |
| </fileset> |
| <fileset> |
| <directory>SRPMS</directory> |
| <followSymlinks>false</followSymlinks> |
| </fileset> |
| <fileset> |
| <directory>.npm</directory> |
| <includes> |
| <include>**/*</include> |
| </includes> |
| </fileset> |
| </filesets> |
| </configuration> |
| </plugin> |
| <plugin> |
| <artifactId>maven-resources-plugin</artifactId> |
| <version>3.0.1</version> |
| <executions> |
| <execution> |
| <id>copy-rpm-sources</id> |
| <phase>prepare-package</phase> |
| <goals> |
| <goal>copy-resources</goal> |
| </goals> |
| <configuration> |
| <outputDirectory>${project.basedir}/SOURCES</outputDirectory> |
| <resources> |
| <resource> |
| <directory>${metron_dir}/metron-platform/metron-common/target/</directory> |
| <includes> |
| <include>*.tar.gz</include> |
| </includes> |
| </resource> |
| <resource> |
| <directory>${metron_dir}/metron-platform/metron-data-management/target/</directory> |
| <includes> |
| <include>*.tar.gz</include> |
| </includes> |
| </resource> |
| <resource> |
| <directory>${metron_dir}/metron-platform/metron-elasticsearch/target/</directory> |
| <includes> |
| <include>*.tar.gz</include> |
| </includes> |
| </resource> |
| <resource> |
| <directory>${metron_dir}/metron-platform/metron-enrichment/target/</directory> |
| <includes> |
| <include>*.tar.gz</include> |
| </includes> |
| </resource> |
| <resource> |
| <directory>${metron_dir}/metron-platform/metron-indexing/target/</directory> |
| <includes> |
| <include>*.tar.gz</include> |
| </includes> |
| </resource> |
| <resource> |
| <directory>${metron_dir}/metron-platform/metron-management/target/</directory> |
| <includes> |
| <include>*.tar.gz</include> |
| </includes> |
| </resource> |
| <resource> |
| <directory>${metron_dir}/metron-platform/metron-parsers/target/</directory> |
| <includes> |
| <include>*.tar.gz</include> |
| </includes> |
| </resource> |
| <resource> |
| <directory>${metron_dir}/metron-platform/metron-pcap-backend/target/</directory> |
| <includes> |
| <include>*.tar.gz</include> |
| </includes> |
| </resource> |
| <resource> |
| <directory>${metron_dir}/metron-platform/metron-solr/target/</directory> |
| <includes> |
| <include>*.tar.gz</include> |
| </includes> |
| </resource> |
| <resource> |
| <directory>${metron_dir}/metron-analytics/metron-profiler/target/</directory> |
| <includes> |
| <include>*.tar.gz</include> |
| </includes> |
| </resource> |
| <resource> |
| <directory>${metron_dir}/metron-interface/metron-rest/target/</directory> |
| <includes> |
| <include>*.tar.gz</include> |
| </includes> |
| </resource> |
| <resource> |
| <directory>${metron_dir}/metron-interface/metron-config/target/</directory> |
| <includes> |
| <include>*.tar.gz</include> |
| </includes> |
| </resource> |
| <resource> |
| <directory>${metron_dir}/metron-analytics/metron-maas-service/target/</directory> |
| <includes> |
| <include>*.tar.gz</include> |
| </includes> |
| </resource> |
| <resource> |
| <directory>${metron_dir}/metron-interface/metron-alerts/target/</directory> |
| <includes> |
| <include>*.tar.gz</include> |
| </includes> |
| </resource> |
| <resource> |
| <directory>${metron_dir}/metron-contrib/metron-performance/target/</directory> |
| <includes> |
| <include>*.tar.gz</include> |
| </includes> |
| </resource> |
| </resources> |
| </configuration> |
| </execution> |
| </executions> |
| </plugin> |
| </plugins> |
| </build> |
| <profiles> |
| <profile> |
| <id>InDocker</id> |
| <activation> |
| <file> |
| <!-- If this file exists, then we are running in docker already --> |
| <exists>/.dockerenv</exists> |
| </file> |
| </activation> |
| <build> |
| <plugins> |
| <plugin> |
| <groupId>org.codehaus.mojo</groupId> |
| <artifactId>exec-maven-plugin</artifactId> |
| <version>1.5.0</version> |
| <executions> |
| <execution> |
| <id>rpm-build</id> |
| <phase>package</phase> |
| <goals> |
| <goal>exec</goal> |
| </goals> |
| <configuration> |
| <executable>/bin/bash</executable> |
| <arguments> |
| <argument>-c</argument> |
| <argument>./build.sh ${project.version}</argument> |
| </arguments> |
| </configuration> |
| </execution> |
| </executions> |
| </plugin> |
| <plugin> |
| <artifactId>maven-resources-plugin</artifactId> |
| <version>3.0.1</version> |
| <executions> |
| <execution> |
| <id>copy-rpms-target</id> |
| <phase>package</phase> |
| <goals> |
| <goal>copy-resources</goal> |
| </goals> |
| <configuration> |
| <outputDirectory>${project.basedir}/target/RPMS</outputDirectory> |
| <resources> |
| <resource> |
| <directory>RPMS</directory> |
| </resource> |
| </resources> |
| </configuration> |
| </execution> |
| </executions> |
| </plugin> |
| </plugins> |
| </build> |
| </profile> |
| <profile> |
| <id>NeedsDocker</id> |
| <activation> |
| <file> |
| <!-- if this file doesn't exist, then we need to run docker --> |
| <missing>/.dockerenv</missing> |
| </file> |
| </activation> |
| <build> |
| <plugins> |
| <plugin> |
| <groupId>org.codehaus.mojo</groupId> |
| <artifactId>exec-maven-plugin</artifactId> |
| <version>1.5.0</version> |
| <executions> |
| <execution> |
| <id>docker-build</id> |
| <phase>package</phase> |
| <goals> |
| <goal>exec</goal> |
| </goals> |
| <configuration> |
| <executable>docker</executable> |
| <arguments> |
| <argument>build</argument> |
| <argument>-f</argument> |
| <argument>Dockerfile</argument> |
| <argument>-t</argument> |
| <argument>${rpm.docker.tag}</argument> |
| <argument>.</argument> |
| </arguments> |
| </configuration> |
| </execution> |
| <execution> |
| <id>rpm-build</id> |
| <phase>package</phase> |
| <goals> |
| <goal>exec</goal> |
| </goals> |
| <configuration> |
| <executable>docker</executable> |
| <arguments> |
| <argument>run</argument> |
| <argument>-v</argument> |
| <argument>${project.basedir}:/root</argument> |
| <argument>${rpm.docker.tag}:latest</argument> |
| <argument>/bin/bash</argument> |
| <argument>-c</argument> |
| <argument>./build.sh ${project.version}</argument> |
| </arguments> |
| </configuration> |
| </execution> |
| </executions> |
| </plugin> |
| <plugin> |
| <artifactId>maven-resources-plugin</artifactId> |
| <version>3.0.1</version> |
| <executions> |
| <execution> |
| <id>copy-rpms-target</id> |
| <phase>package</phase> |
| <goals> |
| <goal>copy-resources</goal> |
| </goals> |
| <configuration> |
| <outputDirectory>${project.basedir}/target/RPMS</outputDirectory> |
| <resources> |
| <resource> |
| <directory>RPMS</directory> |
| </resource> |
| </resources> |
| </configuration> |
| </execution> |
| </executions> |
| </plugin> |
| </plugins> |
| </build> |
| </profile> |
| </profiles> |
| </project> |