From 5e6555db50cafa06f2142237e4356a844146cb4e Mon Sep 17 00:00:00 2001 From: cagache Date: Tue, 26 Mar 2019 10:39:57 +0200 Subject: [PATCH 01/14] RM-6790 Make RM automation module compatible with OpenJDK 11 --- rm-automation/rm-automation-community-rest-api/pom.xml | 9 +++++++-- .../src/main/resources/config.properties | 1 + 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/rm-automation/rm-automation-community-rest-api/pom.xml b/rm-automation/rm-automation-community-rest-api/pom.xml index 20ba6c376f..66be754b6e 100644 --- a/rm-automation/rm-automation-community-rest-api/pom.xml +++ b/rm-automation/rm-automation-community-rest-api/pom.xml @@ -15,7 +15,7 @@ 1.8 alfresco-governance-services-community-share alfresco-governance-services-community-repo - 5.2.0-10 + 6.0.0.3 2.0.0 @@ -59,7 +59,7 @@ org.projectlombok lombok - 1.16.10 + 1.18.6 provided @@ -73,5 +73,10 @@ alfresco-testng 1.1 + + org.apache.commons + commons-collections4 + 4.1 + diff --git a/rm-automation/rm-automation-community-rest-api/src/main/resources/config.properties b/rm-automation/rm-automation-community-rest-api/src/main/resources/config.properties index 8b94951ea5..f66389d1f5 100644 --- a/rm-automation/rm-automation-community-rest-api/src/main/resources/config.properties +++ b/rm-automation/rm-automation-community-rest-api/src/main/resources/config.properties @@ -1,2 +1,3 @@ alfresco.server=localhost +alfresco.port=8080 rest.rmPath=alfresco/api/-default-/public/gs/versions/1 \ No newline at end of file From cb76ebed0033c20fd77153d86b3a5bfc91774ee2 Mon Sep 17 00:00:00 2001 From: Rodica Sutu Date: Tue, 26 Mar 2019 13:50:09 +0200 Subject: [PATCH 02/14] update the maven javadoc, maven war and alfresco-maven plugin to be compatible with OpenJDK 11 add javax libraries --- pom.xml | 69 ++++++++++++++++++++------ rm-community/rm-community-repo/pom.xml | 1 + 2 files changed, 56 insertions(+), 14 deletions(-) diff --git a/pom.xml b/pom.xml index 2aa32a6479..475bc0d4da 100644 --- a/pom.xml +++ b/pom.xml @@ -157,11 +157,13 @@ maven-javadoc-plugin - 2.10.3 + ${maven.javadoc.version} com.docflex.javadoc.Doclet ${project.build.directory}/docflex-javadoc-${docflex.version}/lib/docflex-javadoc.jar - + none + + -license ${settings.localRepository}/com/docflex/docflex-alfresco-license/1.0/docflex-alfresco-license-1.0.license -template ${project.build.directory}/docflex-javadoc-${docflex.version}/templates/JavadocPro/FramedDoc.tpl -nodialog @@ -169,7 +171,8 @@ -p:filter.byAnns.include.classes=org.alfresco.api.AlfrescoPublicApi -p:docTitle "${project.name} ${project.version} Public API" -p:windowTitle "${project.name} ${project.version} Public API" - + + @@ -471,6 +474,8 @@ /share + 3.0.1 + 2.6 false 1.8 1.8 @@ -512,6 +517,8 @@ imageNameNotSet latest quay.io + + 2.3.1 @@ -552,6 +559,33 @@ 4.12 test + + + javax.xml.bind + jaxb-api + ${javax-jaxb.version} + provided + + + + com.sun.xml.bind + jaxb-impl + ${javax-jaxb.version} + provided + + + + com.sun.xml.bind + jaxb-core + ${javax-jaxb.version} + + + + org.apache.bcel + bcel + 6.2.99 + provided + @@ -640,21 +674,27 @@ maven-javadoc-plugin - 2.10.4 + ${maven.javadoc.version} + + none + + attach-javadocs + + none + + false + false + + jar - - -Xdoclint:none - + - - -Xdoclint:none - maven-clean-plugin @@ -790,7 +830,7 @@ org.alfresco.maven.plugin alfresco-maven-plugin - 2.1.1 + 2.2.0 true true @@ -901,7 +941,8 @@ maven-javadoc-plugin - -Xdoclint:none + none + @@ -1000,12 +1041,12 @@ maven-war-plugin - 2.5 + ${maven.war.plugin.version} org.alfresco.maven.plugin alfresco-maven-plugin - 2.1.1 + 2.2.0 diff --git a/rm-community/rm-community-repo/pom.xml b/rm-community/rm-community-repo/pom.xml index 9e05d0758d..7fedc30eb2 100644 --- a/rm-community/rm-community-repo/pom.xml +++ b/rm-community/rm-community-repo/pom.xml @@ -265,6 +265,7 @@ true true true + ${project.build.directory}/${project.build.finalName} From 5b15100839cfc98267abdf487bc6e2d529af5d71 Mon Sep 17 00:00:00 2001 From: cagache Date: Tue, 26 Mar 2019 15:35:05 +0200 Subject: [PATCH 03/14] call super.checkServerHealth --- .../java/org/alfresco/rest/rm/community/base/BaseRMRestTest.java | 1 + 1 file changed, 1 insertion(+) diff --git a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/base/BaseRMRestTest.java b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/base/BaseRMRestTest.java index aa65f8c967..ed5d917d55 100644 --- a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/base/BaseRMRestTest.java +++ b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/base/BaseRMRestTest.java @@ -161,6 +161,7 @@ public class BaseRMRestTest extends RestTest @BeforeClass (alwaysRun = true) public void checkServerHealth() throws Exception { + super.checkServerHealth(); // Create RM Site if not exist createRMSiteIfNotExists(); } From 076910017e5fcf7dc011637a9967be76687b1067 Mon Sep 17 00:00:00 2001 From: cagache Date: Tue, 26 Mar 2019 16:19:15 +0200 Subject: [PATCH 04/14] Revert "call super.checkServerHealth" This reverts commit 5b151008 --- .../java/org/alfresco/rest/rm/community/base/BaseRMRestTest.java | 1 - 1 file changed, 1 deletion(-) diff --git a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/base/BaseRMRestTest.java b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/base/BaseRMRestTest.java index ed5d917d55..aa65f8c967 100644 --- a/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/base/BaseRMRestTest.java +++ b/rm-automation/rm-automation-community-rest-api/src/test/java/org/alfresco/rest/rm/community/base/BaseRMRestTest.java @@ -161,7 +161,6 @@ public class BaseRMRestTest extends RestTest @BeforeClass (alwaysRun = true) public void checkServerHealth() throws Exception { - super.checkServerHealth(); // Create RM Site if not exist createRMSiteIfNotExists(); } From b860dd25c78188c87609acacc39b1081ef495660 Mon Sep 17 00:00:00 2001 From: cagache Date: Wed, 27 Mar 2019 13:19:09 +0200 Subject: [PATCH 05/14] changed formatter used in tests because DateTimeFormatter.ISO_INSTANT outputs 9 nanoseconds and POST request to http://localhost:8080/alfresco/service/api/rma/actions/ExecutionQueue returns 500 --- .../src/main/java/org/alfresco/rest/core/v0/APIUtils.java | 6 ++++++ .../java/org/alfresco/rest/v0/RMRolesAndActionsAPI.java | 6 +++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/core/v0/APIUtils.java b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/core/v0/APIUtils.java index fb6e3d9802..3d3f362a41 100644 --- a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/core/v0/APIUtils.java +++ b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/core/v0/APIUtils.java @@ -27,6 +27,8 @@ package org.alfresco.rest.core.v0; import java.io.IOException; +import java.time.format.DateTimeFormatter; +import java.time.format.DateTimeFormatterBuilder; import org.apache.commons.io.IOUtils; import org.apache.http.HttpResponse; @@ -44,6 +46,10 @@ public class APIUtils { /** Logger for this class. */ private static final Logger LOGGER = LoggerFactory.getLogger(APIUtils.class); + /** The ISO instant formatter that formats or parses an instant in UTC, such as '2011-12-03T10:15:305Z' + * similar with {@link DateTimeFormatter#ISO_INSTANT}, but with only 3 nanoseconds*/ + public static final DateTimeFormatter ISO_INSTANT_FORMATTER = + new DateTimeFormatterBuilder().appendInstant(3).toFormatter(); /** Private constructor for helper class. */ private APIUtils() diff --git a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/v0/RMRolesAndActionsAPI.java b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/v0/RMRolesAndActionsAPI.java index 6f07fcf3ab..96025d88b3 100644 --- a/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/v0/RMRolesAndActionsAPI.java +++ b/rm-automation/rm-automation-community-rest-api/src/main/java/org/alfresco/rest/v0/RMRolesAndActionsAPI.java @@ -27,6 +27,7 @@ package org.alfresco.rest.v0; import static org.alfresco.dataprep.AlfrescoHttpClient.MIME_TYPE_JSON; +import static org.alfresco.rest.core.v0.APIUtils.ISO_INSTANT_FORMATTER; import static org.apache.http.HttpStatus.SC_OK; import static org.testng.AssertJUnit.assertEquals; import static org.testng.AssertJUnit.assertNotNull; @@ -37,7 +38,6 @@ import java.io.IOException; import java.text.MessageFormat; import java.time.Instant; import java.time.ZonedDateTime; -import java.time.format.DateTimeFormatter; import java.util.Arrays; import java.util.Map; import java.util.Set; @@ -341,7 +341,7 @@ public class RMRolesAndActionsAPI extends BaseAPI requestParams.put("nodeRef", recNodeRef); if (date != null) { - String thisMoment = date.format(DateTimeFormatter.ISO_INSTANT); + String thisMoment = date.format(ISO_INSTANT_FORMATTER); requestParams.put("params", new JSONObject() .put("asOfDate", new JSONObject() .put("iso8601", thisMoment) @@ -368,7 +368,7 @@ public class RMRolesAndActionsAPI extends BaseAPI requestParams.put("name", RM_ACTIONS.COMPLETE_EVENT.getAction()); requestParams.put("nodeRef", recNodeRef); date = (date != null) ? date : Instant.now(); - String formattedDate = DateTimeFormatter.ISO_INSTANT.format(date); + String formattedDate = ISO_INSTANT_FORMATTER.format(date); requestParams.put("params", new JSONObject() .put("eventName", event.getEventName()) .put("eventCompletedBy", user) From 7c27ac4782b0218790e12483bc63efe077ac5cf9 Mon Sep 17 00:00:00 2001 From: Rodica Sutu Date: Thu, 28 Mar 2019 09:44:43 +0200 Subject: [PATCH 06/14] fix compilation error --- .../test/integration/issue/RM4804Test.java | 1 - 1 file changed, 1 deletion(-) diff --git a/rm-community/rm-community-repo/test/java/org/alfresco/module/org_alfresco_module_rm/test/integration/issue/RM4804Test.java b/rm-community/rm-community-repo/test/java/org/alfresco/module/org_alfresco_module_rm/test/integration/issue/RM4804Test.java index e6ed70983b..25ec841ed7 100644 --- a/rm-community/rm-community-repo/test/java/org/alfresco/module/org_alfresco_module_rm/test/integration/issue/RM4804Test.java +++ b/rm-community/rm-community-repo/test/java/org/alfresco/module/org_alfresco_module_rm/test/integration/issue/RM4804Test.java @@ -46,7 +46,6 @@ import org.apache.commons.io.IOUtils; import org.apache.commons.lang.StringUtils; import org.springframework.extensions.webscripts.GUID; -import javax.xml.soap.Node; /** * Integration test for RM-4804 From 2b6dd1861c3b562b191107eda3a21a8d12325588 Mon Sep 17 00:00:00 2001 From: Rodica Sutu Date: Thu, 28 Mar 2019 09:48:45 +0200 Subject: [PATCH 07/14] change back alfresco-maven-plugin comment out thejava version from the maven-enforcer-plugin --- pom.xml | 55 +++++++++++++------------- rm-community/rm-community-repo/pom.xml | 4 +- 2 files changed, 31 insertions(+), 28 deletions(-) diff --git a/pom.xml b/pom.xml index 475bc0d4da..a816ca4925 100644 --- a/pom.xml +++ b/pom.xml @@ -480,7 +480,7 @@ 1.8 1.8 1.9.1 - 3.2 + 3.8.0 1.4 2.7 8080 @@ -574,11 +574,12 @@ provided - - com.sun.xml.bind - jaxb-core - ${javax-jaxb.version} - + + + + + + org.apache.bcel @@ -591,25 +592,25 @@ ${project.artifactId}-${project.version} - - maven-enforcer-plugin - 1.4 - - - enforce-java - - enforce - - - - - 1.8 - - - - - - + + + + + + + + + + + + + + + + + + + org.codehaus.mojo build-helper-maven-plugin @@ -830,7 +831,7 @@ org.alfresco.maven.plugin alfresco-maven-plugin - 2.2.0 + 2.1.1 true true @@ -1046,7 +1047,7 @@ org.alfresco.maven.plugin alfresco-maven-plugin - 2.2.0 + 2.1.1 diff --git a/rm-community/rm-community-repo/pom.xml b/rm-community/rm-community-repo/pom.xml index 7fedc30eb2..c4b1b34949 100644 --- a/rm-community/rm-community-repo/pom.xml +++ b/rm-community/rm-community-repo/pom.xml @@ -265,7 +265,9 @@ true true true - ${project.build.directory}/${project.build.finalName} + + + From 5afd3850099a77ba6d8f51584b85b11e7c6a3d24 Mon Sep 17 00:00:00 2001 From: Rodica Sutu Date: Thu, 28 Mar 2019 11:19:32 +0200 Subject: [PATCH 08/14] update the maven.enforcer.plugin --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index a816ca4925..673b4cd32f 100644 --- a/pom.xml +++ b/pom.xml @@ -481,7 +481,7 @@ 1.8 1.9.1 3.8.0 - 1.4 + 3.0.0-M2 2.7 8080 From 60a7f3282da840ff3a4f732bc6d2d41f32e260cf Mon Sep 17 00:00:00 2001 From: Rodica Sutu Date: Thu, 28 Mar 2019 17:21:14 +0200 Subject: [PATCH 09/14] update the versions for surefire and failsafe plugins and add an additional argument --illegal-access=permit to allow all reflection access for third party libraries: --- pom.xml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index 673b4cd32f..8f5f9182e5 100644 --- a/pom.xml +++ b/pom.xml @@ -654,7 +654,6 @@ maven-surefire-plugin - 2.18 **/*UnitTest.java @@ -814,7 +813,12 @@ maven-surefire-plugin - 2.18 + 2.22.0 + + + --illegal-access=permit + + maven-install-plugin @@ -912,7 +916,12 @@ maven-failsafe-plugin - 2.19 + 2.22.0 + + + --illegal-access=permit + + maven-antrun-plugin From 0a72cf0c324f2ad7b499ea484456a29922bbd8b6 Mon Sep 17 00:00:00 2001 From: Rodica Sutu Date: Thu, 28 Mar 2019 17:53:00 +0200 Subject: [PATCH 10/14] update maven enforce plugin --- pom.xml | 37 ++++++++++++++++++------------------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/pom.xml b/pom.xml index 8f5f9182e5..fe775201d7 100644 --- a/pom.xml +++ b/pom.xml @@ -592,25 +592,24 @@ ${project.artifactId}-${project.version} - - - - - - - - - - - - - - - - - - - + + maven-enforcer-plugin + + + enforce-java + + enforce + + + + + [1.8.0,) + + + + + + org.codehaus.mojo build-helper-maven-plugin From abfc1fc9993b39355d4475a0764e086a9eb3f539 Mon Sep 17 00:00:00 2001 From: Rodica Sutu Date: Fri, 29 Mar 2019 10:14:03 +0200 Subject: [PATCH 11/14] update the maven java doc plugin to fix the Error fetching link: .../target/apidocs/package-list. add the fabric8.docker.version to fix the warning "build.plugins.plugin.version' for io.fabric8:docker-maven-plugin is missing." --- pom.xml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index fe775201d7..b3b82816c0 100644 --- a/pom.xml +++ b/pom.xml @@ -474,7 +474,7 @@ /share - 3.0.1 + 3.1.0 2.6 false 1.8 @@ -683,9 +683,6 @@ attach-javadocs none - - false - false From 9d1c3770c9853ce335dc10f357f80983f42bb195 Mon Sep 17 00:00:00 2001 From: Rodica Sutu Date: Mon, 1 Apr 2019 11:11:43 +0300 Subject: [PATCH 12/14] fix getResourceAsStream() for OpenJdk11 --- .../test/integration/destroy/DestroyContentTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rm-community/rm-community-repo/test/java/org/alfresco/module/org_alfresco_module_rm/test/integration/destroy/DestroyContentTest.java b/rm-community/rm-community-repo/test/java/org/alfresco/module/org_alfresco_module_rm/test/integration/destroy/DestroyContentTest.java index 489c8335c3..bea15c57b2 100644 --- a/rm-community/rm-community-repo/test/java/org/alfresco/module/org_alfresco_module_rm/test/integration/destroy/DestroyContentTest.java +++ b/rm-community/rm-community-repo/test/java/org/alfresco/module/org_alfresco_module_rm/test/integration/destroy/DestroyContentTest.java @@ -111,7 +111,7 @@ public class DestroyContentTest extends BaseRMTestCase Map props = new HashMap(1); props.put(ContentModel.PROP_TITLE, GUID.generate()); - InputStream is = System.class.getResourceAsStream("/alfresco/test/content/Image.jpg"); + InputStream is = DestroyContentTest.class.getResourceAsStream("/alfresco/test/content/Image.jpg"); subRecord = utils.createRecord(destroyableFolder, GUID.generate(), props, MimetypeMap.MIMETYPE_IMAGE_JPEG, is); From f77dc61b89143ac9b5e06ac883348ca8b896253d Mon Sep 17 00:00:00 2001 From: Rodica Sutu Date: Tue, 2 Apr 2019 12:41:22 +0300 Subject: [PATCH 13/14] tidy up --- rm-community/rm-community-repo/pom.xml | 2 -- 1 file changed, 2 deletions(-) diff --git a/rm-community/rm-community-repo/pom.xml b/rm-community/rm-community-repo/pom.xml index c4b1b34949..094995701c 100644 --- a/rm-community/rm-community-repo/pom.xml +++ b/rm-community/rm-community-repo/pom.xml @@ -265,8 +265,6 @@ true true true - - From d3065741223b5512c41d7af08e1a93d68399ff63 Mon Sep 17 00:00:00 2001 From: Rodica Sutu Date: Tue, 2 Apr 2019 12:43:16 +0300 Subject: [PATCH 14/14] version updates for the plugins used for OpenJDK 11 --- pom.xml | 38 ++++++++++++++------------------------ 1 file changed, 14 insertions(+), 24 deletions(-) diff --git a/pom.xml b/pom.xml index b3b82816c0..48edb2850f 100644 --- a/pom.xml +++ b/pom.xml @@ -31,7 +31,7 @@ - 3.2.5 + 3.3.9 @@ -131,7 +131,7 @@ maven-dependency-plugin - 2.10 + 3.1.1 @@ -482,13 +482,13 @@ 1.9.1 3.8.0 3.0.0-M2 - 2.7 + 3.1.0 8080 2.9.8 0.25.0 1.10.19 - 42.2.1 + 42.2.5 5432 5.1.40 3306 @@ -518,7 +518,7 @@ latest quay.io - 2.3.1 + 2.3.0 @@ -574,13 +574,6 @@ provided - - - - - - - org.apache.bcel bcel @@ -676,14 +669,12 @@ ${maven.javadoc.version} none - attach-javadocs none - jar @@ -694,7 +685,7 @@ maven-clean-plugin - 2.6.1 + 3.1.0 default-clean @@ -733,7 +724,7 @@ maven-site-plugin - 3.3 + 3.7.1 default-site @@ -809,7 +800,7 @@ maven-surefire-plugin - 2.22.0 + 2.22.1 --illegal-access=permit @@ -822,11 +813,11 @@ maven-jar-plugin - 2.5 + 3.1.0 maven-assembly-plugin - 2.2-beta-5 + 3.1.0 org.alfresco.maven.plugin @@ -912,7 +903,7 @@ maven-failsafe-plugin - 2.22.0 + 2.22.1 --illegal-access=permit @@ -948,14 +939,13 @@ maven-javadoc-plugin none - org.codehaus.mojo license-maven-plugin - 1.8 + 1.16 ${license.verbose} @@ -1066,11 +1056,11 @@ maven-clean-plugin - 2.6.1 + 3.1.0 maven-dependency-plugin - 2.9 + 3.1.1 maven-archetype-plugin