DCausse has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/291846

Change subject: Fix packaging issues
......................................................................

Fix packaging issues

- Added plugin-descriptor.properties.
- Setting direct dep to 2.3.1 for testing I'll try to make the plugin version to
  match elastic version when releasing.
- Fixed javadoc problems causing build failures when using latest oracle jdk
- Changed the plugin name seen by elasticsearch to experimental-highlighter

Change-Id: Ic211c946ca435dc5784ca68fd652bc1a2b195b5f
---
M 
experimental-highlighter-core/src/main/java/org/wikimedia/search/highlighter/experimental/LessThan.java
M 
experimental-highlighter-core/src/main/java/org/wikimedia/search/highlighter/experimental/hit/weight/CachingTermWeigher.java
M 
experimental-highlighter-core/src/main/java/org/wikimedia/search/highlighter/experimental/source/NonMergingMultiSourceExtracter.java
M experimental-highlighter-elasticsearch-plugin/pom.xml
M experimental-highlighter-elasticsearch-plugin/src/main/assemblies/plugin.xml
D 
experimental-highlighter-elasticsearch-plugin/src/main/resources/es-plugin.properties
A 
experimental-highlighter-elasticsearch-plugin/src/main/resources/plugin-metadata/plugin-descriptor.properties
M pom.xml
8 files changed, 36 insertions(+), 14 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/search/highlighter 
refs/changes/46/291846/1

diff --git 
a/experimental-highlighter-core/src/main/java/org/wikimedia/search/highlighter/experimental/LessThan.java
 
