diff --git a/README.md b/README.md index 288bf76..6c29983 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,13 @@ Thanks the great projects: > Package `com.hankcs.lucene` copy from [hanlp-lucene-plugin](https://github.com/hankcs/hanlp-lucene-plugin) + +# Issue + +Can't use custom dictionary in JDK9. So change `targetCompatibility` to 1.8. + +All published releases had build on JDK9. + # Build and Install ## Install lib diff --git a/build.gradle b/build.gradle index 7fd892c..990e8ce 100644 --- a/build.gradle +++ b/build.gradle @@ -29,8 +29,8 @@ apply plugin: 'java' apply plugin: 'idea' apply plugin: 'elasticsearch.esplugin' -sourceCompatibility = JavaVersion.VERSION_1_9 -targetCompatibility = JavaVersion.VERSION_1_9 +sourceCompatibility = JavaVersion.VERSION_1_8 +targetCompatibility = JavaVersion.VERSION_1_8 licenseFile = rootProject.file('LICENSE.txt') noticeFile = rootProject.file('NOTICE.txt') diff --git a/src/main/plugin-metadata/plugin-security.policy b/src/main/plugin-metadata/plugin-security.policy index 639f6bf..0fe34d7 100644 --- a/src/main/plugin-metadata/plugin-security.policy +++ b/src/main/plugin-metadata/plugin-security.policy @@ -1,31 +1,29 @@ grant { - // HanLP data directories permission java.io.FilePermission "<>", "read,write"; - - // needed because of problems in unbound LDAP library permission java.util.PropertyPermission "*", "read,write"; - - // needed to set expert SSL options, etc permission java.lang.RuntimePermission "setFactory"; - permission javax.net.ssl.SSLPermission "setHostnameVerifier"; - - // needed when sending emails for javax.activation - // otherwise a classnotfound exception is thrown due to trying - // to load the class with the application class loader permission java.lang.RuntimePermission "setContextClassLoader"; permission java.lang.RuntimePermission "getClassLoader"; - // TODO: remove use of this jar as soon as possible!!!! permission java.lang.RuntimePermission "accessClassInPackage.com.sun.activation.registries"; - - // bouncy castle + permission java.lang.RuntimePermission "accessClassInPackage.sun.misc"; + permission java.lang.RuntimePermission "accessClassInPackage.sun.reflect"; + permission java.lang.RuntimePermission "reflectionFactoryAccess"; + permission java.lang.RuntimePermission "accessDeclaredMembers"; + permission java.lang.RuntimePermission "accessClassInPackage.sun.jdbc.odbc"; permission java.security.SecurityPermission "putProviderProperty.BC"; - - // needed for x-pack security extension permission java.security.SecurityPermission "createPolicy.JavaPolicy"; permission java.security.SecurityPermission "getPolicy"; permission java.security.SecurityPermission "setPolicy"; - - // Netty SelectorUtil wants to change this, because of https://bugs.openjdk.java.net/browse/JDK-6427854 - // the bug says it only happened rarely, and that its fixed, but apparently it still happens rarely! permission java.util.PropertyPermission "sun.nio.ch.bugLevel", "write"; + permission java.util.PropertyPermission "*","read,write"; + permission java.util.PropertyPermission "file.encoding", "read"; + permission java.util.PropertyPermission "user.dir ", "read "; + permission java.util.PropertyPermission "user.home ", "read "; + permission java.util.PropertyPermission "java.home ", "read "; + permission java.util.PropertyPermission "java.class.path ", "read "; + permission java.lang.reflect.ReflectPermission "suppressAccessChecks"; + permission javax.net.ssl.SSLPermission "setHostnameVerifier"; + permission org.elasticsearch.script.ClassPermission "com.hankcs.*"; + permission org.elasticsearch.script.ClassPermission "org.elasticsearch.*"; + /// permission java.lang.RuntimePermission "accessClassInPackage.jdk.internal.ref"; };