2015-06-03 04:39:31 -04:00
|
|
|
<?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>
|
|
|
|
<parent>
|
|
|
|
<groupId>org.elasticsearch</groupId>
|
2015-08-18 05:02:23 -04:00
|
|
|
<artifactId>parent</artifactId>
|
2015-09-03 04:43:28 -04:00
|
|
|
<version>3.0.0-SNAPSHOT</version>
|
2015-06-03 04:39:31 -04:00
|
|
|
</parent>
|
|
|
|
|
|
|
|
<groupId>org.elasticsearch.distribution</groupId>
|
2015-08-14 11:18:21 -04:00
|
|
|
<artifactId>distributions</artifactId>
|
2015-06-03 04:39:31 -04:00
|
|
|
<packaging>pom</packaging>
|
2015-08-14 11:18:21 -04:00
|
|
|
<name>Distribution: Parent POM</name>
|
2015-06-03 04:39:31 -04:00
|
|
|
|
|
|
|
<properties>
|
|
|
|
<!-- Properties used for building RPM & DEB packages (see common/packaging.properties) -->
|
|
|
|
<packaging.elasticsearch.home.dir>/usr/share/elasticsearch</packaging.elasticsearch.home.dir>
|
|
|
|
<packaging.elasticsearch.bin.dir>/usr/share/elasticsearch/bin</packaging.elasticsearch.bin.dir>
|
|
|
|
<packaging.elasticsearch.conf.dir>/etc/elasticsearch</packaging.elasticsearch.conf.dir>
|
|
|
|
<packaging.elasticsearch.data.dir>/var/lib/elasticsearch</packaging.elasticsearch.data.dir>
|
|
|
|
<packaging.elasticsearch.user>elasticsearch</packaging.elasticsearch.user>
|
|
|
|
<packaging.elasticsearch.group>elasticsearch</packaging.elasticsearch.group>
|
|
|
|
<packaging.elasticsearch.log.dir>/var/log/elasticsearch</packaging.elasticsearch.log.dir>
|
|
|
|
<packaging.elasticsearch.plugins.dir>${packaging.elasticsearch.home.dir}/plugins</packaging.elasticsearch.plugins.dir>
|
|
|
|
<packaging.elasticsearch.pid.dir>/var/run/elasticsearch</packaging.elasticsearch.pid.dir>
|
|
|
|
<packaging.elasticsearch.systemd.dir>/usr/lib/systemd/system</packaging.elasticsearch.systemd.dir>
|
|
|
|
<packaging.elasticsearch.systemd.sysctl.dir>/usr/lib/sysctl.d</packaging.elasticsearch.systemd.sysctl.dir>
|
|
|
|
<packaging.elasticsearch.tmpfilesd.dir>/usr/lib/tmpfiles.d</packaging.elasticsearch.tmpfilesd.dir>
|
|
|
|
|
2015-08-09 12:18:59 -04:00
|
|
|
<!-- Properties for the license checker -->
|
|
|
|
<project.licenses.dir>${project.basedir}/../licenses</project.licenses.dir>
|
|
|
|
<project.licenses.check_target>${integ.scratch}</project.licenses.check_target>
|
|
|
|
|
2015-07-29 21:34:46 -04:00
|
|
|
<!-- we expect packaging formats to have integration tests, but not unit tests -->
|
|
|
|
<skip.unit.tests>true</skip.unit.tests>
|
2015-06-03 04:39:31 -04:00
|
|
|
</properties>
|
|
|
|
|
2015-08-01 14:02:14 -04:00
|
|
|
<!-- PUT TEST ONLY DEPS HERE. Let individual distributions figure out what they want -->
|
2015-06-03 04:39:31 -04:00
|
|
|
<dependencies>
|
|
|
|
<dependency>
|
|
|
|
<groupId>com.carrotsearch.randomizedtesting</groupId>
|
|
|
|
<artifactId>randomizedtesting-runner</artifactId>
|
|
|
|
<scope>test</scope>
|
|
|
|
</dependency>
|
|
|
|
|
2015-07-29 15:33:29 -04:00
|
|
|
<dependency>
|
|
|
|
<groupId>org.hamcrest</groupId>
|
|
|
|
<artifactId>hamcrest-all</artifactId>
|
|
|
|
<scope>test</scope>
|
|
|
|
</dependency>
|
|
|
|
|
|
|
|
<dependency>
|
|
|
|
<groupId>org.apache.lucene</groupId>
|
|
|
|
<artifactId>lucene-test-framework</artifactId>
|
|
|
|
<scope>test</scope>
|
|
|
|
</dependency>
|
|
|
|
|
|
|
|
<dependency>
|
|
|
|
<groupId>org.elasticsearch</groupId>
|
|
|
|
<artifactId>elasticsearch</artifactId>
|
|
|
|
<scope>test</scope>
|
|
|
|
<type>test-jar</type>
|
|
|
|
</dependency>
|
|
|
|
|
|
|
|
<dependency>
|
|
|
|
<groupId>org.apache.httpcomponents</groupId>
|
|
|
|
<artifactId>httpclient</artifactId>
|
|
|
|
<scope>test</scope>
|
|
|
|
</dependency>
|
[build] remove shaded elasticsearch version
The shaded version of elasticsearch was built at the very beginning to avoid dependency conflicts in a specific case where:
* People use elasticsearch from Java
* People needs to embed elasticsearch jar within their own application (as it's today the only way to get a `TransportClient`)
* People also embed in their application another (most of the time older) version of dependency we are using for elasticsearch, such as: Guava, Joda, Jackson...
This conflict issue can be solved within the projects themselves by either upgrade the dependency version and use the one provided by elasticsearch or by shading elasticsearch project and relocating some conflicting packages.
Example
-------
As an example, let's say you want to use within your project `Joda 2.1` but elasticsearch `2.0.0-beta1` provides `Joda 2.8`.
Let's say you also want to run all that with shield plugin.
Create a new maven project or module with:
```xml
<groupId>fr.pilato.elasticsearch.test</groupId>
<artifactId>es-shaded</artifactId>
<version>1.0-SNAPSHOT</version>
<properties>
<elasticsearch.version>2.0.0-beta1</elasticsearch.version>
</properties>
<dependencies>
<dependency>
<groupId>org.elasticsearch</groupId>
<artifactId>elasticsearch</artifactId>
<version>${elasticsearch.version}</version>
</dependency>
<dependency>
<groupId>org.elasticsearch.plugin</groupId>
<artifactId>shield</artifactId>
<version>${elasticsearch.version}</version>
</dependency>
</dependencies>
```
And now shade and relocate all packages which conflicts with your own application:
```xml
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.4.1</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<relocations>
<relocation>
<pattern>org.joda</pattern>
<shadedPattern>fr.pilato.thirdparty.joda</shadedPattern>
</relocation>
</relocations>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
```
You can create now a shaded version of elasticsearch + shield by running `mvn clean install`.
In your project, you can now depend on:
```xml
<dependency>
<groupId>fr.pilato.elasticsearch.test</groupId>
<artifactId>es-shaded</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
<version>2.1</version>
</dependency>
```
Build then your TransportClient as usual:
```java
TransportClient client = TransportClient.builder()
.settings(Settings.builder()
.put("path.home", ".")
.put("shield.user", "username:password")
.put("plugin.types", "org.elasticsearch.shield.ShieldPlugin")
)
.build();
client.addTransportAddress(new InetSocketTransportAddress(new InetSocketAddress("localhost", 9300)));
// Index some data
client.prepareIndex("test", "doc", "1").setSource("foo", "bar").setRefresh(true).get();
SearchResponse searchResponse = client.prepareSearch("test").get();
```
If you want to use your own version of Joda, then import for example `org.joda.time.DateTime`. If you want to access to the shaded version (not recommended though), import `fr.pilato.thirdparty.joda.time.DateTime`.
You can run a simple test to make sure that both classes can live together within the same JVM:
```java
CodeSource codeSource = new org.joda.time.DateTime().getClass().getProtectionDomain().getCodeSource();
System.out.println("unshaded = " + codeSource);
codeSource = new fr.pilato.thirdparty.joda.time.DateTime().getClass().getProtectionDomain().getCodeSource();
System.out.println("shaded = " + codeSource);
```
It will print:
```
unshaded = (file:/path/to/joda-time-2.1.jar <no signer certificates>)
shaded = (file:/path/to/es-shaded-1.0-SNAPSHOT.jar <no signer certificates>)
```
This PR also removes fully-loaded module.
By the way, the project can now build with Maven 3.3.3 so we can relax a bit our maven policy.
2015-09-01 12:54:52 -04:00
|
|
|
|
|
|
|
<!-- Embedded components in any distribution -->
|
|
|
|
<dependency>
|
|
|
|
<groupId>org.elasticsearch</groupId>
|
|
|
|
<artifactId>elasticsearch</artifactId>
|
|
|
|
</dependency>
|
|
|
|
|
|
|
|
<dependency>
|
|
|
|
<groupId>com.spatial4j</groupId>
|
|
|
|
<artifactId>spatial4j</artifactId>
|
|
|
|
</dependency>
|
|
|
|
|
|
|
|
<dependency>
|
|
|
|
<groupId>com.vividsolutions</groupId>
|
|
|
|
<artifactId>jts</artifactId>
|
|
|
|
</dependency>
|
|
|
|
|
|
|
|
<!-- needed for templating -->
|
|
|
|
<dependency>
|
|
|
|
<groupId>com.github.spullara.mustache.java</groupId>
|
|
|
|
<artifactId>compiler</artifactId>
|
|
|
|
</dependency>
|
|
|
|
|
|
|
|
<dependency>
|
|
|
|
<groupId>log4j</groupId>
|
|
|
|
<artifactId>log4j</artifactId>
|
|
|
|
</dependency>
|
|
|
|
|
|
|
|
<dependency>
|
|
|
|
<groupId>log4j</groupId>
|
|
|
|
<artifactId>apache-log4j-extras</artifactId>
|
|
|
|
</dependency>
|
|
|
|
|
|
|
|
<!-- we intentionally do not want slf4j in the distro by default, we use log4j
|
|
|
|
<dependency>
|
|
|
|
<groupId>org.slf4j</groupId>
|
|
|
|
<artifactId>slf4j-api</artifactId>
|
|
|
|
</dependency>
|
|
|
|
-->
|
|
|
|
|
|
|
|
<dependency>
|
|
|
|
<groupId>net.java.dev.jna</groupId>
|
|
|
|
<artifactId>jna</artifactId>
|
|
|
|
</dependency>
|
2015-06-03 04:39:31 -04:00
|
|
|
</dependencies>
|
|
|
|
|
|
|
|
<build>
|
|
|
|
<plugins>
|
|
|
|
<!-- We copy libs for deb and rpm -->
|
|
|
|
<plugin>
|
|
|
|
<groupId>org.apache.maven.plugins</groupId>
|
|
|
|
<artifactId>maven-dependency-plugin</artifactId>
|
|
|
|
<executions>
|
|
|
|
<execution>
|
|
|
|
<phase>prepare-package</phase>
|
|
|
|
<goals>
|
|
|
|
<goal>copy-dependencies</goal>
|
|
|
|
</goals>
|
|
|
|
<configuration>
|
|
|
|
<outputDirectory>${project.build.directory}/lib</outputDirectory>
|
|
|
|
<includeScope>runtime</includeScope>
|
|
|
|
</configuration>
|
|
|
|
</execution>
|
|
|
|
</executions>
|
|
|
|
</plugin>
|
2015-08-21 16:34:47 -04:00
|
|
|
<plugin>
|
|
|
|
<groupId>org.apache.maven.plugins</groupId>
|
|
|
|
<artifactId>maven-eclipse-plugin</artifactId>
|
|
|
|
<configuration>
|
|
|
|
<!-- Many of the modules in this build have the artifactId "elasticsearch"
|
|
|
|
which break importing into Eclipse without this. -->
|
|
|
|
<projectNameTemplate>[groupId].[artifactId]</projectNameTemplate>
|
|
|
|
</configuration>
|
|
|
|
</plugin>
|
2015-06-03 04:39:31 -04:00
|
|
|
</plugins>
|
|
|
|
|
|
|
|
<pluginManagement>
|
|
|
|
<plugins>
|
|
|
|
<plugin>
|
|
|
|
<groupId>org.apache.maven.plugins</groupId>
|
|
|
|
<artifactId>maven-antrun-plugin</artifactId>
|
2015-08-04 07:54:55 -04:00
|
|
|
<!-- checks integration test scratch area (where we extract the distribution) -->
|
2015-06-03 04:39:31 -04:00
|
|
|
</plugin>
|
|
|
|
<plugin>
|
|
|
|
<groupId>org.apache.maven.plugins</groupId>
|
|
|
|
<artifactId>maven-resources-plugin</artifactId>
|
|
|
|
<executions>
|
|
|
|
<execution>
|
|
|
|
<id>copy-resources</id>
|
|
|
|
<phase>prepare-package</phase>
|
|
|
|
<goals>
|
|
|
|
<goal>copy-resources</goal>
|
|
|
|
</goals>
|
|
|
|
<configuration>
|
|
|
|
<outputDirectory>${project.build.directory}/bin</outputDirectory>
|
|
|
|
<resources>
|
|
|
|
<resource>
|
|
|
|
<directory>${project.basedir}/../src/main/resources/bin</directory>
|
|
|
|
<filtering>true</filtering>
|
|
|
|
<excludes>
|
|
|
|
<exclude>*.exe</exclude>
|
|
|
|
</excludes>
|
|
|
|
</resource>
|
|
|
|
<resource>
|
|
|
|
<directory>${project.basedir}/../src/main/resources/bin</directory>
|
|
|
|
<filtering>false</filtering>
|
|
|
|
<includes>
|
|
|
|
<include>*.exe</include>
|
|
|
|
</includes>
|
|
|
|
</resource>
|
|
|
|
</resources>
|
|
|
|
</configuration>
|
|
|
|
</execution>
|
|
|
|
</executions>
|
|
|
|
</plugin>
|
2015-08-04 06:30:39 -04:00
|
|
|
<plugin>
|
|
|
|
<groupId>org.apache.maven.plugins</groupId>
|
|
|
|
<artifactId>maven-jar-plugin</artifactId>
|
|
|
|
<configuration>
|
|
|
|
<!-- distribution modules don't provide any jar. No need to upload empty jars to maven central -->
|
|
|
|
<skipIfEmpty>true</skipIfEmpty>
|
|
|
|
</configuration>
|
|
|
|
</plugin>
|
2015-08-03 09:43:11 -04:00
|
|
|
<plugin>
|
|
|
|
<groupId>com.carrotsearch.randomizedtesting</groupId>
|
|
|
|
<artifactId>junit4-maven-plugin</artifactId>
|
|
|
|
<executions>
|
|
|
|
<execution>
|
|
|
|
<id>integ-tests</id>
|
|
|
|
<configuration>
|
|
|
|
<!-- currently only 1 cpu works, because integ tests don't make "unique" test directories? -->
|
|
|
|
<parallelism>1</parallelism>
|
|
|
|
<systemProperties>
|
|
|
|
<!-- use external cluster -->
|
2015-08-17 15:37:07 -04:00
|
|
|
<tests.cluster>localhost:${integ.transport.port}</tests.cluster>
|
2015-08-03 09:43:11 -04:00
|
|
|
</systemProperties>
|
|
|
|
</configuration>
|
|
|
|
</execution>
|
|
|
|
</executions>
|
|
|
|
</plugin>
|
2015-06-03 04:39:31 -04:00
|
|
|
</plugins>
|
|
|
|
</pluginManagement>
|
|
|
|
</build>
|
|
|
|
|
|
|
|
<modules>
|
|
|
|
<module>tar</module>
|
|
|
|
<module>zip</module>
|
|
|
|
<module>deb</module>
|
|
|
|
</modules>
|
|
|
|
|
|
|
|
<profiles>
|
2015-08-19 09:37:28 -04:00
|
|
|
<!--
|
|
|
|
We include automatically RPM module when it's available in common locations.
|
|
|
|
If your rpmbuild is in another location (but in path), run maven with rpm profile:
|
|
|
|
mvn deploy -Prpm
|
|
|
|
-->
|
2015-06-03 04:39:31 -04:00
|
|
|
<profile>
|
|
|
|
<id>macos_brew</id>
|
|
|
|
<activation>
|
|
|
|
<file>
|
|
|
|
<!-- Folks having /usr/local/bin/rpmbuild available will be able to build the rpm module -->
|
|
|
|
<exists>/usr/local/bin/rpmbuild</exists>
|
|
|
|
</file>
|
|
|
|
</activation>
|
|
|
|
<modules>
|
|
|
|
<module>rpm</module>
|
|
|
|
</modules>
|
|
|
|
</profile>
|
|
|
|
|
|
|
|
<profile>
|
|
|
|
<id>rpm</id>
|
|
|
|
<activation>
|
|
|
|
<file>
|
|
|
|
<!-- Folks having /usr/bin/rpmbuild available will be able to build the rpm module -->
|
2015-08-19 09:37:28 -04:00
|
|
|
<exists>/usr/bin/rpmbuild</exists>
|
2015-06-03 04:39:31 -04:00
|
|
|
</file>
|
|
|
|
</activation>
|
|
|
|
<modules>
|
|
|
|
<module>rpm</module>
|
|
|
|
</modules>
|
|
|
|
</profile>
|
|
|
|
</profiles>
|
|
|
|
|
|
|
|
</project>
|