blob: 804584517906133b2a3782e7e70ea22b7d73e144 [file] [log] [blame]
<?xml version="1.0"?>
<!--
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">
<parent>
<artifactId>ambari-logsearch</artifactId>
<groupId>org.apache.ambari</groupId>
<version>2.6.1.0.0</version>
</parent>
<name>Ambari Logsearch Assembly</name>
<url>http://maven.apache.org</url>
<modelVersion>4.0.0</modelVersion>
<properties>
<mapping.base.path>/usr/lib</mapping.base.path>
<!-- original apache repo location: http://archive.apache.org/dist/lucene/solr/${solr.version}/solr-${solr.version}.tgz -->
<solr.tar>http://public-repo-1.hortonworks.com/ARTIFACTS/dist/lucene/solr/${solr.version}/solr-${solr.version}.tgz</solr.tar>
<solr.mapping.path>${mapping.base.path}/ambari-infra-solr</solr.mapping.path>
<solr.package.name>ambari-infra-solr</solr.package.name>
<solr.client.package.name>ambari-infra-solr-client</solr.client.package.name>
<solr.client.mapping.path>${mapping.base.path}/${solr.client.package.name}</solr.client.mapping.path>
<solr.client.dir>${project.basedir}/../ambari-logsearch-solr-client</solr.client.dir>
<logsearch.portal.package.name>ambari-logsearch-portal</logsearch.portal.package.name>
<logsearch.portal.mapping.path>${mapping.base.path}/ambari-logsearch-portal</logsearch.portal.mapping.path>
<logsearch.portal.dir>${project.basedir}/../ambari-logsearch-portal</logsearch.portal.dir>
<logsearch.logfeeder.package.name>ambari-logsearch-logfeeder</logsearch.logfeeder.package.name>
<logsearch.logfeeder.mapping.path>${mapping.base.path}/ambari-logsearch-logfeeder</logsearch.logfeeder.mapping.path>
<logsearch.logfeeder.dir>${project.basedir}/../ambari-logsearch-logfeeder</logsearch.logfeeder.dir>
<logsearch.portal.conf.mapping.path>/etc/${logsearch.portal.package.name}/conf</logsearch.portal.conf.mapping.path>
<logsearch.logfeeder.conf.mapping.path>/etc/${logsearch.logfeeder.package.name}/conf
</logsearch.logfeeder.conf.mapping.path>
<infra.solr.plugin.dir>${project.basedir}/../ambari-infra-solr-plugin</infra.solr.plugin.dir>
</properties>
<artifactId>ambari-logsearch-assembly</artifactId>
<profiles>
<profile>
<id>rpm</id>
<properties>
<download.solr>true</download.solr>
</properties>
<activation>
<property>
<name>build-rpm</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>rpm-maven-plugin</artifactId>
<version>2.1.4</version>
<configuration>
<copyright>2012, Apache Software Foundation</copyright>
<group>Development</group>
<description>Maven Recipe: RPM Package.</description>
<autoRequires>false</autoRequires>
<prefix>/</prefix>
<needarch>noarch</needarch>
<targetOS>linux</targetOS>
<version>${package-version}</version>
<release>${package-release}</release>
<defaultUsername>root</defaultUsername>
<defaultGroupname>root</defaultGroupname>
</configuration>
<executions>
<execution>
<id>logsearch-solr</id>
<phase>package</phase>
<goals>
<goal>rpm</goal>
</goals>
<configuration>
<group>Development</group>
<name>${solr.package.name}</name>
<mappings>
<mapping>
<directory>${solr.mapping.path}</directory>
<sources>
<source>
<location>${project.build.directory}/solr</location>
</source>
</sources>
</mapping>
</mappings>
</configuration>
</execution>
<execution>
<id>logsearch-solr-client</id>
<phase>package</phase>
<goals>
<goal>rpm</goal>
</goals>
<configuration>
<group>Development</group>
<name>${solr.client.package.name}</name>
<needarch>noarch</needarch>
<targetOS>linux</targetOS>
<postinstallScriptlet>
<scriptFile>${project.basedir}/src/main/package/rpm/solr-client/postinstall.sh</scriptFile>
<fileEncoding>utf-8</fileEncoding>
</postinstallScriptlet>
<mappings>
<mapping>
<directory>${solr.client.mapping.path}</directory>
<sources>
<source>
<location>${solr.client.dir}/target/package</location>
<excludes>
<exclude>libs/checkstyle*.jar</exclude>
</excludes>
</source>
</sources>
</mapping>
</mappings>
</configuration>
</execution>
<execution>
<id>logsearch-portal</id>
<phase>package</phase>
<goals>
<goal>rpm</goal>
</goals>
<configuration>
<group>Development</group>
<name>${logsearch.portal.package.name}</name>
<mappings>
<mapping>
<directory>${logsearch.portal.mapping.path}</directory>
<sources>
<source>
<location>${logsearch.portal.dir}/target/package</location>
<excludes>
<exclude>classes/log4j.xml</exclude>
<exclude>classes/logsearch.properties</exclude>
<exclude>classes/user_pass.json</exclude>
<exclude>classes/HadoopServiceConfig.json</exclude>
<exclude>solr_configsets/**</exclude>
<exclude>libs/checkstyle*.jar</exclude>
</excludes>
</source>
</sources>
</mapping>
<mapping>
<directory>${logsearch.portal.conf.mapping.path}</directory>
<sources>
<source>
<location>${logsearch.portal.dir}/target/package/classes</location>
<includes>
<include>log4j.xml</include>
<include>logsearch.properties</include>
<include>user_pass.json</include>
</includes>
</source>
</sources>
</mapping>
<mapping>
<directory>${logsearch.portal.conf.mapping.path}/solr_configsets</directory>
<sources>
<source>
<location>${logsearch.portal.dir}/target/package/solr_configsets</location>
</source>
</sources>
</mapping>
</mappings>
</configuration>
</execution>
<execution>
<id>logsearch-logfeeder</id>
<phase>package</phase>
<goals>
<goal>rpm</goal>
</goals>
<configuration>
<group>Development</group>
<name>${logsearch.logfeeder.package.name}</name>
<mappings>
<mapping>
<directory>${logsearch.logfeeder.mapping.path}</directory>
<sources>
<source>
<location>${logsearch.logfeeder.dir}/target/package</location>
<excludes>
<exclude>classes/log4j.xml</exclude>
<exclude>classes/logfeeder.properties</exclude>
<exclude>classes/grok-patterns</exclude>
<exclude>libs/checkstyle*.jar</exclude>
</excludes>
</source>
</sources>
</mapping>
<mapping>
<directory>${logsearch.logfeeder.conf.mapping.path}</directory>
<sources>
<source>
<location>${logsearch.logfeeder.dir}/target/package/classes</location>
<includes>
<include>log4j.xml</include>
<include>logfeeder.properties</include>
<include>grok-patterns</include>
</includes>
</source>
</sources>
</mapping>
</mappings>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.7</version>
<executions>
<execution>
<phase>generate-resources</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target name="Download Solr">
<get
src="${solr.tar}"
dest="${project.build.directory}/solr.tgz"
usetimestamp="true"
/>
<untar
src="${project.build.directory}/solr.tgz"
dest="${project.build.directory}/"
compression="gzip"
/>
<move todir="${project.build.directory}/solr">
<fileset dir="${project.build.directory}/solr-${solr.version}"/>
</move>
<copy file="${project.basedir}/src/main/resources/solr" toDir="${project.build.directory}/solr/bin/" />
<copy file="${infra.solr.plugin.dir}/target/ambari-infra-solr-plugin-${project.version}.jar"
toDir="${project.build.directory}/solr/server/solr-webapp/webapp/WEB-INF/lib/"/>
<chmod file="${project.build.directory}/solr/bin/**" perm="755"/>
<chmod file="${project.build.directory}/solr/server/scripts/**" perm="755"/>
</target>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>deb</id>
<activation>
<property>
<name>build-deb</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>2.7</version>
<executions>
<execution>
<id>copy-resources</id>
<phase>package</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/resources/deb</outputDirectory>
<resources>
<resource>
<directory>${project.basedir}/src/main/package/deb</directory>
<excludes>
<exclude>solr/postinst</exclude>
<exclude>solr-client/postinst</exclude>
<exclude>portal/postinst</exclude>
<exclude>logfeeder/postinst</exclude>
</excludes>
<filtering>false</filtering>
</resource>
<resource>
<directory>${project.basedir}/src/main/package/deb</directory>
<includes>
<include>solr/postinst</include>
<include>solr-client/postinst</include>
<include>portal/postinst</include>
<include>logfeeder/postinst</include>
</includes>
<filtering>true</filtering>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.vafer</groupId>
<artifactId>jdeb</artifactId>
<version>1.4</version>
<executions>
<execution>
<phase>package</phase>
<id>jdeb-solr</id>
<goals>
<goal>jdeb</goal>
</goals>
<configuration>
<controlDir>${basedir}/src/main/package/deb/solr</controlDir>
<deb>${basedir}/target/${solr.package.name}_${package-version}-${package-release}.deb</deb>
<skip>false</skip>
<skipPOMs>false</skipPOMs>
<dataSet>
<data>
<src>${project.build.directory}/solr</src>
<type>directory</type>
<mapper>
<type>perm</type>
<user>root</user>
<group>root</group>
<prefix>${solr.mapping.path}</prefix>
</mapper>
<excludes>
bin/**,server/scripts/**
</excludes>
</data>
<data>
<src>${project.build.directory}/solr</src>
<type>directory</type>
<mapper>
<type>perm</type>
<user>root</user>
<group>root</group>
<filemode>755</filemode>
<prefix>${solr.mapping.path}</prefix>
</mapper>
<includes>
bin/**,server/scripts/**
</includes>
</data>
</dataSet>
</configuration>
</execution>
<execution>
<phase>package</phase>
<id>jdeb-solr-client</id>
<goals>
<goal>jdeb</goal>
</goals>
<configuration>
<controlDir>${basedir}/src/main/package/deb/solr-client</controlDir>
<deb>${basedir}/target/${solr.client.package.name}_${package-version}-${package-release}.deb</deb>
<skip>false</skip>
<skipPOMs>false</skipPOMs>
<dataSet>
<data>
<src>${solr.client.dir}/target/ambari-logsearch-solr-client.tar.gz</src>
<type>archive</type>
<mapper>
<type>perm</type>
<user>root</user>
<group>root</group>
<prefix>${solr.client.mapping.path}</prefix>
</mapper>
<excludes>libs/checkstyle*.jar</excludes>
</data>
</dataSet>
</configuration>
</execution>
<execution>
<id>jdeb-portal</id>
<phase>package</phase>
<goals>
<goal>jdeb</goal>
</goals>
<configuration>
<controlDir>${basedir}/src/main/package/deb/portal</controlDir>
<deb>${basedir}/target/${logsearch.portal.package.name}_${package-version}-${package-release}.deb
</deb>
<skip>false</skip>
<skipPOMs>false</skipPOMs>
<dataSet>
<data>
<src>${logsearch.portal.dir}/target/ambari-logsearch-portal.tar.gz</src>
<type>archive</type>
<mapper>
<prefix>${logsearch.portal.mapping.path}</prefix>
<type>perm</type>
<user>root</user>
<group>root</group>
</mapper>
<excludes>
classes/log4j.xml,classes/logsearch.properties,classes/user_pass.json,classes/HadoopServiceConfig.json,solr_configsets/**,libs/checkstyle*.jar
</excludes>
</data>
<data>
<src>${logsearch.portal.dir}/target/package/classes</src>
<type>directory</type>
<mapper>
<prefix>${logsearch.portal.conf.mapping.path}</prefix>
<type>perm</type>
<user>root</user>
<group>root</group>
<filemode>644</filemode>
</mapper>
<includes>
log4j.xml,logsearch.properties,user_pass.json
</includes>
</data>
<data>
<src>${logsearch.portal.dir}/target/package/solr_configsets</src>
<type>directory</type>
<mapper>
<prefix>${logsearch.portal.conf.mapping.path}/solr_configsets</prefix>
<type>perm</type>
<user>root</user>
<group>root</group>
</mapper>
</data>
</dataSet>
</configuration>
</execution>
<execution>
<id>jdeb-logfeeder</id>
<phase>package</phase>
<goals>
<goal>jdeb</goal>
</goals>
<configuration>
<controlDir>${basedir}/src/main/package/deb/logfeeder</controlDir>
<deb>${basedir}/target/${logsearch.logfeeder.package.name}_${package-version}-${package-release}.deb
</deb>
<skip>false</skip>
<skipPOMs>false</skipPOMs>
<dataSet>
<data>
<src>${logsearch.logfeeder.dir}/target/ambari-logsearch-logfeeder.tgz</src>
<type>archive</type>
<mapper>
<prefix>${logsearch.logfeeder.mapping.path}</prefix>
<type>perm</type>
<user>root</user>
<group>root</group>
</mapper>
<excludes>
classes/log4j.xml,classes/logfeeder.properties,classes/grok-patterns,libs/checkstyle*.jar
</excludes>
</data>
<data>
<src>${logsearch.logfeeder.dir}/target/package/classes</src>
<type>directory</type>
<mapper>
<prefix>${logsearch.logfeeder.conf.mapping.path}</prefix>
<type>perm</type>
<user>root</user>
<group>root</group>
<filemode>644</filemode>
</mapper>
<includes>
log4j.xml,logfeeder.properties,grok-patterns
</includes>
</data>
</dataSet>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.7</version>
<executions>
<execution>
<phase>generate-resources</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target name="Download Solr">
<get
src="${solr.tar}"
dest="${project.build.directory}/solr.tgz"
usetimestamp="true"
/>
<untar
src="${project.build.directory}/solr.tgz"
dest="${project.build.directory}/"
compression="gzip"
/>
<move todir="${project.build.directory}/solr">
<fileset dir="${project.build.directory}/solr-${solr.version}"/>
</move>
<copy file="${project.basedir}/src/main/resources/solr" toDir="${project.build.directory}/solr/bin/" />
<copy file="${infra.solr.plugin.dir}/target/ambari-infra-solr-plugin-${project.version}.jar"
toDir="${project.build.directory}/solr/server/solr-webapp/webapp/WEB-INF/lib/"/>
<chmod file="${project.build.directory}/solr/bin/**" perm="755"/>
<chmod file="${project.build.directory}/solr/server/scripts/**" perm="755"/>
</target>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<dependencies>
<dependency>
<groupId>org.apache.ambari</groupId>
<artifactId>ambari-logsearch-portal</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.ambari</groupId>
<artifactId>ambari-logsearch-logfeeder</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.ambari</groupId>
<artifactId>ambari-logsearch-solr-client</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.ambari</groupId>
<artifactId>ambari-infra-solr-plugin</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
</project>