b/experimental-highlighter-core/src/main/java/org/wikimedia/search/highlighter/experimental/LessThan.java
index 1913f61..8ba9214 100644
--- 
a/experimental-highlighter-core/src/main/java/org/wikimedia/search/highlighter/experimental/LessThan.java
+++ 
b/experimental-highlighter-core/src/main/java/org/wikimedia/search/highlighter/experimental/LessThan.java
@@ -3,7 +3,7 @@
 import org.wikimedia.search.highlighter.experimental.extern.PriorityQueue;
 
 /**
- * Like Comparator but only determines if a < b.  Useful for working with 
{@link PriorityQueue}
+ * Like Comparator but only determines if a &lt; b.  Useful for working with 
{@link PriorityQueue}
  */
 public interface LessThan<T> {
     boolean lessThan(T a, T b);
diff --git 
a/experimental-highlighter-core/src/main/java/org/wikimedia/search/highlighter/experimental/hit/weight/CachingTermWeigher.java
 
b/experimental-highlighter-core/src/main/java/org/wikimedia/search/highlighter/experimental/hit/weight/CachingTermWeigher.java
index 18f5c0d..f799cb2 100644
--- 
a/experimental-highlighter-core/src/main/java/org/wikimedia/search/highlighter/experimental/hit/weight/CachingTermWeigher.java
+++ 
b/experimental-highlighter-core/src/main/java/org/wikimedia/search/highlighter/experimental/hit/weight/CachingTermWeigher.java
@@ -8,6 +8,8 @@
 /**
  * Caches results from another TermWeigher. Obviously, this is only
  * useful if the wrapped TermWeigher is slow.
+ *
+ * @param <T> the type holding the terms
  */
 public class CachingTermWeigher<T> implements TermWeigher<T> {
     private final Cache<T> cache;
@@ -19,6 +21,7 @@
      * A note for Lucene users: This constructor won't work with BytesRef
      * because it doesn't clone the BytesRef.
      * </p>
+     * @param next the weigher to cache
      */
     public CachingTermWeigher(TermWeigher<T> next) {
         this(new MapCache<T>(new HashMap<T, Float>()), next);
@@ -26,6 +29,8 @@
 
     /**
      * Build with a provided cache.
+     * @param cache the cache backend to use
+     * @param next the term weigher to cache
      */
     public CachingTermWeigher(Cache<T> cache, TermWeigher<T> next) {
         this.cache = cache;
@@ -50,13 +55,13 @@
         /**
          * Get a cached weight if there is one.
          * @param term to lookup
-         * @return if >= 0 then the cached weight, otherwise a signal that the 
weight is not found
+         * @return if ≥ 0 then the cached weight, otherwise a signal that the 
weight is not found
          */
         float get(T term);
         /**
          * Add a weight to the cache.
          * @param term the term
-         * @param weight the weight, will be >= 0
+         * @param weight the weight, will be ≥ 0
          */
         void put(T term, float weight);
     }
diff --git 
a/experimental-highlighter-core/src/main/java/org/wikimedia/search/highlighter/experimental/source/NonMergingMultiSourceExtracter.java
 
b/experimental-highlighter-core/src/main/java/org/wikimedia/search/highlighter/experimental/source/NonMergingMultiSourceExtracter.java
index 18af67f..fe5ecc6 100644
--- 
a/experimental-highlighter-core/src/main/java/org/wikimedia/search/highlighter/experimental/source/NonMergingMultiSourceExtracter.java
+++ 
b/experimental-highlighter-core/src/main/java/org/wikimedia/search/highlighter/experimental/source/NonMergingMultiSourceExtracter.java
@@ -10,8 +10,9 @@
  * at a time. The reasons it can't do more then one extracter at a time are:
  * <ul>
  * <li>Its reasonably common to only ever have to do one at a time
- * <li>Without knowing what <T> is we won't know how to merge it
+ * <li>Without knowing what <i>T</i> is we won't know how to merge it
  * </ul>
+ * @param <T> the type of highlighted framents (in general String)
  */
 public class NonMergingMultiSourceExtracter<T> extends 
AbstractMultiSourceExtracter<T> {
     /**
diff --git a/experimental-highlighter-elasticsearch-plugin/pom.xml 
b/experimental-highlighter-elasticsearch-plugin/pom.xml
index 1edcb4d..bc607d5 100644
--- a/experimental-highlighter-elasticsearch-plugin/pom.xml
+++ b/experimental-highlighter-elasticsearch-plugin/pom.xml
@@ -9,6 +9,10 @@
   <packaging>jar</packaging>
 
   <name>Elasticsearch plugin for experimental highlighter</name>
+  <description>Experimental Highlighter plugin</description>
+  <properties>
+    
<elasticsearch.plugin.name>experimental-highlighter</elasticsearch.plugin.name>
+  </properties>
 
   <dependencies>
     <dependency>
diff --git 
a/experimental-highlighter-elasticsearch-plugin/src/main/assemblies/plugin.xml 
b/experimental-highlighter-elasticsearch-plugin/src/main/assemblies/plugin.xml
index 123fcd0..cb4fb8e 100644
--- 
a/experimental-highlighter-elasticsearch-plugin/src/main/assemblies/plugin.xml
+++ 
b/experimental-highlighter-elasticsearch-plugin/src/main/assemblies/plugin.xml
@@ -16,4 +16,14 @@
             </excludes>
         </dependencySet>
     </dependencySets>
+    <fileSets>
+        <fileSet>
+            <directory>src/main/resources/plugin-metadata</directory>
+            <outputDirectory>/</outputDirectory>
+            <filtered>true</filtered>
+            <includes>
+                <include>plugin-descriptor.properties</include>
+            </includes>
+        </fileSet>
+    </fileSets>
 </assembly>
diff --git 
a/experimental-highlighter-elasticsearch-plugin/src/main/resources/es-plugin.properties
 
b/experimental-highlighter-elasticsearch-plugin/src/main/resources/es-plugin.properties
deleted file mode 100644
index 4b2bf8a..0000000
--- 
a/experimental-highlighter-elasticsearch-plugin/src/main/resources/es-plugin.properties
+++ /dev/null
@@ -1,3 +0,0 @@
-plugin=org.wikimedia.highlighter.experimental.elasticsearch.plugin.ExperimentalHighlighterPlugin
-version=${project.version}
-lucene=${lucene.version}
diff --git 
a/experimental-highlighter-elasticsearch-plugin/src/main/resources/plugin-metadata/plugin-descriptor.properties
 
b/experimental-highlighter-elasticsearch-plugin/src/main/resources/plugin-metadata/plugin-descriptor.properties
new file mode 100644
index 0000000..bc10f10
--- /dev/null
+++ 
b/experimental-highlighter-elasticsearch-plugin/src/main/resources/plugin-metadata/plugin-descriptor.properties
@@ -0,0 +1,7 @@
+name=${elasticsearch.plugin.name}
+description=${project.description}
+version=${project.version}
+jvm=true
+classname=org.wikimedia.highlighter.experimental.elasticsearch.plugin.ExperimentalHighlighterPlugin
+java.version=${maven.compiler.target}
+elasticsearch.version=${elasticsearch.version}
diff --git a/pom.xml b/pom.xml
index 6a14943..e92a6bd 100644
--- a/pom.xml
+++ b/pom.xml
@@ -53,6 +53,8 @@
     <!-- For the Elasticsearch plugin to work this should match the version of 
Lucene that Elasticsearch
       uses. -->
     <lucene.version>5.3.1</lucene.version>
+    <maven.compiler.target>1.7</maven.compiler.target>
+    <maven.compiler.source>1.7</maven.compiler.source>
   </properties>
 
   <build>
@@ -77,11 +79,7 @@
         <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>
+          <version>3.3</version>
         </plugin>
         <plugin>
           <groupId>org.apache.maven.plugins</groupId>
@@ -161,7 +159,7 @@
         <plugin>
           <groupId>org.apache.maven.plugins</groupId>
           <artifactId>maven-javadoc-plugin</artifactId>
-          <version>2.9.1</version>
+          <version>2.10.3</version>
           <executions>
             <execution>
               <id>attach-javadocs</id>
@@ -220,7 +218,7 @@
         <artifactId>forbiddenapis</artifactId>
         <version>1.5</version>
         <configuration>
-          <targetVersion>1.7</targetVersion>
+          <targetVersion>${maven.compiler.target}</targetVersion>
           <failOnMissingClasses>false</failOnMissingClasses> <!-- this is a 
bug in forbidden APIs since 1.5 looks also at annotations -->
           <!-- disallow undocumented classes like sun.misc.Unsafe: -->
           <internalRuntimeForbidden>true</internalRuntimeForbidden>

-- 
To view, visit https://gerrit.wikimedia.org/r/291846
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic211c946ca435dc5784ca68fd652bc1a2b195b5f
Gerrit-PatchSet: 1
Gerrit-Project: search/highlighter
Gerrit-Branch: 2.1
Gerrit-Owner: DCausse <dcau...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to