From f7d24c131cf390fdd11f4eaa797dde41df5600fe Mon Sep 17 00:00:00 2001 From: Jean-Marc Tremeaux Date: Mon, 29 Apr 2019 15:02:43 +0200 Subject: [PATCH] v1.5.0 - Upgrade to Play 1.5.3 - Disable Illegal Access warning (with Java 9+) - Remove DisableDocViewer plugin (already fixed in https://github.com/playframework/play1/issues/1103) --- .travis.yml | 4 +-- CHANGELOG.md | 4 +++ app/controllers/test/RestFunctionalTest.java | 2 +- app/play.plugins | 1 + app/play/plugins/DisableDocViewerPlugin.java | 32 ------------------- .../plugins/DisableIllegalAccessWarning.java | 26 +++++++++++++++ conf/dependencies.yml | 9 +++++- 7 files changed, 42 insertions(+), 36 deletions(-) delete mode 100755 app/play/plugins/DisableDocViewerPlugin.java create mode 100755 app/play/plugins/DisableIllegalAccessWarning.java diff --git a/.travis.yml b/.travis.yml index beed74b..c190147 100755 --- a/.travis.yml +++ b/.travis.yml @@ -2,9 +2,9 @@ sudo: required dist: trusty language: java env: - PLAY_VERSION=1.4.2 + PLAY_VERSION=1.5.3 before_script: - wget http://downloads.typesafe.com/play/${PLAY_VERSION}/play-${PLAY_VERSION}.zip; + wget https://nexus.sismics.com/repository/sismics/play-${PLAY_VERSION}.zip unzip -q play-${PLAY_VERSION}.zip script: if [ "$TRAVIS_BRANCH" == "release" ]; then diff --git a/CHANGELOG.md b/CHANGELOG.md index 126b871..d6f29fe 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,8 @@ ## Change Log +### Version 1.5.0 (2019-04-29) +- Upgrade to Play 1.5.3 +- Disable Illegal Access warning (with Java 9+) +- Remove DisableDocViewer plugin (already fixed in https://github.com/playframework/play1/issues/1103) ### Version 1.4.0 (2019-04-05) - Automate release - Add JSON helper diff --git a/app/controllers/test/RestFunctionalTest.java b/app/controllers/test/RestFunctionalTest.java index 49c72bd..c89ea61 100755 --- a/app/controllers/test/RestFunctionalTest.java +++ b/app/controllers/test/RestFunctionalTest.java @@ -431,7 +431,7 @@ private void onActionCompleted() { @Override public Invoker.InvocationContext getInvocationContext() { - ActionInvoker.resolve(request, response); + ActionInvoker.resolve(request); return new Invoker.InvocationContext(Http.invocationType, request.invokedMethod.getAnnotations(), request.invokedMethod.getDeclaringClass().getAnnotations()); } diff --git a/app/play.plugins b/app/play.plugins index f57867c..af76a44 100755 --- a/app/play.plugins +++ b/app/play.plugins @@ -1,2 +1,3 @@ 510:play.plugins.AppBinder +520:play.plugins.DisableIllegalAccessWarning 530:play.plugins.UTCTimeZonePlugin diff --git a/app/play/plugins/DisableDocViewerPlugin.java b/app/play/plugins/DisableDocViewerPlugin.java deleted file mode 100755 index 6254170..0000000 --- a/app/play/plugins/DisableDocViewerPlugin.java +++ /dev/null @@ -1,32 +0,0 @@ -package play.plugins; - -import play.Play; -import play.PlayPlugin; -import play.mvc.Router; - -import java.util.stream.Collectors; - -/** - * @author jtremeaux - */ -public class DisableDocViewerPlugin extends PlayPlugin { - @Override - public void onApplicationStart() { - removePlugin(); - removeRoutes(); - } - - public void removeRoutes() { - Router.routes.removeAll(Router.routes.stream() - .filter(r -> r.path.startsWith("/@projectdocs") || r.path.startsWith("/@documentation")) - .collect(Collectors.toSet())); - } - - public void removePlugin() { - for (PlayPlugin plugin : Play.pluginCollection.getEnabledPlugins()) { - if (plugin.toString().startsWith("DocViewerPlugin")) { - Play.pluginCollection.disablePlugin(plugin); - } - } - } -} diff --git a/app/play/plugins/DisableIllegalAccessWarning.java b/app/play/plugins/DisableIllegalAccessWarning.java new file mode 100755 index 0000000..454e108 --- /dev/null +++ b/app/play/plugins/DisableIllegalAccessWarning.java @@ -0,0 +1,26 @@ +package play.plugins; + +import play.PlayPlugin; +import sun.misc.Unsafe; + +import java.lang.reflect.Field; + +/** + * @author jtremeaux + */ +public class DisableIllegalAccessWarning extends PlayPlugin { + @Override + public void onLoad() { + try { + Field theUnsafe = Unsafe.class.getDeclaredField("theUnsafe"); + theUnsafe.setAccessible(true); + Unsafe u = (Unsafe) theUnsafe.get(null); + + Class cls = Class.forName("jdk.internal.module.IllegalAccessLogger"); + Field logger = cls.getDeclaredField("logger"); + u.putObjectVolatile(cls, u.staticFieldOffset(logger), null); + } catch (Exception e) { + // ignore + } + } +} diff --git a/conf/dependencies.yml b/conf/dependencies.yml index 0afd981..f3c1b6d 100755 --- a/conf/dependencies.yml +++ b/conf/dependencies.yml @@ -1,4 +1,4 @@ -self: play -> playful 1.4.0 +self: play -> playful 1.5.0 configurations: - provided: @@ -7,3 +7,10 @@ configurations: require: - play - com.sismics.sapparot -> sapparot 1.3.0 + +repositories: + - sismicsNexusMaven: + type: iBiblio + root: "https://nexus.sismics.com/repository/com.sismics/" + contains: + - com.sismics.sapparot -> *