Skip to content

Commit

Permalink
Switch to elasticsearch-plugin as a parent project
Browse files Browse the repository at this point in the history
Changes related to elastic/elasticsearch#12367
  • Loading branch information
imotov committed Jul 28, 2015
1 parent 1a1ef6d commit 2527118
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 91 deletions.
101 changes: 11 additions & 90 deletions pom.xml
Expand Up @@ -7,7 +7,6 @@
<groupId>org.elasticsearch</groupId>
<artifactId>elasticsearch-analysis-morphology</artifactId>
<version>2.0.0-beta1-SNAPSHOT</version>
<packaging>jar</packaging>
<description>Russian Morphology for ElasticSearch</description>
<inceptionYear>2012</inceptionYear>
<licenses>
Expand All @@ -25,14 +24,22 @@
</scm>

<parent>
<groupId>org.elasticsearch</groupId>
<artifactId>elasticsearch-parent</artifactId>
<groupId>org.elasticsearch.plugin</groupId>
<artifactId>elasticsearch-plugin</artifactId>
<version>2.0.0-beta1-SNAPSHOT</version>
</parent>


<properties>
<russian.morphology.version>1.1</russian.morphology.version>
<elasticsearch.plugin.classname>org.elasticsearch.plugin.analysis.morphology.AnalysisMorphologyPlugin</elasticsearch.plugin.classname>

<elasticsearch.license.header>${project.basedir}/dev-tools/src/main/resources/license-check/license_header.txt</elasticsearch.license.header>
<elasticsearch.license.headerDefinition>${project.basedir}/dev-tools/src/main/resources/license-check/license_header_definition.xml</elasticsearch.license.headerDefinition>

<tests.ifNoTests>warn</tests.ifNoTests>
<tests.rest.suite>analysis-morphology</tests.rest.suite>
<tests.rest.load_packaged>false</tests.rest.load_packaged>
</properties>

<repositories>
Expand Down Expand Up @@ -69,115 +76,29 @@
</distributionManagement>

<dependencies>
<dependency>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-test-framework</artifactId>
</dependency>

<dependency>
<groupId>org.elasticsearch</groupId>
<artifactId>elasticsearch</artifactId>
</dependency>

<dependency>
<groupId>org.elasticsearch</groupId>
<artifactId>elasticsearch</artifactId>
<scope>test</scope>
<type>test-jar</type>
</dependency>

<dependency>
<groupId>org.apache.lucene.morphology</groupId>
<artifactId>russian</artifactId>
<version>${russian.morphology.version}</version>
<scope>compile</scope>
</dependency>

<dependency>
<groupId>org.apache.lucene.morphology</groupId>
<artifactId>english</artifactId>
<version>${russian.morphology.version}</version>
<scope>compile</scope>
</dependency>

<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.16</version>
<scope>runtime</scope>
</dependency>

<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-all</artifactId>
</dependency>

<dependency>
<groupId>com.carrotsearch.randomizedtesting</groupId>
<artifactId>randomizedtesting-runner</artifactId>
</dependency>

</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.11</version>
<configuration>
<includes>
<include>**/*Tests.java</include>
</includes>
</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>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.3</version>
<configuration>
<appendAssemblyId>false</appendAssemblyId>
<outputDirectory>${project.build.directory}/releases/</outputDirectory>
<descriptors>
<descriptor>${basedir}/src/main/assemblies/plugin.xml</descriptor>
<descriptor>${project.basedir}/src/main/assemblies/plugin.xml</descriptor>
</descriptors>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.mycila</groupId>
<artifactId>license-maven-plugin</artifactId>
<configuration>
<header>${project.basedir}/dev-tools/src/main/resources/license-check/license_header.txt</header>
</configuration>
</plugin>
</plugins>
</build>
Expand Down
13 changes: 13 additions & 0 deletions rest-api-spec/test/analysis-morphology/10_analyze.yaml
@@ -0,0 +1,13 @@
# Basic integration tests for the morphology analysis plugin
#
---
"Russian analyzer and filter":
- do:
indices.analyze:
tokenizer: standard
filters: ["lowercase", "russian_morphology"]
text: Японские автомобили
- length: { tokens: 2 }
- match: { tokens.0.token: японский }
- match: { tokens.1.token: автомобиль }

7 changes: 7 additions & 0 deletions src/main/assemblies/plugin.xml
Expand Up @@ -5,6 +5,13 @@
<format>zip</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<files>
<file>
<source>${elasticsearch.tools.directory}/plugin-metadata/plugin-descriptor.properties</source>
<outputDirectory></outputDirectory>
<filtered>true</filtered>
</file>
</files>
<dependencySets>
<dependencySet>
<outputDirectory>/</outputDirectory>
Expand Down
1 change: 0 additions & 1 deletion src/main/resources/es-plugin.properties

This file was deleted.

@@ -0,0 +1,38 @@
/*
* Copyright 2012 Igor Motov
*
* Licensed 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.
*/

package org.elasticsearch.plugin.analysis.morphology;

import com.carrotsearch.randomizedtesting.annotations.Name;
import com.carrotsearch.randomizedtesting.annotations.ParametersFactory;
import org.elasticsearch.test.rest.ElasticsearchRestTestCase;
import org.elasticsearch.test.rest.RestTestCandidate;
import org.elasticsearch.test.rest.parser.RestTestParseException;

import java.io.IOException;

public class AnalysisMorphologyRestIT extends ElasticsearchRestTestCase {

public AnalysisMorphologyRestIT(@Name("yaml") RestTestCandidate testCandidate) {
super(testCandidate);
}

@ParametersFactory
public static Iterable<Object[]> parameters() throws IOException, RestTestParseException {
return ElasticsearchRestTestCase.createParameters(0, 1);
}
}

0 comments on commit 2527118

Please sign in to comment.