Depend on elasticsearch-parent
To simplify plugins maintenance and provide more value in the future, we are starting to build an `elasticsearch-parent` project. This commit is the first step for this plugin to depend on this new `pom` maven project.
This commit is contained in:
parent
c338ae0dbe
commit
33c9828385
|
@ -8,5 +8,6 @@
|
|||
/.project
|
||||
/.settings
|
||||
/.classpath
|
||||
.local-execution-hints.log
|
||||
/plugin_tools
|
||||
/.local-execution-hints.log
|
||||
/.local-*-execution-hints.log
|
||||
|
|
|
@ -0,0 +1,54 @@
|
|||
/*
|
||||
* Licensed to Elasticsearch under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch 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.
|
||||
*/
|
||||
|
||||
// Policy file to prevent tests from writing outside the test sandbox directory
|
||||
// PLEASE NOTE: You may need to enable other permissions when new tests are added,
|
||||
// everything not allowed here is forbidden!
|
||||
|
||||
grant {
|
||||
// permissions for file access, write access only to sandbox:
|
||||
permission java.io.FilePermission "<<ALL FILES>>", "read,execute";
|
||||
permission java.io.FilePermission "${junit4.childvm.cwd}", "read,execute,write";
|
||||
permission java.io.FilePermission "${junit4.childvm.cwd}${/}-", "read,execute,write,delete";
|
||||
permission java.io.FilePermission "${junit4.tempDir}${/}*", "read,execute,write,delete";
|
||||
permission groovy.security.GroovyCodeSourcePermission "/groovy/script";
|
||||
|
||||
// Allow connecting to the internet anywhere
|
||||
permission java.net.SocketPermission "*", "accept,listen,connect,resolve";
|
||||
|
||||
// Basic permissions needed for Lucene / Elasticsearch to work:
|
||||
permission java.util.PropertyPermission "*", "read,write";
|
||||
permission java.lang.reflect.ReflectPermission "*";
|
||||
permission java.lang.RuntimePermission "*";
|
||||
|
||||
// These two *have* to be spelled out a separate
|
||||
permission java.lang.management.ManagementPermission "control";
|
||||
permission java.lang.management.ManagementPermission "monitor";
|
||||
|
||||
permission java.net.NetPermission "*";
|
||||
permission java.util.logging.LoggingPermission "control";
|
||||
permission javax.management.MBeanPermission "*", "*";
|
||||
permission javax.management.MBeanServerPermission "*";
|
||||
permission javax.management.MBeanTrustPermission "*";
|
||||
|
||||
// Needed for some things in DNS caching in the JVM
|
||||
permission java.security.SecurityPermission "getProperty.networkaddress.cache.ttl";
|
||||
permission java.security.SecurityPermission "getProperty.networkaddress.cache.negative.ttl";
|
||||
|
||||
};
|
181
pom.xml
181
pom.xml
|
@ -3,6 +3,13 @@
|
|||
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>
|
||||
<artifactId>elasticsearch-parent</artifactId>
|
||||
<version>2.0.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<groupId>org.elasticsearch</groupId>
|
||||
<artifactId>elasticsearch-mapper-attachments</artifactId>
|
||||
<version>3.0.0-SNAPSHOT</version>
|
||||
|
@ -24,85 +31,38 @@
|
|||
<url>http://github.com/elasticsearch/elasticsearch-mapper-attachments</url>
|
||||
</scm>
|
||||
|
||||
<parent>
|
||||
<groupId>org.sonatype.oss</groupId>
|
||||
<artifactId>oss-parent</artifactId>
|
||||
<version>7</version>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
<elasticsearch.version>2.0.0-SNAPSHOT</elasticsearch.version>
|
||||
<lucene.version>5.0.0</lucene.version>
|
||||
<lucene.maven.version>5.0.0-snapshot-1642891</lucene.maven.version>
|
||||
<poi.version>3.10.1</poi.version>
|
||||
<tests.jvms>1</tests.jvms>
|
||||
<tests.shuffle>true</tests.shuffle>
|
||||
<tests.output>onerror</tests.output>
|
||||
<tests.client.ratio></tests.client.ratio>
|
||||
<es.logger.level>INFO</es.logger.level>
|
||||
</properties>
|
||||
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>Lucene snapshots</id>
|
||||
<url>https://download.elasticsearch.org/lucenesnapshots/1642891/</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>sonatype</id>
|
||||
<url>http://oss.sonatype.org/content/repositories/releases/</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>codehausSnapshots</id>
|
||||
<name>Codehaus Snapshots</name>
|
||||
<releases>
|
||||
<enabled>true</enabled>
|
||||
<updatePolicy>always</updatePolicy>
|
||||
<checksumPolicy>warn</checksumPolicy>
|
||||
</releases>
|
||||
<snapshots>
|
||||
<enabled>true</enabled>
|
||||
<updatePolicy>always</updatePolicy>
|
||||
<checksumPolicy>fail</checksumPolicy>
|
||||
</snapshots>
|
||||
<url>http://oss.sonatype.org/content/repositories/releases/</url>
|
||||
<layout>default</layout>
|
||||
</repository>
|
||||
</repositories>
|
||||
|
||||
<dependencies>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.hamcrest</groupId>
|
||||
<artifactId>hamcrest-all</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.carrotsearch.randomizedtesting</groupId>
|
||||
<artifactId>randomizedtesting-runner</artifactId>
|
||||
<version>2.1.10</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.lucene</groupId>
|
||||
<artifactId>lucene-test-framework</artifactId>
|
||||
<version>${lucene.maven.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.elasticsearch</groupId>
|
||||
<artifactId>elasticsearch</artifactId>
|
||||
<version>${elasticsearch.version}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- Apache POI -->
|
||||
<dependency>
|
||||
<groupId>org.apache.poi</groupId>
|
||||
<artifactId>poi</artifactId>
|
||||
<version>${poi.version}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.poi</groupId>
|
||||
<artifactId>poi-ooxml</artifactId>
|
||||
<version>${poi.version}</version>
|
||||
<scope>compile</scope>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>stax</groupId>
|
||||
|
@ -118,20 +78,18 @@
|
|||
<groupId>org.apache.poi</groupId>
|
||||
<artifactId>poi-ooxml-schemas</artifactId>
|
||||
<version>${poi.version}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.poi</groupId>
|
||||
<artifactId>poi-scratchpad</artifactId>
|
||||
<version>${poi.version}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- Tika -->
|
||||
<dependency>
|
||||
<groupId>org.apache.tika</groupId>
|
||||
<artifactId>tika-parsers</artifactId>
|
||||
<version>1.5</version>
|
||||
<scope>compile</scope>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>edu.ucar</groupId>
|
||||
|
@ -143,25 +101,12 @@
|
|||
<dependency>
|
||||
<groupId>log4j</groupId>
|
||||
<artifactId>log4j</artifactId>
|
||||
<version>1.2.17</version>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.elasticsearch</groupId>
|
||||
<artifactId>elasticsearch</artifactId>
|
||||
<version>${elasticsearch.version}</version>
|
||||
<type>test-jar</type>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.hamcrest</groupId>
|
||||
<artifactId>hamcrest-all</artifactId>
|
||||
<version>1.3</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
@ -178,122 +123,24 @@
|
|||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>2.3.2</version>
|
||||
<configuration>
|
||||
<source>1.7</source>
|
||||
<target>1.7</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>com.carrotsearch.randomizedtesting</groupId>
|
||||
<artifactId>junit4-maven-plugin</artifactId>
|
||||
<version>2.1.2</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>tests</id>
|
||||
<phase>test</phase>
|
||||
<goals>
|
||||
<goal>junit4</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<heartbeat>20</heartbeat>
|
||||
<jvmOutputAction>pipe,warn</jvmOutputAction>
|
||||
<leaveTemporary>true</leaveTemporary>
|
||||
<listeners>
|
||||
<report-ant-xml mavenExtensions="true"
|
||||
dir="${project.build.directory}/surefire-reports"/>
|
||||
<report-text
|
||||
showThrowable="true"
|
||||
showStackTraces="true"
|
||||
showOutput="${tests.output}"
|
||||
showStatusOk="false"
|
||||
showStatusError="true"
|
||||
showStatusFailure="true"
|
||||
showStatusIgnored="true"
|
||||
showSuiteSummary="true"
|
||||
timestamps="false"/>
|
||||
<report-execution-times file="${basedir}/.local-execution-hints.log"/>
|
||||
</listeners>
|
||||
<assertions>
|
||||
<enable/>
|
||||
</assertions>
|
||||
<parallelism>${tests.jvms}</parallelism>
|
||||
<balancers>
|
||||
<execution-times>
|
||||
<fileset dir="${basedir}" includes=".local-execution-hints.log"/>
|
||||
</execution-times>
|
||||
</balancers>
|
||||
<includes>
|
||||
<include>**/*Tests.class</include>
|
||||
<include>**/*Test.class</include>
|
||||
</includes>
|
||||
<excludes>
|
||||
<exclude>**/Abstract*.class</exclude>
|
||||
<exclude>**/*StressTest.class</exclude>
|
||||
<exclude>**/*StandaloneTest*.class</exclude>
|
||||
</excludes>
|
||||
<jvmArgs>
|
||||
<param>-Xmx512m</param>
|
||||
<param>-XX:MaxDirectMemorySize=512m</param>
|
||||
<param>-Des.logger.prefix=</param>
|
||||
</jvmArgs>
|
||||
<shuffleOnSlave>${tests.shuffle}</shuffleOnSlave>
|
||||
<sysouts>${tests.verbose}</sysouts>
|
||||
<seed>${tests.seed}</seed>
|
||||
<haltOnFailure>${tests.failfast}</haltOnFailure>
|
||||
<systemProperties>
|
||||
<!-- RandomizedTesting library system properties -->
|
||||
<tests.iters>${tests.iters}</tests.iters>
|
||||
<tests.maxfailures>${tests.maxfailures}</tests.maxfailures>
|
||||
<tests.failfast>${tests.failfast}</tests.failfast>
|
||||
<tests.class>${tests.class}</tests.class>
|
||||
<tests.method>${tests.method}</tests.method>
|
||||
<tests.nightly>${tests.nightly}</tests.nightly>
|
||||
<tests.badapples>${tests.badapples}</tests.badapples>
|
||||
<tests.weekly>${tests.weekly}</tests.weekly>
|
||||
<tests.slow>${tests.slow}</tests.slow>
|
||||
<tests.awaitsfix>${tests.awaitsfix}</tests.awaitsfix>
|
||||
<tests.slow>${tests.slow}</tests.slow>
|
||||
<tests.timeoutSuite>${tests.timeoutSuite}</tests.timeoutSuite>
|
||||
<tests.showSuccess>${tests.showSuccess}</tests.showSuccess>
|
||||
<tests.integration>${tests.integration}</tests.integration>
|
||||
<tests.cluster_seed>${tests.cluster_seed}</tests.cluster_seed>
|
||||
<tests.client.ratio>${tests.client.ratio}</tests.client.ratio>
|
||||
<es.node.local>${env.ES_TEST_LOCAL}</es.node.local>
|
||||
<es.node.mode>${es.node.mode}</es.node.mode>
|
||||
<es.logger.level>${es.logger.level}</es.logger.level>
|
||||
<java.awt.headless>true</java.awt.headless>
|
||||
</systemProperties>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<!-- we skip surefire to work with randomized testing above -->
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>2.15</version>
|
||||
<configuration>
|
||||
<skipTests>true</skipTests>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-source-plugin</artifactId>
|
||||
<version>2.1.2</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>attach-sources</id>
|
||||
<goals>
|
||||
<goal>jar</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
<version>2.3</version>
|
||||
<configuration>
|
||||
<appendAssemblyId>false</appendAssemblyId>
|
||||
<outputDirectory>${project.build.directory}/releases/</outputDirectory>
|
||||
|
|
|
@ -12,7 +12,6 @@
|
|||
<useTransitiveFiltering>true</useTransitiveFiltering>
|
||||
<excludes>
|
||||
<exclude>org.elasticsearch:elasticsearch</exclude>
|
||||
<exclude>org.slf4j:slf4j-api</exclude>
|
||||
</excludes>
|
||||
</dependencySet>
|
||||
<dependencySet>
|
||||
|
@ -26,9 +25,6 @@
|
|||
<include>org.apache.poi:poi-ooxml-schemas</include>
|
||||
<include>org.apache.poi:poi-scratchpad</include>
|
||||
</includes>
|
||||
<excludes>
|
||||
<exclude>org.slf4j:slf4j-api</exclude>
|
||||
</excludes>
|
||||
</dependencySet>
|
||||
</dependencySets>
|
||||
</assembly>
|
||||
|
|
|
@ -56,29 +56,29 @@ import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder;
|
|||
* BASE64 encoded binary
|
||||
*
|
||||
* Example:
|
||||
* StandaloneTest BASE64Text
|
||||
* StandaloneTest -u /tmp/mydoc.pdf
|
||||
* StandaloneTest -u /tmp/mydoc.pdf --size 1000000
|
||||
* StandaloneRunner BASE64Text
|
||||
* StandaloneRunner -u /tmp/mydoc.pdf
|
||||
* StandaloneRunner -u /tmp/mydoc.pdf --size 1000000
|
||||
*/
|
||||
public class StandaloneTest extends CliTool {
|
||||
public class StandaloneRunner extends CliTool {
|
||||
|
||||
private static final CliToolConfig CONFIG = CliToolConfig.config("tika", StandaloneTest.class)
|
||||
.cmds(TikaTest.CMD)
|
||||
private static final CliToolConfig CONFIG = CliToolConfig.config("tika", StandaloneRunner.class)
|
||||
.cmds(TikaRunner.CMD)
|
||||
.build();
|
||||
|
||||
static class TikaTest extends Command {
|
||||
static class TikaRunner extends Command {
|
||||
private static final String NAME = "tika";
|
||||
private final String url;
|
||||
private final Integer size;
|
||||
private final String base64text;
|
||||
private final DocumentMapper docMapper;
|
||||
|
||||
private static final CliToolConfig.Cmd CMD = cmd(NAME, TikaTest.class)
|
||||
private static final CliToolConfig.Cmd CMD = cmd(NAME, TikaRunner.class)
|
||||
.options(option("u", "url").required(false).hasArg(false))
|
||||
.options(option("t", "size").required(false).hasArg(false))
|
||||
.build();
|
||||
|
||||
protected TikaTest(Terminal terminal, String url, Integer size, String base64text) throws IOException {
|
||||
protected TikaRunner(Terminal terminal, String url, Integer size, String base64text) throws IOException {
|
||||
super(terminal);
|
||||
this.size = size;
|
||||
this.url = url;
|
||||
|
@ -162,24 +162,24 @@ public class StandaloneTest extends CliTool {
|
|||
return exitCmd(ExitStatus.USAGE, terminal, "url or BASE64 content should be provided. Not both. (type -h for help)");
|
||||
}
|
||||
}
|
||||
return new TikaTest(terminal, url, size, base64text);
|
||||
return new TikaRunner(terminal, url, size, base64text);
|
||||
}
|
||||
}
|
||||
|
||||
public StandaloneTest() {
|
||||
public StandaloneRunner() {
|
||||
super(CONFIG);
|
||||
}
|
||||
|
||||
|
||||
public static void main(String[] args) {
|
||||
StandaloneTest pluginManager = new StandaloneTest();
|
||||
StandaloneRunner pluginManager = new StandaloneRunner();
|
||||
pluginManager.execute(args);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Command parse(String cmdName, CommandLine cli) throws Exception {
|
||||
switch (cmdName.toLowerCase(Locale.ROOT)) {
|
||||
case TikaTest.NAME: return TikaTest.parse(terminal, cli);
|
||||
case TikaRunner.NAME: return TikaRunner.parse(terminal, cli);
|
||||
default:
|
||||
assert false : "can't get here as cmd name is validated before this method is called";
|
||||
return exitCmd(ExitStatus.CODE_ERROR);
|
Loading…
Reference in New Issue