From 410b50828fcd398aad31cacd7c214bf1f1c733b0 Mon Sep 17 00:00:00 2001 From: Gregory Amerson Date: Fri, 7 Feb 2020 09:52:09 -0600 Subject: [PATCH 01/14] BLADE-507 Use latest project-templates --- cli/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/build.gradle b/cli/build.gradle index 63c3e94dd..d4c090b37 100644 --- a/cli/build.gradle +++ b/cli/build.gradle @@ -73,7 +73,7 @@ dependencies { compile group: "biz.aQute.bnd", name: "biz.aQute.bndlib", version: "4.3.0" compile group: "com.liferay", name: "com.liferay.gogo.shell.client", version: "1.0.0" - compile group: "com.liferay", name: "com.liferay.project.templates", version: "5.0.19" + compile group: "com.liferay", name: "com.liferay.project.templates", version: "5.0.20" compile group: "commons-io", name: "commons-io", version: "2.6" compile group: "org.apache.commons", name: "commons-compress", version: "1.18" compile group: "org.apache.commons", name: "commons-lang3", version: "3.4" From 5f27cfa2695487b14b614ea82f46fb8f9b592bf3 Mon Sep 17 00:00:00 2001 From: Gregory Amerson Date: Mon, 10 Feb 2020 22:29:52 -0600 Subject: [PATCH 02/14] BLADE-507 sf --- .../main/java/com/liferay/blade/cli/command/InitCommand.java | 4 ---- .../com/liferay/blade/cli/command/ServerStartCommandTest.java | 4 ---- 2 files changed, 8 deletions(-) diff --git a/cli/src/main/java/com/liferay/blade/cli/command/InitCommand.java b/cli/src/main/java/com/liferay/blade/cli/command/InitCommand.java index 5eaf1a82e..14503bd7f 100644 --- a/cli/src/main/java/com/liferay/blade/cli/command/InitCommand.java +++ b/cli/src/main/java/com/liferay/blade/cli/command/InitCommand.java @@ -172,10 +172,6 @@ public void execute() throws Exception { name = destDir.getName(); } - Path destPath = destDir.toPath(); - - destPath = destPath.normalize(); - File destParentDir = destDir.getParentFile(); projectTemplatesArgs.setDestinationDir(destParentDir); diff --git a/cli/src/test/java/com/liferay/blade/cli/command/ServerStartCommandTest.java b/cli/src/test/java/com/liferay/blade/cli/command/ServerStartCommandTest.java index aa39fdb9f..9ae36468b 100644 --- a/cli/src/test/java/com/liferay/blade/cli/command/ServerStartCommandTest.java +++ b/cli/src/test/java/com/liferay/blade/cli/command/ServerStartCommandTest.java @@ -377,8 +377,6 @@ private static void _terminateProcess(PidProcess tomcatPidProcess) throws Except private void _addBundleToGradle(String bundleFileName) throws Exception { Path gradlePropertiesPath = _testWorkspacePath.resolve("gradle.properties"); - String contents = new String(Files.readAllBytes(gradlePropertiesPath)); - StringBuilder sb = new StringBuilder(); sb.append(_LIFERAY_WORKSPACE_BUNDLE_KEY); @@ -389,8 +387,6 @@ private void _addBundleToGradle(String bundleFileName) throws Exception { String bundleUrl = sb.toString(); - contents = bundleUrl + contents; - Files.write(gradlePropertiesPath, bundleUrl.getBytes(), StandardOpenOption.TRUNCATE_EXISTING); } From 37eefdc5505edee383c9b2bcc27ddfc9ca821279 Mon Sep 17 00:00:00 2001 From: Gregory Amerson Date: Mon, 10 Feb 2020 09:52:22 -0600 Subject: [PATCH 03/14] BLADE-509 convert command should be more careful when searching for plugin source --- .../blade/cli/command/ConvertCommand.java | 283 ++++++++++-------- 1 file changed, 163 insertions(+), 120 deletions(-) diff --git a/cli/src/main/java/com/liferay/blade/cli/command/ConvertCommand.java b/cli/src/main/java/com/liferay/blade/cli/command/ConvertCommand.java index 78870f9bb..dd1bee6d2 100644 --- a/cli/src/main/java/com/liferay/blade/cli/command/ConvertCommand.java +++ b/cli/src/main/java/com/liferay/blade/cli/command/ConvertCommand.java @@ -82,23 +82,22 @@ public void execute() throws Exception { Properties gradleProperties = workspaceProviderGradle.getGradleProperties(projectDir); File pluginsSdkDir = convertArgs.getSource(); - String pluginsSdkDirPath = null; if (pluginsSdkDir == null) { if (gradleProperties != null) { - pluginsSdkDirPath = gradleProperties.getProperty(WorkspaceConstants.DEFAULT_PLUGINS_SDK_DIR_PROPERTY); + pluginsSdkDir = new File( + gradleProperties.getProperty(WorkspaceConstants.DEFAULT_PLUGINS_SDK_DIR_PROPERTY)); } - if (pluginsSdkDirPath == null) { - pluginsSdkDirPath = WorkspaceConstants.DEFAULT_PLUGINS_SDK_DIR; + if (pluginsSdkDir == null) { + pluginsSdkDir = new File(WorkspaceConstants.DEFAULT_PLUGINS_SDK_DIR); } - - pluginsSdkDir = new File(projectDir, pluginsSdkDirPath); - } - else { - pluginsSdkDirPath = pluginsSdkDir.getPath(); } + _assertTrue("pluginsSdkDir is not null", pluginsSdkDir != null); + _assertTrue("pluginsSdkDir exists", pluginsSdkDir.exists()); + _assertTrue("pluginsSdkDir is valid Plugins SDK", _isValidSDKDir(pluginsSdkDir)); + File hooksDir = new File(pluginsSdkDir, "hooks"); File layouttplDir = new File(pluginsSdkDir, "layouttpl"); File portletsDir = new File(pluginsSdkDir, "portlets"); @@ -119,8 +118,9 @@ public void execute() throws Exception { if (!pluginsSdkDir.exists()) { bladeCLI.error( - "Plugins SDK folder " + pluginsSdkDirPath + " does not exist.\nPlease edit gradle.properties and set " + - WorkspaceConstants.DEFAULT_PLUGINS_SDK_DIR_PROPERTY); + "Plugins SDK folder " + pluginsSdkDir.getAbsolutePath() + + " does not exist.\nPlease edit gradle.properties and set " + + WorkspaceConstants.DEFAULT_PLUGINS_SDK_DIR_PROPERTY); return; } @@ -212,15 +212,39 @@ public boolean accept(File pathname) { Stream portletPluginStream = portletPlugins.stream(); - portletPluginStream.forEach(portalPlugin -> _convertToWarProject(warsDir, portalPlugin, removeSource)); + portletPluginStream.forEach( + portalPlugin -> { + try { + _convertToWarProject(warsDir, portalPlugin, removeSource); + } + catch (Exception e) { + e.printStackTrace(bladeCLI.error()); + } + }); Stream hookPluginStream = hookPlugins.stream(); - hookPluginStream.forEach(hookPlugin -> _convertToWarProject(warsDir, hookPlugin, removeSource)); + hookPluginStream.forEach( + hookPlugin -> { + try { + _convertToWarProject(warsDir, hookPlugin, removeSource); + } + catch (Exception e) { + e.printStackTrace(bladeCLI.error()); + } + }); Stream webPluginStream = webPlugins.stream(); - webPluginStream.forEach(webPlugin -> _convertToWarProject(warsDir, webPlugin, removeSource)); + webPluginStream.forEach( + webPlugin -> { + try { + _convertToWarProject(warsDir, webPlugin, removeSource); + } + catch (Exception e) { + e.printStackTrace(bladeCLI.error()); + } + }); Stream layoutPluginStream = layoutPlugins.stream(); @@ -252,11 +276,8 @@ else if (convertArgs.isList()) { else { File pluginDir = _findPluginDir(pluginsSdkDir, pluginName); - if (pluginDir == null) { - bladeCLI.error("Plugin does not exist."); - - return; - } + _assertTrue("pluginDir is not null", pluginDir != null); + _assertTrue("pluginDir exists", pluginDir.exists()); Path pluginPath = pluginDir.toPath(); @@ -319,6 +340,12 @@ private static boolean _isServiceBuilderPlugin(File pluginDir) { return _hasServiceXmlFile(pluginDir); } + private void _assertTrue(String message, boolean value) { + if (!value) { + throw new AssertionError(message); + } + } + private void _convertToLayoutWarProject(File warsDir, File layoutPluginDir, boolean removeSource) { try { warsDir.mkdirs(); @@ -505,161 +532,155 @@ private void _convertToThemeProject(File themePlugin) { } } - private void _convertToWarProject(File warsDir, File pluginDir, boolean removeSource) { - try { - warsDir.mkdirs(); + private void _convertToWarProject(File warsDir, File pluginDir, boolean removeSource) throws Exception { + warsDir.mkdirs(); - Path warsPath = warsDir.toPath(); + Path warsPath = warsDir.toPath(); - moveFile(pluginDir.toPath(), warsPath.resolve(pluginDir.getName()), removeSource); + moveFile(pluginDir.toPath(), warsPath.resolve(pluginDir.getName()), removeSource); - File warDir = new File(warsDir, pluginDir.getName()); + File warDir = new File(warsDir, pluginDir.getName()); - File src = new File(warDir, "src/main/java"); + File src = new File(warDir, "src/main/java"); - src.mkdirs(); + src.mkdirs(); - File docrootSrc = new File(warDir, "docroot/WEB-INF/src"); + File docrootSrc = new File(warDir, "docroot/WEB-INF/src"); - Path srcPath = src.toPath(); + Path srcPath = src.toPath(); - if (docrootSrc.exists()) { - for (File docrootSrcFile : docrootSrc.listFiles()) { - moveFile(docrootSrcFile.toPath(), srcPath.resolve(docrootSrcFile.getName())); - } - - docrootSrc.delete(); + if (docrootSrc.exists()) { + for (File docrootSrcFile : docrootSrc.listFiles()) { + moveFile(docrootSrcFile.toPath(), srcPath.resolve(docrootSrcFile.getName())); } - File webapp = new File(warDir, "src/main/webapp"); + docrootSrc.delete(); + } - webapp.mkdirs(); + File webapp = new File(warDir, "src/main/webapp"); - File docroot = new File(warDir, "docroot"); + webapp.mkdirs(); - Path webappPath = webapp.toPath(); + File docroot = new File(warDir, "docroot"); - for (File docrootFile : docroot.listFiles()) { - moveFile(docrootFile.toPath(), webappPath.resolve(docrootFile.getName())); - } + Path webappPath = webapp.toPath(); - Path warPath = warDir.toPath(); + for (File docrootFile : docroot.listFiles()) { + moveFile(docrootFile.toPath(), webappPath.resolve(docrootFile.getName())); + } - FileUtil.deleteDir(docroot.toPath()); - Files.deleteIfExists(warPath.resolve("build.xml")); - Files.deleteIfExists(warPath.resolve(".classpath")); - Files.deleteIfExists(warPath.resolve(".project")); - FileUtil.deleteDirIfExists(warPath.resolve(".settings")); - Files.deleteIfExists(warPath.resolve("ivy.xml.MD5")); + Path warPath = warDir.toPath(); - List dependencies = new ArrayList<>(); + FileUtil.deleteDir(docroot.toPath()); + Files.deleteIfExists(warPath.resolve("build.xml")); + Files.deleteIfExists(warPath.resolve(".classpath")); + Files.deleteIfExists(warPath.resolve(".project")); + FileUtil.deleteDirIfExists(warPath.resolve(".settings")); + Files.deleteIfExists(warPath.resolve("ivy.xml.MD5")); - dependencies.add( - "compileOnly group: \"com.liferay.portal\", name: \"com.liferay.portal.kernel\", version: \"2.0.0\""); - dependencies.add("compileOnly group: \"javax.portlet\", name: \"portlet-api\", version: \"2.0\""); - dependencies.add("compileOnly group: \"javax.servlet\", name: \"javax.servlet-api\", version: \"3.0.1\""); + List dependencies = new ArrayList<>(); - File ivyFile = new File(warDir, "ivy.xml"); + dependencies.add( + "compileOnly group: \"com.liferay.portal\", name: \"com.liferay.portal.kernel\", version: \"2.0.0\""); + dependencies.add("compileOnly group: \"javax.portlet\", name: \"portlet-api\", version: \"2.0\""); + dependencies.add("compileOnly group: \"javax.servlet\", name: \"javax.servlet-api\", version: \"3.0.1\""); - if (ivyFile.exists()) { - DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance(); + File ivyFile = new File(warDir, "ivy.xml"); - DocumentBuilder dBuilder = dbFactory.newDocumentBuilder(); + if (ivyFile.exists()) { + DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance(); - Document doc = dBuilder.parse(ivyFile); + DocumentBuilder dBuilder = dbFactory.newDocumentBuilder(); - Element documentElement = doc.getDocumentElement(); + Document doc = dBuilder.parse(ivyFile); - documentElement.normalize(); + Element documentElement = doc.getDocumentElement(); - NodeList depElements = documentElement.getElementsByTagName("dependency"); + documentElement.normalize(); - if ((depElements != null) && (depElements.getLength() > 0)) { - for (int i = 0; i < depElements.getLength(); i++) { - Node depElement = depElements.item(i); + NodeList depElements = documentElement.getElementsByTagName("dependency"); - String name = _getAttr(depElement, "name"); - String org = _getAttr(depElement, "org"); - String rev = _getAttr(depElement, "rev"); + if ((depElements != null) && (depElements.getLength() > 0)) { + for (int i = 0; i < depElements.getLength(); i++) { + Node depElement = depElements.item(i); - if ((name != null) && (org != null) && (rev != null)) { - dependencies.add( - MessageFormat.format( - "compile group: ''{0}'', name: ''{1}'', version: ''{2}''", org, name, rev)); - } + String name = _getAttr(depElement, "name"); + String org = _getAttr(depElement, "org"); + String rev = _getAttr(depElement, "rev"); + + if ((name != null) && (org != null) && (rev != null)) { + dependencies.add( + MessageFormat.format( + "compile group: ''{0}'', name: ''{1}'', version: ''{2}''", org, name, rev)); } } - - ivyFile.delete(); } - File liferayPluginPackageFile = new File( - warDir, "src/main/webapp/WEB-INF/liferay-plugin-package.properties"); + ivyFile.delete(); + } - if (liferayPluginPackageFile.exists()) { - try (InputStream fileInputStream = new FileInputStream(liferayPluginPackageFile)) { - Properties liferayPluginPackageProperties = new Properties(); + File liferayPluginPackageFile = new File(warDir, "src/main/webapp/WEB-INF/liferay-plugin-package.properties"); - liferayPluginPackageProperties.load(fileInputStream); + if (liferayPluginPackageFile.exists()) { + try (InputStream fileInputStream = new FileInputStream(liferayPluginPackageFile)) { + Properties liferayPluginPackageProperties = new Properties(); - String portalJarsValue = liferayPluginPackageProperties.getProperty("portal-dependency-jars"); + liferayPluginPackageProperties.load(fileInputStream); - if (portalJarsValue != null) { - String[] portalJars = portalJarsValue.split(","); + String portalJarsValue = liferayPluginPackageProperties.getProperty("portal-dependency-jars"); - try (InputStream inputStream = ConvertCommand.class.getResourceAsStream( - "/portal-dependency-jars-62.properties")) { + if (portalJarsValue != null) { + String[] portalJars = portalJarsValue.split(","); - Properties properties = new Properties(); + try (InputStream inputStream = ConvertCommand.class.getResourceAsStream( + "/portal-dependency-jars-62.properties")) { - properties.load(inputStream); + Properties properties = new Properties(); - for (String portalJar : portalJars) { - String newDependency = properties.getProperty(portalJar); + properties.load(inputStream); - if ((newDependency == null) || newDependency.isEmpty()) { - continue; - } + for (String portalJar : portalJars) { + String newDependency = properties.getProperty(portalJar); - String[] s = newDependency.split(","); + if ((newDependency == null) || newDependency.isEmpty()) { + continue; + } - if (s.length != 3) { - continue; - } + String[] s = newDependency.split(","); - dependencies.add( - MessageFormat.format( - "compile group: ''{0}'', name: ''{1}'', version: ''{2}''", s[0], s[1], s[2])); + if (s.length != 3) { + continue; } - } - catch (Exception e) { - getBladeCLI().error( - "Convert failed on portal jars of liferay-plugin-package.properties. \n", - pluginDir.getName(), e.getMessage()); + + dependencies.add( + MessageFormat.format( + "compile group: ''{0}'', name: ''{1}'', version: ''{2}''", s[0], s[1], s[2])); } } + catch (Exception e) { + getBladeCLI().error( + "Convert failed on portal jars of liferay-plugin-package.properties. \n", + pluginDir.getName(), e.getMessage()); + } } } + } - StringBuilder depsBlock = new StringBuilder(); + StringBuilder depsBlock = new StringBuilder(); - depsBlock.append("dependencies {" + System.lineSeparator()); + depsBlock.append("dependencies {" + System.lineSeparator()); - for (String dependency : dependencies) { - depsBlock.append("\t" + dependency + System.lineSeparator()); - } + for (String dependency : dependencies) { + depsBlock.append("\t" + dependency + System.lineSeparator()); + } - depsBlock.append("}"); + depsBlock.append("}"); - File gradleFile = new File(warDir, "build.gradle"); + File gradleFile = new File(warDir, "build.gradle"); - String content = depsBlock.toString(); + String content = depsBlock.toString(); - Files.write(gradleFile.toPath(), content.getBytes()); - } - catch (Exception e) { - getBladeCLI().error("Error upgrading project %s\n%s", pluginDir.getName(), e.getMessage()); - } + Files.write(gradleFile.toPath(), content.getBytes()); } private File _findPluginDir(File pluginsSdkDir, final String pluginName) throws Exception { @@ -676,9 +697,19 @@ public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) th String nameValue = name.toString(); if (nameValue.equals(pluginName)) { - pluginDir[0] = dir.toFile(); + Path parent = dir.getParent(); + + if ((parent != null) && Files.exists(parent)) { + parent = parent.getParent(); + } - return FileVisitResult.TERMINATE; + if ((parent != null) && Files.exists(parent)) { + if (_isValidSDKDir(parent.toFile())) { + pluginDir[0] = dir.toFile(); + + return FileVisitResult.TERMINATE; + } + } } return FileVisitResult.CONTINUE; @@ -689,4 +720,16 @@ public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) th return pluginDir[0]; } + private boolean _isValidSDKDir(File pluginsSdkDir) { + File buildProperties = new File(pluginsSdkDir, "build.properties"); + File portletsBuildXml = new File(pluginsSdkDir, "portlets/build.xml"); + File hooksBuildXml = new File(pluginsSdkDir, "hooks/build.xml"); + + if (buildProperties.exists() && portletsBuildXml.exists() && hooksBuildXml.exists()) { + return true; + } + + return false; + } + } \ No newline at end of file From d9462b3ee6815cdab958a68c0a425c8377687a7b Mon Sep 17 00:00:00 2001 From: Gregory Amerson Date: Mon, 10 Feb 2020 14:21:09 -0600 Subject: [PATCH 04/14] BLADE-509 failing test case for convert command --- .../blade/cli/command/ConvertCommandTest.java | 42 ++++++++++++++++++ .../projects/invalid-plugins-sdk-path.zip | Bin 0 -> 19864 bytes 2 files changed, 42 insertions(+) create mode 100644 cli/test-resources/projects/invalid-plugins-sdk-path.zip diff --git a/cli/src/test/java/com/liferay/blade/cli/command/ConvertCommandTest.java b/cli/src/test/java/com/liferay/blade/cli/command/ConvertCommandTest.java index 09594d172..686d60e21 100644 --- a/cli/src/test/java/com/liferay/blade/cli/command/ConvertCommandTest.java +++ b/cli/src/test/java/com/liferay/blade/cli/command/ConvertCommandTest.java @@ -16,6 +16,7 @@ package com.liferay.blade.cli.command; +import com.liferay.blade.cli.BladeTestResults; import com.liferay.blade.cli.TestUtil; import com.liferay.blade.cli.util.FileUtil; @@ -129,6 +130,47 @@ public void testAllNotRemoveSource() throws Exception { Assert.assertTrue(Files.exists(pluginServiceBuilderPath)); } + @Test + public void testFindPluginsSdkPlugin() throws Exception { + Path rootPath = _rootDir.toPath(); + + Path testPath = rootPath.resolve("build/testPluginsSdkWithMetadata"); + + Files.createDirectories(testPath); + + FileUtil.unzip(new File("test-resources/projects/invalid-plugins-sdk-path.zip"), testPath.toFile()); + + Assert.assertTrue(Files.exists(testPath)); + + Path pluginsSdkPath = testPath.resolve("invalid-plugins-sdk-path"); + + Assert.assertTrue(Files.exists(pluginsSdkPath)); + + Path workspacePath = testPath.resolve("workspace"); + + Files.createDirectories(workspacePath); + + String[] args = {"--base", workspacePath.toString(), "init", "-v", "7.2"}; + + TestUtil.runBlade(_rootDir, _extensionsDir, args); + + args = new String[] { + "--base", workspacePath.toString(), "convert", "-s", pluginsSdkPath.toString(), "tasks-portlet" + }; + + BladeTestResults bladeTestResults = TestUtil.runBlade(_rootDir, _extensionsDir, args); + + Path tasksPortletPath = workspacePath.resolve("wars/tasks-portlet"); + + Assert.assertTrue( + bladeTestResults.getErrors() + "\n" + bladeTestResults.getOutput(), Files.exists(tasksPortletPath)); + + Assert.assertTrue(Files.exists(tasksPortletPath.resolve("build.gradle"))); + + Assert.assertTrue( + Files.exists(tasksPortletPath.resolve("src/main/webapp/WEB-INF/liferay--plugin-package.properties"))); + } + @Test public void testMoveLayouttplToWars() throws Exception { File testdir = new File(temporaryFolder.getRoot(), "build/testMoveLayouttplToWars1"); diff --git a/cli/test-resources/projects/invalid-plugins-sdk-path.zip b/cli/test-resources/projects/invalid-plugins-sdk-path.zip new file mode 100644 index 0000000000000000000000000000000000000000..a4a9886e468ec2df88687888c70d8b68cbeb72dd GIT binary patch literal 19864 zcmd74WmKHovM!86f;$9Bu;6aNHE3`T?(Xg`!Gn7f++Bi8aBJM%8h6*5oOSlv?5unC zcg`61es^_`Zu$qK>UpZ>eBY{f%%@}}A)#J_{dytTNyz@kkN^C_1w#QdwQ|z6Fg2jH zv2ZjtwX&zRH!!EQ(RDDPS5id)BW@JX!v6WW1jhiA{nHH6Z)S-9of#WzI|mCx2m3$m z;s3?ndzpWQMg8BhNB5tI|1_-X`8!aW-wccV&kS4J8Pgf+TbSC|8`9}p+Zoc?8QNPr z+UXnqlZ^gfe1gpXm5l8FF`slccGhNw`Y%H1SN=QWuHU?y{a^6@a-}$%I+)N}8an72 z=sM{BnF;>C;QBo(_W!@)`pX*pYvAss|21vC|8D>~=-Qjx)BY#kKjZoO#VW%9gZugZ z9qyOE16(>wT|09_JNsW(4*v!Lt$)DYTClXi*dhQs0cq)d=Z^_Hn;!TO#(-sLCyJ)k zsavZDfsTOkNpBv8Dz$~YKd5DC|41uEwuqRDSXExAxVyftZmLjWu*UJOdkon?gbST| zXcn1(wuVzdgcFG(-HT!(`AF-k&zruU8~E7bq7@~xxO~Wa|L_D{cmmK6k@CA`<(V8X z?!~59QB8*Tu!_&HFwajkR<>F$Z)bQiAxG&HURe4cP4SiEI%7dyg8_PUMWhs zGuaOjj?F76{7Pi2N*Zt@cDI5*CX--t#~&aOn#N*cKw%|9DwY2=r|goFML^IXQXsgH zE;ak1eHWKY%wh=?tZ(eE5-^ z_2w3!5%J)eXph6W@NwHOA$jyFxthq+Kk>qKT$5p!Q1jFK!iUw(&t7!8bW2{xBhn2RO!E~DRC&t|gtb}toS`s=96^Z1 zFb5po0+hF>^w8jHGlu54dVH*+`hxXTi1Mb$5%4i4NrG)< zWC4Y-&M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&7w{2ieGbKV5p zpYtYOE|uS}+lenI910X7{tcr4a=X6NRQ{2ZUsb}(octp6Qa)Jmf>4gH71H09(7(}F z{*k(WGX3K|_4~$2c)|2gAQky<#`J|a@{i2@(i6VS+%G;a>u$gcJ~_VHD1TQzFNBhR zBOgSFLX{K4T@EAa2G->EP1awx$5vt0du&f(?t h`}ZpRkHz+@3YV3HhWS}Wf}#F=`@#SG@vB(_`(Ng4mmL5A literal 0 HcmV?d00001 From 5eebe8372653c65e3545c7133922599a479756cd Mon Sep 17 00:00:00 2001 From: Gregory Amerson Date: Mon, 10 Feb 2020 16:04:39 -0600 Subject: [PATCH 05/14] BLADE-509 fix pluginsSdkDir checking logic --- .../blade/cli/command/ConvertCommand.java | 30 +++++++++++-------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/cli/src/main/java/com/liferay/blade/cli/command/ConvertCommand.java b/cli/src/main/java/com/liferay/blade/cli/command/ConvertCommand.java index dd1bee6d2..16b16d659 100644 --- a/cli/src/main/java/com/liferay/blade/cli/command/ConvertCommand.java +++ b/cli/src/main/java/com/liferay/blade/cli/command/ConvertCommand.java @@ -85,18 +85,24 @@ public void execute() throws Exception { if (pluginsSdkDir == null) { if (gradleProperties != null) { - pluginsSdkDir = new File( - gradleProperties.getProperty(WorkspaceConstants.DEFAULT_PLUGINS_SDK_DIR_PROPERTY)); + String pluginsSdkDirValue = gradleProperties.getProperty( + WorkspaceConstants.DEFAULT_PLUGINS_SDK_DIR_PROPERTY); + + if (pluginsSdkDirValue != null) { + pluginsSdkDir = new File(projectDir, pluginsSdkDirValue); + } } if (pluginsSdkDir == null) { - pluginsSdkDir = new File(WorkspaceConstants.DEFAULT_PLUGINS_SDK_DIR); + pluginsSdkDir = new File(projectDir, WorkspaceConstants.DEFAULT_PLUGINS_SDK_DIR); } } - _assertTrue("pluginsSdkDir is not null", pluginsSdkDir != null); - _assertTrue("pluginsSdkDir exists", pluginsSdkDir.exists()); - _assertTrue("pluginsSdkDir is valid Plugins SDK", _isValidSDKDir(pluginsSdkDir)); + _assertTrue("pluginsSdkDir is null: %s", pluginsSdkDir != null); + _assertTrue(String.format("pluginsSdkDir does not exist: %s", pluginsSdkDir), pluginsSdkDir.exists()); + _assertTrue( + String.format("pluginsSdkDir is not a valid Plugins SDK dir: %s", pluginsSdkDir), + _isValidSDKDir(pluginsSdkDir)); File hooksDir = new File(pluginsSdkDir, "hooks"); File layouttplDir = new File(pluginsSdkDir, "layouttpl"); @@ -276,8 +282,8 @@ else if (convertArgs.isList()) { else { File pluginDir = _findPluginDir(pluginsSdkDir, pluginName); - _assertTrue("pluginDir is not null", pluginDir != null); - _assertTrue("pluginDir exists", pluginDir.exists()); + _assertTrue("pluginDir is null", pluginDir != null); + _assertTrue("pluginDir does not exists", pluginDir.exists()); Path pluginPath = pluginDir.toPath(); @@ -703,12 +709,10 @@ public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) th parent = parent.getParent(); } - if ((parent != null) && Files.exists(parent)) { - if (_isValidSDKDir(parent.toFile())) { - pluginDir[0] = dir.toFile(); + if ((parent != null) && Files.exists(parent) && _isValidSDKDir(parent.toFile())) { + pluginDir[0] = dir.toFile(); - return FileVisitResult.TERMINATE; - } + return FileVisitResult.TERMINATE; } } From 37ab2e3521bbf1f9ed4061e2a5c509d901cf2222 Mon Sep 17 00:00:00 2001 From: Gregory Amerson Date: Mon, 10 Feb 2020 16:04:58 -0600 Subject: [PATCH 06/14] BLADE-509 just always throw exception so it can be printed --- .../java/com/liferay/blade/cli/BladeCLI.java | 41 ++++--------------- 1 file changed, 9 insertions(+), 32 deletions(-) diff --git a/cli/src/main/java/com/liferay/blade/cli/BladeCLI.java b/cli/src/main/java/com/liferay/blade/cli/BladeCLI.java index 8943fb38b..c41dca0cc 100644 --- a/cli/src/main/java/com/liferay/blade/cli/BladeCLI.java +++ b/cli/src/main/java/com/liferay/blade/cli/BladeCLI.java @@ -513,44 +513,21 @@ else if (parameterMessage.contains("Main parameters are required")) { } } - public void runCommand() { - try { - if (_args.isHelp()) { - if (Objects.isNull(_command) || (_command.length() == 0)) { - printUsage(); - } - else { - printUsage(_command); - } + public void runCommand() throws Exception { + if (_args.isHelp()) { + if (Objects.isNull(_command) || (_command.length() == 0)) { + printUsage(); } else { - if (_args != null) { - _runCommand(); - } - else { - _jCommander.usage(); - } + printUsage(_command); } } - catch (ParameterException pe) { - throw pe; - } - catch (GradleExecutionException e) { - throw e; - } - catch (Exception e) { - Class exceptionClass = e.getClass(); - - String exceptionClassName = exceptionClass.getName(); - - error("error: " + exceptionClassName + " :: " + e.getMessage() + System.lineSeparator()); - - if (_args.isTrace()) { - e.printStackTrace(error()); + else { + if (_args != null) { + _runCommand(); } else { - error("\tat " + e.getStackTrace()[0] + System.lineSeparator()); - error("For more information run `blade " + _command + " --trace"); + _jCommander.usage(); } } } From 8849b673b6ced6c89a189e909107e63a9d3d40c3 Mon Sep 17 00:00:00 2001 From: Gregory Amerson Date: Mon, 10 Feb 2020 16:05:23 -0600 Subject: [PATCH 07/14] BLADE-509 fix tests --- .../blade/cli/command/ConvertCommandTest.java | 12 +++------- .../cli/command/ConvertThemeCommandTest.java | 22 +++++++++++++++++++ .../tasks-plugins-sdk/build.properties | 0 .../tasks-plugins-sdk/hooks/build.xml | 0 .../tasks-plugins-sdk/portlets/build.xml | 0 5 files changed, 25 insertions(+), 9 deletions(-) create mode 100644 cli/test-resources/projects/tasks-plugins-sdk/build.properties create mode 100644 cli/test-resources/projects/tasks-plugins-sdk/hooks/build.xml create mode 100644 cli/test-resources/projects/tasks-plugins-sdk/portlets/build.xml diff --git a/cli/src/test/java/com/liferay/blade/cli/command/ConvertCommandTest.java b/cli/src/test/java/com/liferay/blade/cli/command/ConvertCommandTest.java index 686d60e21..884384926 100644 --- a/cli/src/test/java/com/liferay/blade/cli/command/ConvertCommandTest.java +++ b/cli/src/test/java/com/liferay/blade/cli/command/ConvertCommandTest.java @@ -158,17 +158,11 @@ public void testFindPluginsSdkPlugin() throws Exception { "--base", workspacePath.toString(), "convert", "-s", pluginsSdkPath.toString(), "tasks-portlet" }; - BladeTestResults bladeTestResults = TestUtil.runBlade(_rootDir, _extensionsDir, args); + BladeTestResults bladeTestResults = TestUtil.runBlade(_rootDir, _extensionsDir, false, args); - Path tasksPortletPath = workspacePath.resolve("wars/tasks-portlet"); + String errors = bladeTestResults.getErrors(); - Assert.assertTrue( - bladeTestResults.getErrors() + "\n" + bladeTestResults.getOutput(), Files.exists(tasksPortletPath)); - - Assert.assertTrue(Files.exists(tasksPortletPath.resolve("build.gradle"))); - - Assert.assertTrue( - Files.exists(tasksPortletPath.resolve("src/main/webapp/WEB-INF/liferay--plugin-package.properties"))); + Assert.assertTrue(errors, errors.contains("pluginsSdkDir is not a valid Plugins SDK")); } @Test diff --git a/cli/src/test/java/com/liferay/blade/cli/command/ConvertThemeCommandTest.java b/cli/src/test/java/com/liferay/blade/cli/command/ConvertThemeCommandTest.java index 91bbe636a..1964671d5 100644 --- a/cli/src/test/java/com/liferay/blade/cli/command/ConvertThemeCommandTest.java +++ b/cli/src/test/java/com/liferay/blade/cli/command/ConvertThemeCommandTest.java @@ -143,6 +143,28 @@ private File _createWorkspace() throws Exception { _createTheme(workspace, "non-compass-theme", false); + File pluginsSdk = new File(workspace, "plugins-sdk"); + + File buildProperties = new File(pluginsSdk, "build.properties"); + + buildProperties.createNewFile(); + + File portletsDir = new File(workspace, "plugins-sdk/portlets"); + + portletsDir.mkdirs(); + + File buildXml = new File(portletsDir, "build.xml"); + + buildXml.createNewFile(); + + File hooksDir = new File(workspace, "plugins-sdk/hooks"); + + hooksDir.mkdirs(); + + buildXml = new File(hooksDir, "build.xml"); + + buildXml.createNewFile(); + return workspace; } diff --git a/cli/test-resources/projects/tasks-plugins-sdk/build.properties b/cli/test-resources/projects/tasks-plugins-sdk/build.properties new file mode 100644 index 000000000..e69de29bb diff --git a/cli/test-resources/projects/tasks-plugins-sdk/hooks/build.xml b/cli/test-resources/projects/tasks-plugins-sdk/hooks/build.xml new file mode 100644 index 000000000..e69de29bb diff --git a/cli/test-resources/projects/tasks-plugins-sdk/portlets/build.xml b/cli/test-resources/projects/tasks-plugins-sdk/portlets/build.xml new file mode 100644 index 000000000..e69de29bb From 4e67f8bdaa0ba5466a40579a32636b073de8de05 Mon Sep 17 00:00:00 2001 From: Gregory Amerson Date: Tue, 11 Feb 2020 16:44:37 -0600 Subject: [PATCH 08/14] BLADE-513 add support for 7.3 options --- build.gradle | 2 +- cli/build.gradle | 2 +- .../main/java/com/liferay/blade/cli/command/CreateArgs.java | 2 +- cli/src/main/java/com/liferay/blade/cli/command/InitArgs.java | 2 +- .../blade/cli/command/validator/LiferayVersionValidator.java | 3 ++- 5 files changed, 6 insertions(+), 5 deletions(-) diff --git a/build.gradle b/build.gradle index c6dc4d7db..3c3a03fe8 100644 --- a/build.gradle +++ b/build.gradle @@ -4,7 +4,7 @@ buildscript { dependencies { classpath group: "com.gradle", name: "build-scan-plugin", version: "2.0.2" classpath group: "com.liferay", name: "com.liferay.gradle.plugins.change.log.builder", version: "1.1.1" - classpath group: "com.liferay", name: "com.liferay.gradle.plugins.source.formatter", version: "2.3.479" + classpath group: "com.liferay", name: "com.liferay.gradle.plugins.source.formatter", version: "2.3.487" classpath group: "nu.studer", name: "gradle-credentials-plugin", version: "2.1" classpath group: "org.osgi", name: "osgi.core", version: "6.0.0" } diff --git a/cli/build.gradle b/cli/build.gradle index d4c090b37..040829ee2 100644 --- a/cli/build.gradle +++ b/cli/build.gradle @@ -73,7 +73,7 @@ dependencies { compile group: "biz.aQute.bnd", name: "biz.aQute.bndlib", version: "4.3.0" compile group: "com.liferay", name: "com.liferay.gogo.shell.client", version: "1.0.0" - compile group: "com.liferay", name: "com.liferay.project.templates", version: "5.0.20" + compile group: "com.liferay", name: "com.liferay.project.templates", version: "5.0.21" compile group: "commons-io", name: "commons-io", version: "2.6" compile group: "org.apache.commons", name: "commons-compress", version: "1.18" compile group: "org.apache.commons", name: "commons-lang3", version: "3.4" diff --git a/cli/src/main/java/com/liferay/blade/cli/command/CreateArgs.java b/cli/src/main/java/com/liferay/blade/cli/command/CreateArgs.java index a9df54e68..f8d5e4b37 100644 --- a/cli/src/main/java/com/liferay/blade/cli/command/CreateArgs.java +++ b/cli/src/main/java/com/liferay/blade/cli/command/CreateArgs.java @@ -201,7 +201,7 @@ public void setViewType(String viewType) { private String _hostBundleVersion; @Parameter( - description = "The version of Liferay to target when creating the project. Available options are 7.0, 7.1, 7.2.", + description = "The version of Liferay to target when creating the project. Available options are 7.0, 7.1, 7.2, 7.3.", names = {"-v", "--liferay-version"} ) private String _liferayVersion; diff --git a/cli/src/main/java/com/liferay/blade/cli/command/InitArgs.java b/cli/src/main/java/com/liferay/blade/cli/command/InitArgs.java index cb3026389..af5536ac3 100644 --- a/cli/src/main/java/com/liferay/blade/cli/command/InitArgs.java +++ b/cli/src/main/java/com/liferay/blade/cli/command/InitArgs.java @@ -72,7 +72,7 @@ public void setUpgrade(boolean upgrade) { private boolean _force; @Parameter( - description = "The version of Liferay to target for this workspace. Options are 7.0, 7.1, 7.2", + description = "The version of Liferay to target for this workspace. Options are 7.0, 7.1, 7.2, 7.3", names = {"--liferay-version", "-v"}, required = true, validateValueWith = LiferayVersionValidator.class ) @ParameterPossibleValues(LiferayVersionValidator.class) diff --git a/cli/src/main/java/com/liferay/blade/cli/command/validator/LiferayVersionValidator.java b/cli/src/main/java/com/liferay/blade/cli/command/validator/LiferayVersionValidator.java index eeaff44ca..13ff22e4d 100644 --- a/cli/src/main/java/com/liferay/blade/cli/command/validator/LiferayVersionValidator.java +++ b/cli/src/main/java/com/liferay/blade/cli/command/validator/LiferayVersionValidator.java @@ -23,12 +23,13 @@ /** * @author Christopher Bryan Boyd + * @author Gregory Amerson */ public class LiferayVersionValidator implements ValidatorSupplier { @Override public Collection get() { - return Arrays.asList("7.0", "7.1", "7.2"); + return Arrays.asList("7.0", "7.1", "7.2", "7.3"); } @Override From 1be46927142d75d21ab276f35123cb45d66f45c2 Mon Sep 17 00:00:00 2001 From: Gregory Amerson Date: Tue, 11 Feb 2020 16:44:49 -0600 Subject: [PATCH 09/14] BLADE-513 update tests to use 7.3 --- .../com/liferay/blade/cli/ExtensionsTest.java | 2 +- .../liferay/blade/cli/TargetPlatformTest.java | 2 +- .../java/com/liferay/blade/cli/UtilTest.java | 4 +-- .../blade/cli/command/ConvertCommandTest.java | 22 +++++++-------- .../ConvertServiceBuilderCommandTest.java | 10 +++---- .../blade/cli/command/CreateCommandTest.java | 28 +++++++++---------- .../blade/cli/command/DeployCommandTest.java | 6 ++-- .../blade/cli/command/InitCommandTest.java | 28 +++++++++---------- .../profile/BuildServiceCommandMavenTest.java | 2 +- .../maven/profile/DeployCommandMavenTest.java | 4 +-- .../maven/profile/InitCommandMavenTest.java | 14 +++++----- .../profile/ServerCommandsMavenTest.java | 2 +- .../sample/profile/ProfilesTest.java | 2 +- .../sample/SampleWorkspaceTemplateTest.java | 2 +- 14 files changed, 64 insertions(+), 64 deletions(-) diff --git a/cli/src/test/java/com/liferay/blade/cli/ExtensionsTest.java b/cli/src/test/java/com/liferay/blade/cli/ExtensionsTest.java index 647eed5c5..fc2e7b6fc 100644 --- a/cli/src/test/java/com/liferay/blade/cli/ExtensionsTest.java +++ b/cli/src/test/java/com/liferay/blade/cli/ExtensionsTest.java @@ -144,7 +144,7 @@ public void testLoadCommandsWithCustomExtensionInWorkspace() throws Exception { File workspaceDir = temporaryFolder.newFolder("build", "test", "workspace"); - String[] args = {"--base", workspaceDir.getPath(), "init", "-P", "foo", "-v", "7.2"}; + String[] args = {"--base", workspaceDir.getPath(), "init", "-P", "foo", "-v", "7.3"}; TestUtil.runBlade(_rootDir, _extensionsDir, args); diff --git a/cli/src/test/java/com/liferay/blade/cli/TargetPlatformTest.java b/cli/src/test/java/com/liferay/blade/cli/TargetPlatformTest.java index 5b9b62f1d..304b71aa2 100644 --- a/cli/src/test/java/com/liferay/blade/cli/TargetPlatformTest.java +++ b/cli/src/test/java/com/liferay/blade/cli/TargetPlatformTest.java @@ -48,7 +48,7 @@ public void setUp() throws Exception { _nonGradleWorkspaceDir = temporaryFolder.newFolder("non-gradle-workspace"); - String[] args = {"init", "--base", _gradleWorkspaceDir.getAbsolutePath(), "-v", "7.2"}; + String[] args = {"init", "--base", _gradleWorkspaceDir.getAbsolutePath(), "-v", "7.3"}; TestUtil.runBlade(_gradleWorkspaceDir, _extensionsDir, args); diff --git a/cli/src/test/java/com/liferay/blade/cli/UtilTest.java b/cli/src/test/java/com/liferay/blade/cli/UtilTest.java index 8f475f30e..97b939e4a 100644 --- a/cli/src/test/java/com/liferay/blade/cli/UtilTest.java +++ b/cli/src/test/java/com/liferay/blade/cli/UtilTest.java @@ -121,7 +121,7 @@ public void testMigrateBladeSettings() throws Exception { File extensionsDir = temporaryFolder.newFolder(".blade", "extensions"); - String[] args = {"--base", rootWorkspaceDir.getAbsolutePath(), "init", "-f", "foo", "-v", "7.2"}; + String[] args = {"--base", rootWorkspaceDir.getAbsolutePath(), "init", "-f", "foo", "-v", "7.3"}; File workspaceDirectory = new File(rootWorkspaceDir, "foo"); @@ -172,7 +172,7 @@ public void testNewBladeSettings() throws Exception { File extensionsDir = temporaryFolder.newFolder(".blade", "extensions"); - String[] args = {"--base", rootWorkspaceDir.getAbsolutePath(), "init", "-f", "foo", "-v", "7.2"}; + String[] args = {"--base", rootWorkspaceDir.getAbsolutePath(), "init", "-f", "foo", "-v", "7.3"}; File workspaceDirectory = new File(rootWorkspaceDir, "foo"); diff --git a/cli/src/test/java/com/liferay/blade/cli/command/ConvertCommandTest.java b/cli/src/test/java/com/liferay/blade/cli/command/ConvertCommandTest.java index 884384926..6130af931 100644 --- a/cli/src/test/java/com/liferay/blade/cli/command/ConvertCommandTest.java +++ b/cli/src/test/java/com/liferay/blade/cli/command/ConvertCommandTest.java @@ -64,7 +64,7 @@ public void testAll() throws Exception { FileUtil.deleteDirIfExists(pluginsSdkPath); - String[] args = {"--base", projectPath.toString(), "init", "-u", "-v", "7.2"}; + String[] args = {"--base", projectPath.toString(), "init", "-u", "-v", "7.3"}; TestUtil.runBlade(_rootDir, _extensionsDir, args); @@ -104,7 +104,7 @@ public void testAllNotRemoveSource() throws Exception { FileUtil.deleteDirIfExists(pluginsSdkPath); - String[] args = {"--base", projectPath.toString(), "init", "-u", "-v", "7.2"}; + String[] args = {"--base", projectPath.toString(), "init", "-u", "-v", "7.3"}; TestUtil.runBlade(_rootDir, _extensionsDir, args); @@ -150,7 +150,7 @@ public void testFindPluginsSdkPlugin() throws Exception { Files.createDirectories(workspacePath); - String[] args = {"--base", workspacePath.toString(), "init", "-v", "7.2"}; + String[] args = {"--base", workspacePath.toString(), "init", "-v", "7.3"}; TestUtil.runBlade(_rootDir, _extensionsDir, args); @@ -179,7 +179,7 @@ public void testMoveLayouttplToWars() throws Exception { FileUtil.deleteDirIfExists(pluginsSdkDir.toPath()); - String[] args = {"--base", projectDir.getPath(), "init", "-u", "-v", "7.2"}; + String[] args = {"--base", projectDir.getPath(), "init", "-u", "-v", "7.3"}; TestUtil.runBlade(_rootDir, _extensionsDir, args); @@ -218,7 +218,7 @@ public void testMoveLayouttplToWarsNotRemoveSource() throws Exception { FileUtil.deleteDirIfExists(pluginsSdkDir.toPath()); - String[] args = {"--base", projectDir.getPath(), "init", "-u", "-v", "7.2"}; + String[] args = {"--base", projectDir.getPath(), "init", "-u", "-v", "7.3"}; TestUtil.runBlade(_rootDir, _extensionsDir, args); @@ -267,7 +267,7 @@ public void testMovePluginsToWars() throws Exception { FileUtil.deleteDirIfExists(pluginsSdkDir); - String[] args = {"--base", projectDir.toString(), "init", "-u", "-v", "7.2"}; + String[] args = {"--base", projectDir.toString(), "init", "-u", "-v", "7.3"}; TestUtil.runBlade(_rootDir, _extensionsDir, args); @@ -312,7 +312,7 @@ public void testMovePluginsToWarsNotRemoveSource() throws Exception { FileUtil.deleteDirIfExists(pluginsSdkDir); - String[] args = {"--base", projectDir.toString(), "init", "-u", "-v", "7.2"}; + String[] args = {"--base", projectDir.toString(), "init", "-u", "-v", "7.3"}; TestUtil.runBlade(_rootDir, _extensionsDir, args); @@ -355,7 +355,7 @@ public void testMoveThemesToWars() throws Exception { FileUtil.deleteDirIfExists(pluginsSdkDir.toPath()); - String[] args = {"--base", projectDir.getPath(), "init", "-u", "-v", "7.2"}; + String[] args = {"--base", projectDir.getPath(), "init", "-u", "-v", "7.3"}; TestUtil.runBlade(_rootDir, _extensionsDir, args); @@ -438,7 +438,7 @@ public void testMoveThemesToWarsNotRemoveSource() throws Exception { FileUtil.deleteDirIfExists(pluginsSdkDir.toPath()); - String[] args = {"--base", projectDir.getPath(), "init", "-u", "-v", "7.2"}; + String[] args = {"--base", projectDir.getPath(), "init", "-u", "-v", "7.3"}; TestUtil.runBlade(_rootDir, _extensionsDir, args); @@ -574,7 +574,7 @@ public void testSourceParameter() throws Exception { File workspaceParent = new File(_rootDir, "workspace-parent"); - String[] args = {"--base", workspaceParent.getPath(), "init", "ws", "-v", "7.2"}; + String[] args = {"--base", workspaceParent.getPath(), "init", "ws", "-v", "7.3"}; TestUtil.runBlade(_rootDir, _extensionsDir, args); @@ -655,7 +655,7 @@ private File _setupWorkspace(String name) throws Exception { FileUtil.deleteDirIfExists(pluginsSdkDir.toPath()); - String[] args = {"--base", projectDir.getPath(), "init", "-u", "-v", "7.2"}; + String[] args = {"--base", projectDir.getPath(), "init", "-u", "-v", "7.3"}; TestUtil.runBlade(_rootDir, _extensionsDir, args); diff --git a/cli/src/test/java/com/liferay/blade/cli/command/ConvertServiceBuilderCommandTest.java b/cli/src/test/java/com/liferay/blade/cli/command/ConvertServiceBuilderCommandTest.java index 9ee672d48..ab92ecc82 100644 --- a/cli/src/test/java/com/liferay/blade/cli/command/ConvertServiceBuilderCommandTest.java +++ b/cli/src/test/java/com/liferay/blade/cli/command/ConvertServiceBuilderCommandTest.java @@ -57,7 +57,7 @@ public void testConvertServiceBuilder() throws Exception { FileUtil.deleteDirIfExists(pluginsSdkDir.toPath()); - String[] args = {"--base", projectDir.getPath(), "init", "-u", "-v", "7.2"}; + String[] args = {"--base", projectDir.getPath(), "init", "-u", "-v", "7.3"}; TestUtil.runBlade(_rootDir, _extensionsDir, args); @@ -135,7 +135,7 @@ public void testConvertServiceBuilder() throws Exception { public void testConvertServiceBuilderTasksPortletCustomName() throws Exception { File testdir = new File(temporaryFolder.getRoot(), "build/test-tasks-portlet-conversion"); - String[] args = {"--base", testdir.getPath(), "init", "-u", "-v", "7.2"}; + String[] args = {"--base", testdir.getPath(), "init", "-u", "-v", "7.3"}; TestUtil.runBlade(_rootDir, _extensionsDir, args); @@ -160,7 +160,7 @@ public void testConvertServiceBuilderTasksPortletCustomName() throws Exception { public void testConvertServiceBuilderTasksPortletDefaultName() throws Exception { File testdir = new File(temporaryFolder.getRoot(), "build/test-tasks-portlet-conversion"); - String[] args = {"--base", testdir.getPath(), "init", "-u", "-v", "7.2"}; + String[] args = {"--base", testdir.getPath(), "init", "-u", "-v", "7.3"}; TestUtil.runBlade(_rootDir, _extensionsDir, args); @@ -226,7 +226,7 @@ public void testConvertServiceBuilderWithoutRemove() throws Exception { FileUtil.deleteDirIfExists(pluginsSdkDir.toPath()); - String[] args = {"--base", projectDir.getPath(), "init", "-u", "-v", "7.2"}; + String[] args = {"--base", projectDir.getPath(), "init", "-u", "-v", "7.3"}; TestUtil.runBlade(_rootDir, _extensionsDir, args); @@ -267,7 +267,7 @@ public void testConvertServiceBuilderWithRemove() throws Exception { FileUtil.deleteDirIfExists(pluginsSdkDir.toPath()); - String[] args = {"--base", projectDir.getPath(), "init", "-u", "-v", "7.2"}; + String[] args = {"--base", projectDir.getPath(), "init", "-u", "-v", "7.3"}; TestUtil.runBlade(_rootDir, _extensionsDir, args); diff --git a/cli/src/test/java/com/liferay/blade/cli/command/CreateCommandTest.java b/cli/src/test/java/com/liferay/blade/cli/command/CreateCommandTest.java index 555ccbba2..72bfe0b06 100644 --- a/cli/src/test/java/com/liferay/blade/cli/command/CreateCommandTest.java +++ b/cli/src/test/java/com/liferay/blade/cli/command/CreateCommandTest.java @@ -744,7 +744,7 @@ public void testCreateSimulationPanelEntry() throws Exception { public void testCreateSpringMvcPortlet() throws Exception { String[] args = { "create", "-d", _rootDir.getAbsolutePath(), "-t", "spring-mvc-portlet", "springtest", "--package-name", - "com.test", "--classname", "Sample", "--framework", "springportletmvc", "--view-type", "jsp", "-v", "7.2" + "com.test", "--classname", "Sample", "--framework", "springportletmvc", "--view-type", "jsp", "-v", "7.3" }; TestUtil.runBlade(_rootDir, _extensionsDir, args); @@ -1287,21 +1287,21 @@ public void testCreateWorkspaceLiferayVersion71() throws Exception { @Test public void testCreateWorkspaceLiferayVersionDefault() throws Exception { - File workspace72 = new File(_rootDir, "workspace72"); + File workspace73 = new File(_rootDir, "workspace73"); - File modulesDir = new File(workspace72, "modules"); + File modulesDir = new File(workspace73, "modules"); - _makeWorkspace(workspace72); + _makeWorkspace(workspace73); - String[] sevenTwoArgs = {"--base", workspace72.getAbsolutePath(), "create", "-t", "portlet", "seven-two"}; + String[] sevenThreeArgs = {"--base", workspace73.getAbsolutePath(), "create", "-t", "portlet", "seven-three"}; - TestUtil.runBlade(workspace72, _extensionsDir, sevenTwoArgs); + TestUtil.runBlade(workspace73, _extensionsDir, sevenThreeArgs); - File buildGradle = new File(modulesDir, "seven-two/build.gradle"); + File buildGradle = new File(modulesDir, "seven-three/build.gradle"); String content = FileUtil.read(buildGradle); - Assert.assertTrue(content, content.contains("\"com.liferay.portal.kernel\", version: \"4.4.0\"")); + Assert.assertTrue(content, content.contains("\"com.liferay.portal.kernel\", version: \"5.4.0\"")); } @Test @@ -1584,15 +1584,15 @@ public void testLiferayVersion71() throws Exception { @Test public void testLiferayVersionDefault() throws Exception { - String[] sevenTwoArgs = {"--base", _rootDir.getAbsolutePath(), "create", "-t", "portlet", "seven-two"}; + String[] sevenThreeArgs = {"--base", _rootDir.getAbsolutePath(), "create", "-t", "portlet", "seven-three"}; - TestUtil.runBlade(_rootDir, _extensionsDir, sevenTwoArgs); + TestUtil.runBlade(_rootDir, _extensionsDir, sevenThreeArgs); - File buildGradle = new File(_rootDir, "seven-two/build.gradle"); + File buildGradle = new File(_rootDir, "seven-three/build.gradle"); String content = FileUtil.read(buildGradle); - Assert.assertTrue(content, content.contains("\"com.liferay.portal.kernel\", version: \"4.4.0\"")); + Assert.assertTrue(content, content.contains("\"com.liferay.portal.kernel\", version: \"5.4.0\"")); } @Test @@ -1701,7 +1701,7 @@ private void _lacks(File file, String regex) throws Exception { private void _makeWorkspace(File workspace) throws Exception { File parentFile = workspace.getParentFile(); - String[] args = {"--base", parentFile.getPath(), "init", workspace.getName(), "-v", "7.2"}; + String[] args = {"--base", parentFile.getPath(), "init", workspace.getName(), "-v", "7.3"}; TestUtil.runBlade(workspace, _extensionsDir, args); @@ -1712,7 +1712,7 @@ private void _makeWorkspace(File workspace) throws Exception { properties.load(inputStream); - Assert.assertEquals("7.2", properties.getProperty("liferay.version.default")); + Assert.assertEquals("7.3", properties.getProperty("liferay.version.default")); } } diff --git a/cli/src/test/java/com/liferay/blade/cli/command/DeployCommandTest.java b/cli/src/test/java/com/liferay/blade/cli/command/DeployCommandTest.java index 26f0a3fd5..e6ab1327c 100644 --- a/cli/src/test/java/com/liferay/blade/cli/command/DeployCommandTest.java +++ b/cli/src/test/java/com/liferay/blade/cli/command/DeployCommandTest.java @@ -52,7 +52,7 @@ public void setUp() throws Exception { public void testInstallJar() throws Exception { File workspaceDir = temporaryFolder.newFolder(); - String[] args = {"--base", workspaceDir.getPath(), "init", "-v", "7.2"}; + String[] args = {"--base", workspaceDir.getPath(), "init", "-v", "7.3"}; TestUtil.runBlade(workspaceDir, _extensionsDir, args); @@ -109,7 +109,7 @@ public void testInstallJarStandalone() throws Exception { File standaloneDir = temporaryFolder.newFolder(); - String[] args = {"--base", workspaceDir.getPath(), "init", "-v", "7.2"}; + String[] args = {"--base", workspaceDir.getPath(), "init", "-v", "7.3"}; TestUtil.runBlade(workspaceDir, _extensionsDir, args); @@ -159,7 +159,7 @@ public void testInstallJarStandalone() throws Exception { public void testInstallWar() throws Exception { File workspaceDir = temporaryFolder.newFolder(); - String[] args = {"--base", workspaceDir.getPath(), "init", "-v", "7.2"}; + String[] args = {"--base", workspaceDir.getPath(), "init", "-v", "7.3"}; TestUtil.runBlade(workspaceDir, _extensionsDir, args); diff --git a/cli/src/test/java/com/liferay/blade/cli/command/InitCommandTest.java b/cli/src/test/java/com/liferay/blade/cli/command/InitCommandTest.java index e8b3585b4..72e340e32 100644 --- a/cli/src/test/java/com/liferay/blade/cli/command/InitCommandTest.java +++ b/cli/src/test/java/com/liferay/blade/cli/command/InitCommandTest.java @@ -70,7 +70,7 @@ public void testBladeInitDontLoseGitDirectory() throws Exception { FileUtil.deleteDirIfExists(pluginsSdkDir.toPath()); - String[] args = {"--base", projectDir.getPath(), "init", "-u", "-v", "7.2"}; + String[] args = {"--base", projectDir.getPath(), "init", "-u", "-v", "7.3"}; TestUtil.runBlade(_workspaceDir, _extensionsDir, args); @@ -87,7 +87,7 @@ public void testBladeInitDontLoseGitDirectory() throws Exception { public void testBladeInitEmptyDirectory() throws Exception { File emptyDir = temporaryFolder.newFolder(); - String[] args = {"--base", emptyDir.getPath(), "init", "-v", "7.2"}; + String[] args = {"--base", emptyDir.getPath(), "init", "-v", "7.3"}; BladeTest bladeTest = _getBladeTestCustomWorkspace(emptyDir); @@ -106,7 +106,7 @@ public void testBladeInitEmptyDirectoryHandleDot() throws Exception { emptyDir.getPath(), "." ).getAbsolutePath(); - String[] args = {"--base", pathStringToTest, "init", "-v", "7.2"}; + String[] args = {"--base", pathStringToTest, "init", "-v", "7.3"}; BladeTest bladeTest = _getBladeTestCustomWorkspace(emptyDir); @@ -125,7 +125,7 @@ public void testBladeInitEmptyDirectoryHandleTwoDots() throws Exception { emptyDir.getPath(), "." ).getAbsolutePath(); - String[] args = {"--base", pathStringToTest, "init", ".", "-v", "7.2"}; + String[] args = {"--base", pathStringToTest, "init", ".", "-v", "7.3"}; BladeTest bladeTest = _getBladeTestCustomWorkspace(emptyDir); @@ -177,7 +177,7 @@ public void testBladeInitWithCustomProfile() throws Exception { tempDir.getPath() ).getAbsolutePath(); - String[] args = {"--base", basePath, "init", "-P", "myprofile", "-v", "7.2"}; + String[] args = {"--base", basePath, "init", "-P", "myprofile", "-v", "7.3"}; TestUtil.runBlade(tempDir, _extensionsDir, args); @@ -196,7 +196,7 @@ public void testBladeInitWithCustomProfile() throws Exception { @Test public void testDefaultInitWorkspaceDirectoryEmpty() throws Exception { - String[] args = {"--base", _workspaceDir.getPath(), "init", "-v", "7.2"}; + String[] args = {"--base", _workspaceDir.getPath(), "init", "-v", "7.3"}; TestUtil.runBlade(_workspaceDir, _extensionsDir, args); @@ -236,7 +236,7 @@ public void testDefaultInitWorkspaceDirectoryHasFiles() throws Exception { @Test public void testDefaultInitWorkspaceDirectoryHasFilesForce() throws Exception { - String[] args = {"--base", _workspaceDir.getPath(), "init", "-f", "-v", "7.2"}; + String[] args = {"--base", _workspaceDir.getPath(), "init", "-f", "-v", "7.3"}; TestUtil.runBlade(_workspaceDir, _extensionsDir, args); @@ -255,13 +255,13 @@ public void testDefaultInitWorkspaceDirectoryHasFilesForce() throws Exception { @Test public void testDefaultInitWorkspaceDirectoryIsWorkspace() throws Exception { - String[] args = {"--base", _workspaceDir.getPath(), "init", "firstWorkspace", "-v", "7.2"}; + String[] args = {"--base", _workspaceDir.getPath(), "init", "firstWorkspace", "-v", "7.3"}; TestUtil.runBlade(_workspaceDir, _extensionsDir, args); File firstWorkspace = new File(_workspaceDir, "firstWorkspace"); - String[] moreArgs = {"--base", firstWorkspace.getPath(), "init", "nextWorkspace", "-v", "7.2"}; + String[] moreArgs = {"--base", firstWorkspace.getPath(), "init", "nextWorkspace", "-v", "7.3"}; TestUtil.runBlade(_workspaceDir, _extensionsDir, false, args); @@ -289,7 +289,7 @@ public void testDefaultInitWorkspaceDirectoryIsWorkspace() throws Exception { @Test public void testInitCommandGradleOption() throws Exception { - String[] args = {"--base", _workspaceDir.getPath(), "init", "-b", "gradle", "gradleworkspace", "-v", "7.2"}; + String[] args = {"--base", _workspaceDir.getPath(), "init", "-b", "gradle", "gradleworkspace", "-v", "7.3"}; TestUtil.runBlade(_workspaceDir, _extensionsDir, args); @@ -308,7 +308,7 @@ public void testInitCommandGradleOption() throws Exception { @Test public void testInitInPluginsSDKDirectory() throws Exception { - String[] args = {"--base", _workspaceDir.getPath(), "init", "-u", "-v", "7.2"}; + String[] args = {"--base", _workspaceDir.getPath(), "init", "-u", "-v", "7.3"}; _makeSDK(_workspaceDir); @@ -398,7 +398,7 @@ public void testInitWithLiferayVersionUnset() throws Exception { @Test public void testInitWithNameWorkspaceDirectoryEmpty() throws Exception { - String[] args = {"--base", _workspaceDir.getPath(), "init", "newproject", "-v", "7.2"}; + String[] args = {"--base", _workspaceDir.getPath(), "init", "newproject", "-v", "7.3"}; Path newproject = _workspacePath.resolve("newproject"); @@ -439,7 +439,7 @@ public void testInitWithNameWorkspaceDirectoryEmpty() throws Exception { @Test public void testInitWithNameWorkspaceDirectoryHasFiles() throws Exception { - String[] args = {"--base", _workspaceDir.getPath(), "init", "newproject", "-v", "7.2"}; + String[] args = {"--base", _workspaceDir.getPath(), "init", "newproject", "-v", "7.3"}; Path newProjectPath = _workspacePath.resolve("newproject"); @@ -462,7 +462,7 @@ public void testInitWithNameWorkspaceDirectoryHasFiles() throws Exception { @Test public void testInitWithNameWorkspaceNotExists() throws Exception { - String[] args = {"--base", _workspaceDir.getPath(), "init", "newproject", "-v", "7.2"}; + String[] args = {"--base", _workspaceDir.getPath(), "init", "newproject", "-v", "7.3"}; TestUtil.runBlade(_workspaceDir, _extensionsDir, args); diff --git a/extensions/maven-profile/src/test/java/com/liferay/blade/extensions/maven/profile/BuildServiceCommandMavenTest.java b/extensions/maven-profile/src/test/java/com/liferay/blade/extensions/maven/profile/BuildServiceCommandMavenTest.java index 2a1de09ca..13a0eb543 100644 --- a/extensions/maven-profile/src/test/java/com/liferay/blade/extensions/maven/profile/BuildServiceCommandMavenTest.java +++ b/extensions/maven-profile/src/test/java/com/liferay/blade/extensions/maven/profile/BuildServiceCommandMavenTest.java @@ -45,7 +45,7 @@ public void setUp() throws Exception { @Test public void testMavenServiceBuilder() throws Exception { - String[] args = {"--base", _workspaceDir.getPath(), "init", "-P", "maven", "mavenworkspace", "-v", "7.2"}; + String[] args = {"--base", _workspaceDir.getPath(), "init", "-P", "maven", "mavenworkspace", "-v", "7.3"}; File mavenworkspace = new File(_workspaceDir, "mavenworkspace"); diff --git a/extensions/maven-profile/src/test/java/com/liferay/blade/extensions/maven/profile/DeployCommandMavenTest.java b/extensions/maven-profile/src/test/java/com/liferay/blade/extensions/maven/profile/DeployCommandMavenTest.java index 2e533b788..27ff2f6fd 100644 --- a/extensions/maven-profile/src/test/java/com/liferay/blade/extensions/maven/profile/DeployCommandMavenTest.java +++ b/extensions/maven-profile/src/test/java/com/liferay/blade/extensions/maven/profile/DeployCommandMavenTest.java @@ -40,7 +40,7 @@ public void setUp() throws Exception { public void testInstallJar() throws Exception { File workspaceDir = temporaryFolder.newFolder(); - String[] args = {"--base", workspaceDir.getPath(), "-P", "maven", "init", "-v", "7.2"}; + String[] args = {"--base", workspaceDir.getPath(), "-P", "maven", "init", "-v", "7.3"}; TestUtil.runBlade(workspaceDir, _extensionsDir, args); @@ -93,7 +93,7 @@ public void testInstallJar() throws Exception { public void testInstallWar() throws Exception { File workspaceDir = temporaryFolder.newFolder(); - String[] args = {"--base", workspaceDir.getPath(), "-P", "maven", "init", "-v", "7.2"}; + String[] args = {"--base", workspaceDir.getPath(), "-P", "maven", "init", "-v", "7.3"}; TestUtil.runBlade(workspaceDir, _extensionsDir, args); diff --git a/extensions/maven-profile/src/test/java/com/liferay/blade/extensions/maven/profile/InitCommandMavenTest.java b/extensions/maven-profile/src/test/java/com/liferay/blade/extensions/maven/profile/InitCommandMavenTest.java index ae8029bd5..5cc1440ef 100644 --- a/extensions/maven-profile/src/test/java/com/liferay/blade/extensions/maven/profile/InitCommandMavenTest.java +++ b/extensions/maven-profile/src/test/java/com/liferay/blade/extensions/maven/profile/InitCommandMavenTest.java @@ -48,7 +48,7 @@ public void setUp() throws Exception { @Test public void testMavenInitProjectCorrectLocation() throws Exception { - String[] args = {"--base", _workspaceDir.getPath(), "init", "-P", "maven", "mavenworkspace", "-v", "7.2"}; + String[] args = {"--base", _workspaceDir.getPath(), "init", "-P", "maven", "mavenworkspace", "-v", "7.3"}; File mavenworkspace = new File(_workspaceDir, "mavenworkspace"); @@ -71,7 +71,7 @@ public void testMavenInitProjectCorrectLocation() throws Exception { @Test public void testMavenInitWithNameWorkspaceDirectoryEmpty() throws Exception { - String[] args = {"--base", _workspaceDir.getPath(), "init", "-P", "maven", "newproject", "-v", "7.2"}; + String[] args = {"--base", _workspaceDir.getPath(), "init", "-P", "maven", "newproject", "-v", "7.3"}; File newproject = new File(_workspaceDir, "newproject"); @@ -114,7 +114,7 @@ public void testMavenInitWithNameWorkspaceDirectoryEmpty() throws Exception { @Test public void testMavenInitWithNameWorkspaceDirectoryHasFiles() throws Exception { - String[] args = {"--base", _workspaceDir.getPath(), "init", "-P", "maven", "newproject", "-v", "7.2"}; + String[] args = {"--base", _workspaceDir.getPath(), "init", "-P", "maven", "newproject", "-v", "7.3"}; File projectDir = new File(_workspaceDir, "newproject"); @@ -135,7 +135,7 @@ public void testMavenInitWithNameWorkspaceDirectoryHasFiles() throws Exception { @Test public void testMavenInitWithNameWorkspaceNotExists() throws Exception { - String[] args = {"--base", _workspaceDir.getPath(), "init", "-P", "maven", "newproject", "-v", "7.2"}; + String[] args = {"--base", _workspaceDir.getPath(), "init", "-P", "maven", "newproject", "-v", "7.3"}; File projectDir = new File(_workspaceDir, "newproject"); @@ -154,7 +154,7 @@ public void testMavenInitWithNameWorkspaceNotExists() throws Exception { @Test public void testMavenInitWorkspaceDirectoryEmpty() throws Exception { - String[] args = {"--base", _workspaceDir.getPath(), "init", "-P", "maven", "-v", "7.2"}; + String[] args = {"--base", _workspaceDir.getPath(), "init", "-P", "maven", "-v", "7.3"}; TestUtil.runBlade(_workspaceDir, _extensionsDir, args); @@ -193,7 +193,7 @@ public void testMavenInitWorkspaceDirectoryEmpty() throws Exception { @Test public void testMavenInitWorkspaceDirectoryHasFiles() throws Exception { - String[] args = {"--base", _workspaceDir.getPath(), "init", "-P", "maven", "-v", "7.2"}; + String[] args = {"--base", _workspaceDir.getPath(), "init", "-P", "maven", "-v", "7.3"}; Assert.assertTrue( new File( @@ -210,7 +210,7 @@ public void testMavenInitWorkspaceDirectoryHasFiles() throws Exception { @Test public void testMavenInitWorkspaceDirectoryHasFilesForce() throws Exception { - String[] args = {"--base", _workspaceDir.getPath(), "init", "-f", "-P", "maven", "-v", "7.2"}; + String[] args = {"--base", _workspaceDir.getPath(), "init", "-f", "-P", "maven", "-v", "7.3"}; TestUtil.runBlade(_workspaceDir, _extensionsDir, args); diff --git a/extensions/maven-profile/src/test/java/com/liferay/blade/extensions/maven/profile/ServerCommandsMavenTest.java b/extensions/maven-profile/src/test/java/com/liferay/blade/extensions/maven/profile/ServerCommandsMavenTest.java index 73fc62fe8..46cd8bf91 100644 --- a/extensions/maven-profile/src/test/java/com/liferay/blade/extensions/maven/profile/ServerCommandsMavenTest.java +++ b/extensions/maven-profile/src/test/java/com/liferay/blade/extensions/maven/profile/ServerCommandsMavenTest.java @@ -40,7 +40,7 @@ public void testServerInit() throws Exception { File workspaceDir = temporaryFolder.newFolder("build", "test", "workspace"); - String[] args = {"--base", workspaceDir.getPath(), "init", "-f", "-P", "maven", "-v", "7.2"}; + String[] args = {"--base", workspaceDir.getPath(), "init", "-f", "-P", "maven", "-v", "7.3"}; TestUtil.runBlade(workspaceDir, extensionsDir, args); diff --git a/extensions/sample-profile/src/test/java/com/liferay/extensions/sample/profile/ProfilesTest.java b/extensions/sample-profile/src/test/java/com/liferay/extensions/sample/profile/ProfilesTest.java index 720a726e6..e6d3d70ae 100644 --- a/extensions/sample-profile/src/test/java/com/liferay/extensions/sample/profile/ProfilesTest.java +++ b/extensions/sample-profile/src/test/java/com/liferay/extensions/sample/profile/ProfilesTest.java @@ -44,7 +44,7 @@ public void setUp() throws Exception { public void testProfileExtension() throws Exception { File workspaceDir = temporaryFolder.newFolder("build", "test", "workspace"); - String[] args = {"--base", workspaceDir.getPath(), "init", "-b", "foo", "-v", "7.2"}; + String[] args = {"--base", workspaceDir.getPath(), "init", "-b", "foo", "-v", "7.3"}; BladeTestResults results = TestUtil.runBlade(_rootDir, _extensionsDir, args); diff --git a/extensions/sample-workspace-template/src/test/java/com/liferay/project/templates/sample/SampleWorkspaceTemplateTest.java b/extensions/sample-workspace-template/src/test/java/com/liferay/project/templates/sample/SampleWorkspaceTemplateTest.java index f890114bf..e8a746db1 100644 --- a/extensions/sample-workspace-template/src/test/java/com/liferay/project/templates/sample/SampleWorkspaceTemplateTest.java +++ b/extensions/sample-workspace-template/src/test/java/com/liferay/project/templates/sample/SampleWorkspaceTemplateTest.java @@ -55,7 +55,7 @@ public void testProjectTemplatesWithCustom() throws Exception { String basePath = tempDir.getAbsolutePath(); - String[] args = {"--base", basePath, "init", "-P", "sample", "-v", "7.2"}; + String[] args = {"--base", basePath, "init", "-P", "sample", "-v", "7.3"}; TestUtil.runBlade(_rootDir, _extensionsDir, args); From 5c09faa51fa42c7418f5dbcc358c3cd72de58745 Mon Sep 17 00:00:00 2001 From: Gregory Amerson Date: Tue, 11 Feb 2020 17:20:06 -0600 Subject: [PATCH 10/14] BLADE-513 fix tests --- .../com/liferay/blade/cli/command/CreateCommandTest.java | 8 ++++---- .../extensions/maven/profile/DeployCommandMavenTest.java | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cli/src/test/java/com/liferay/blade/cli/command/CreateCommandTest.java b/cli/src/test/java/com/liferay/blade/cli/command/CreateCommandTest.java index 72bfe0b06..e205cc00b 100644 --- a/cli/src/test/java/com/liferay/blade/cli/command/CreateCommandTest.java +++ b/cli/src/test/java/com/liferay/blade/cli/command/CreateCommandTest.java @@ -1584,15 +1584,15 @@ public void testLiferayVersion71() throws Exception { @Test public void testLiferayVersionDefault() throws Exception { - String[] sevenThreeArgs = {"--base", _rootDir.getAbsolutePath(), "create", "-t", "portlet", "seven-three"}; + String[] args = {"--base", _rootDir.getAbsolutePath(), "create", "-t", "mvc-portlet", "foo"}; - TestUtil.runBlade(_rootDir, _extensionsDir, sevenThreeArgs); + TestUtil.runBlade(_rootDir, _extensionsDir, args); - File buildGradle = new File(_rootDir, "seven-three/build.gradle"); + File buildGradle = new File(_rootDir, "foo/build.gradle"); String content = FileUtil.read(buildGradle); - Assert.assertTrue(content, content.contains("\"com.liferay.portal.kernel\", version: \"5.4.0\"")); + Assert.assertTrue(content, content.contains("\"com.liferay.portal.kernel\", version: \"4.4.0\"")); } @Test diff --git a/extensions/maven-profile/src/test/java/com/liferay/blade/extensions/maven/profile/DeployCommandMavenTest.java b/extensions/maven-profile/src/test/java/com/liferay/blade/extensions/maven/profile/DeployCommandMavenTest.java index 27ff2f6fd..2e533b788 100644 --- a/extensions/maven-profile/src/test/java/com/liferay/blade/extensions/maven/profile/DeployCommandMavenTest.java +++ b/extensions/maven-profile/src/test/java/com/liferay/blade/extensions/maven/profile/DeployCommandMavenTest.java @@ -40,7 +40,7 @@ public void setUp() throws Exception { public void testInstallJar() throws Exception { File workspaceDir = temporaryFolder.newFolder(); - String[] args = {"--base", workspaceDir.getPath(), "-P", "maven", "init", "-v", "7.3"}; + String[] args = {"--base", workspaceDir.getPath(), "-P", "maven", "init", "-v", "7.2"}; TestUtil.runBlade(workspaceDir, _extensionsDir, args); @@ -93,7 +93,7 @@ public void testInstallJar() throws Exception { public void testInstallWar() throws Exception { File workspaceDir = temporaryFolder.newFolder(); - String[] args = {"--base", workspaceDir.getPath(), "-P", "maven", "init", "-v", "7.3"}; + String[] args = {"--base", workspaceDir.getPath(), "-P", "maven", "init", "-v", "7.2"}; TestUtil.runBlade(workspaceDir, _extensionsDir, args); From 72ca39a83435481594d2da8a29dd6b6f1f2e4a15 Mon Sep 17 00:00:00 2001 From: Gregory Amerson Date: Wed, 12 Feb 2020 00:06:06 -0600 Subject: [PATCH 11/14] update docker build to use local bundles directory --- build.gradle | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build.gradle b/build.gradle index 3c3a03fe8..5d89131fe 100644 --- a/build.gradle +++ b/build.gradle @@ -92,6 +92,8 @@ dockerPublishSnapshots { args.addAll(['-v', "${userHome}/.gradle/wrapper:/root/.gradle/wrapper"]) + args.addAll(['-v', "${userHome}/.liferay/bundles:/root/.liferay/bundles"]) + if (gradleCredentialsProperties.exists()) { args.addAll(['-v', "${userHome}/.gradle/gradle.credentials.properties:/root/.gradle/gradle.encrypted.properties"]) } From 9dca9979c0f393c3110ef06a65628f4914588d83 Mon Sep 17 00:00:00 2001 From: Gregory Amerson Date: Wed, 12 Feb 2020 14:40:25 -0600 Subject: [PATCH 12/14] BLADE-510 Better dependency resolution process - Use Ant to load build.properties - For any jar that we don't know GAV try to look it up in META-INF --- cli/bnd.bnd | 11 + cli/build.gradle | 1 + .../blade/cli/command/ConvertCommand.java | 305 +++++++++++--- .../command/ConvertServiceBuilderCommand.java | 2 - .../portal-dependency-jars-62.properties | 372 +++++++++--------- 5 files changed, 444 insertions(+), 247 deletions(-) diff --git a/cli/bnd.bnd b/cli/bnd.bnd index dcbff82de..c612e2875 100644 --- a/cli/bnd.bnd +++ b/cli/bnd.bnd @@ -23,6 +23,17 @@ Private-Package:\ com.liferay.gogo.shell.client,\ com.liferay.properties.locator,\ \ + org.apache.tools.ant,\ + org.apache.tools.ant.filters,\ + org.apache.tools.ant.filters.util,\ + org.apache.tools.ant.input,\ + org.apache.tools.ant.property,\ + org.apache.tools.ant.taskdefs,\ + org.apache.tools.ant.taskdefs.condition,\ + org.apache.tools.ant.types,\ + org.apache.tools.ant.types.resources,\ + org.apache.tools.ant.util,\ + \ org.apache.commons.compress.archivers,\ org.apache.commons.compress.archivers.tar,\ org.apache.commons.compress.archivers.zip,\ diff --git a/cli/build.gradle b/cli/build.gradle index 040829ee2..e93a995a3 100644 --- a/cli/build.gradle +++ b/cli/build.gradle @@ -75,6 +75,7 @@ dependencies { compile group: "com.liferay", name: "com.liferay.gogo.shell.client", version: "1.0.0" compile group: "com.liferay", name: "com.liferay.project.templates", version: "5.0.21" compile group: "commons-io", name: "commons-io", version: "2.6" + compile group: "org.apache.ant", name: "ant", version: "1.10.7" compile group: "org.apache.commons", name: "commons-compress", version: "1.18" compile group: "org.apache.commons", name: "commons-lang3", version: "3.4" compile group: "org.apache.maven", name: "maven-aether-provider", version: "3.3.9" diff --git a/cli/src/main/java/com/liferay/blade/cli/command/ConvertCommand.java b/cli/src/main/java/com/liferay/blade/cli/command/ConvertCommand.java index 16b16d659..1d0d69539 100644 --- a/cli/src/main/java/com/liferay/blade/cli/command/ConvertCommand.java +++ b/cli/src/main/java/com/liferay/blade/cli/command/ConvertCommand.java @@ -27,6 +27,7 @@ import java.io.File; import java.io.FileFilter; import java.io.FileInputStream; +import java.io.FileNotFoundException; import java.io.FilenameFilter; import java.io.IOException; import java.io.InputStream; @@ -42,15 +43,22 @@ import java.util.ArrayList; import java.util.Arrays; +import java.util.Enumeration; import java.util.List; import java.util.Objects; +import java.util.Optional; import java.util.Properties; +import java.util.jar.JarEntry; +import java.util.jar.JarFile; import java.util.stream.Collectors; import java.util.stream.Stream; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; +import org.apache.tools.ant.Project; +import org.apache.tools.ant.taskdefs.LoadProperties; + import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.NamedNodeMap; @@ -81,22 +89,7 @@ public void execute() throws Exception { Properties gradleProperties = workspaceProviderGradle.getGradleProperties(projectDir); - File pluginsSdkDir = convertArgs.getSource(); - - if (pluginsSdkDir == null) { - if (gradleProperties != null) { - String pluginsSdkDirValue = gradleProperties.getProperty( - WorkspaceConstants.DEFAULT_PLUGINS_SDK_DIR_PROPERTY); - - if (pluginsSdkDirValue != null) { - pluginsSdkDir = new File(projectDir, pluginsSdkDirValue); - } - } - - if (pluginsSdkDir == null) { - pluginsSdkDir = new File(projectDir, WorkspaceConstants.DEFAULT_PLUGINS_SDK_DIR); - } - } + final File pluginsSdkDir = _getPluginsSdkDir(convertArgs, projectDir, gradleProperties); _assertTrue("pluginsSdkDir is null: %s", pluginsSdkDir != null); _assertTrue(String.format("pluginsSdkDir does not exist: %s", pluginsSdkDir), pluginsSdkDir.exists()); @@ -214,14 +207,14 @@ public boolean accept(File pathname) { serviceBuilderPluginStream.forEach( serviceBuilderPlugin -> _convertToServiceBuilderWarProject( - warsDir, serviceBuilderPlugin, removeSource)); + pluginsSdkDir, warsDir, serviceBuilderPlugin, removeSource)); Stream portletPluginStream = portletPlugins.stream(); portletPluginStream.forEach( portalPlugin -> { try { - _convertToWarProject(warsDir, portalPlugin, removeSource); + _convertToWarProject(pluginsSdkDir, warsDir, portalPlugin, removeSource); } catch (Exception e) { e.printStackTrace(bladeCLI.error()); @@ -233,7 +226,7 @@ public boolean accept(File pathname) { hookPluginStream.forEach( hookPlugin -> { try { - _convertToWarProject(warsDir, hookPlugin, removeSource); + _convertToWarProject(pluginsSdkDir, warsDir, hookPlugin, removeSource); } catch (Exception e) { e.printStackTrace(bladeCLI.error()); @@ -245,7 +238,7 @@ public boolean accept(File pathname) { webPluginStream.forEach( webPlugin -> { try { - _convertToWarProject(warsDir, webPlugin, removeSource); + _convertToWarProject(pluginsSdkDir, warsDir, webPlugin, removeSource); } catch (Exception e) { e.printStackTrace(bladeCLI.error()); @@ -289,15 +282,15 @@ else if (convertArgs.isList()) { if (pluginPath.startsWith(portletsDir.toPath())) { if (_isServiceBuilderPlugin(pluginDir)) { - _convertToServiceBuilderWarProject(warsDir, pluginDir, removeSource); + _convertToServiceBuilderWarProject(pluginsSdkDir, warsDir, pluginDir, removeSource); } else { - _convertToWarProject(warsDir, pluginDir, removeSource); + _convertToWarProject(pluginsSdkDir, warsDir, pluginDir, removeSource); } } if (pluginPath.startsWith(hooksDir.toPath()) || pluginPath.startsWith(websDir.toPath())) { - _convertToWarProject(warsDir, pluginDir, removeSource); + _convertToWarProject(pluginsSdkDir, warsDir, pluginDir, removeSource); } else if (pluginPath.startsWith(layouttplDir.toPath())) { _convertToLayoutWarProject(warsDir, pluginDir, removeSource); @@ -311,6 +304,9 @@ else if (pluginPath.startsWith(themesDir.toPath())) { } } } + + bladeCLI.out( + "\nConverting is complete. Please use upgrade tool to scan for breaking changes to continue upgrade."); } @Override @@ -399,13 +395,15 @@ private void _convertToLayoutWarProject(File warsDir, File layoutPluginDir, bool } } - private void _convertToServiceBuilderWarProject(File warsDir, File pluginDir, boolean removeSource) { + private void _convertToServiceBuilderWarProject( + File pluginsSdkDir, File warsDir, File pluginDir, boolean removeSource) { + ConvertArgs convertArgs = getArgs(); BladeCLI bladeCLI = getBladeCLI(); try { - _convertToWarProject(warsDir, pluginDir, removeSource); + _convertToWarProject(pluginsSdkDir, warsDir, pluginDir, removeSource); List arguments; @@ -538,7 +536,9 @@ private void _convertToThemeProject(File themePlugin) { } } - private void _convertToWarProject(File warsDir, File pluginDir, boolean removeSource) throws Exception { + private void _convertToWarProject(File pluginsSdkDir, File warsDir, File pluginDir, boolean removeSource) + throws Exception { + warsDir.mkdirs(); Path warsPath = warsDir.toPath(); @@ -625,68 +625,154 @@ private void _convertToWarProject(File warsDir, File pluginDir, boolean removeSo ivyFile.delete(); } + List convertedDependencies = _convertWarDependencies(pluginsSdkDir, warDir); + + Stream stream = convertedDependencies.stream(); + + stream.map( + gav -> gav.toCompileDependency() + ).forEach( + dependencies::add + ); + + StringBuilder depsBlock = new StringBuilder(); + + depsBlock.append("dependencies {" + System.lineSeparator()); + + for (String dependency : dependencies) { + depsBlock.append("\t" + dependency + System.lineSeparator()); + } + + depsBlock.append("}"); + + File gradleFile = new File(warDir, "build.gradle"); + + String content = depsBlock.toString(); + + Files.write(gradleFile.toPath(), content.getBytes()); + } + + private List _convertWarDependencies(File pluginsSdkDir, File warDir) + throws FileNotFoundException, IOException { + + List convertedDependencies = new ArrayList<>(); + File liferayPluginPackageFile = new File(warDir, "src/main/webapp/WEB-INF/liferay-plugin-package.properties"); if (liferayPluginPackageFile.exists()) { try (InputStream fileInputStream = new FileInputStream(liferayPluginPackageFile)) { - Properties liferayPluginPackageProperties = new Properties(); - - liferayPluginPackageProperties.load(fileInputStream); + Properties liferayPluginPackageProperties = _loadProperties(fileInputStream); String portalJarsValue = liferayPluginPackageProperties.getProperty("portal-dependency-jars"); if (portalJarsValue != null) { - String[] portalJars = portalJarsValue.split(","); + List missingDependencyJars = new ArrayList<>(); + + List portalDependencyJars = Arrays.asList(portalJarsValue.split(",")); try (InputStream inputStream = ConvertCommand.class.getResourceAsStream( "/portal-dependency-jars-62.properties")) { - Properties properties = new Properties(); + Properties properties = _loadProperties(inputStream); - properties.load(inputStream); - - for (String portalJar : portalJars) { - String newDependency = properties.getProperty(portalJar); + for (String portalDependencyJar : portalDependencyJars) { + String newDependency = properties.getProperty(portalDependencyJar); if ((newDependency == null) || newDependency.isEmpty()) { + missingDependencyJars.add(portalDependencyJar); + continue; } - String[] s = newDependency.split(","); + String[] coordinates = newDependency.split(":"); + + if (coordinates.length != 3) { + missingDependencyJars.add(portalDependencyJar); - if (s.length != 3) { continue; } - dependencies.add( - MessageFormat.format( - "compile group: ''{0}'', name: ''{1}'', version: ''{2}''", s[0], s[1], s[2])); + convertedDependencies.add(new GAV(coordinates[0], coordinates[1], coordinates[2])); } } - catch (Exception e) { - getBladeCLI().error( - "Convert failed on portal jars of liferay-plugin-package.properties. \n", - pluginDir.getName(), e.getMessage()); + + if (!missingDependencyJars.isEmpty()) { + LoadProperties loadProperties = new LoadProperties(); + + Project project = new Project(); + + project.setProperty("sdk.dir", pluginsSdkDir.getCanonicalPath()); + + loadProperties.setProject(project); + + loadProperties.setSrcFile(new File(pluginsSdkDir, "build.properties")); + loadProperties.execute(); + + String portalDirValue = project.getProperty( + "app.server." + project.getProperty("app.server.type") + ".portal.dir"); + + Optional.ofNullable( + portalDirValue + ).map( + File::new + ).filter( + File::exists + ).ifPresent( + portalDir -> { + Stream stream = missingDependencyJars.stream(); + + stream.map( + jarName -> new File(portalDirValue, "WEB-INF/lib/" + jarName) + ).filter( + File::exists + ).map( + portalJar -> { + try (JarFile jarFile = new JarFile(portalJar)) { + Enumeration jarEntries = jarFile.entries(); + + while (jarEntries.hasMoreElements()) { + JarEntry jarEntry = jarEntries.nextElement(); + + String name = jarEntry.getName(); + + if (name.startsWith("META-INF/maven") && + name.endsWith("pom.properties")) { + + Properties properties = _loadProperties( + jarFile.getInputStream(jarEntry)); + + return new GAV( + properties.get("groupId"), properties.get("artifactId"), + properties.get("version")); + } + } + } + catch (IOException e) { + } + + return new GAV(portalJar.getName()); + } + ).forEach( + gav -> { + if (gav.isUnknown()) { + _warn( + MessageFormat.format( + "Found dependency {0} but unable to determine its artifactId. " + + "Please resolve manually.", + gav.getJarName())); + } + + convertedDependencies.add(gav); + } + ); + } + ); } } } } - StringBuilder depsBlock = new StringBuilder(); - - depsBlock.append("dependencies {" + System.lineSeparator()); - - for (String dependency : dependencies) { - depsBlock.append("\t" + dependency + System.lineSeparator()); - } - - depsBlock.append("}"); - - File gradleFile = new File(warDir, "build.gradle"); - - String content = depsBlock.toString(); - - Files.write(gradleFile.toPath(), content.getBytes()); + return convertedDependencies; } private File _findPluginDir(File pluginsSdkDir, final String pluginName) throws Exception { @@ -724,6 +810,27 @@ public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) th return pluginDir[0]; } + private File _getPluginsSdkDir(ConvertArgs convertArgs, File projectDir, Properties gradleProperties) { + File pluginsSdkDir = convertArgs.getSource(); + + if (pluginsSdkDir == null) { + if (gradleProperties != null) { + String pluginsSdkDirValue = gradleProperties.getProperty( + WorkspaceConstants.DEFAULT_PLUGINS_SDK_DIR_PROPERTY); + + if (pluginsSdkDirValue != null) { + pluginsSdkDir = new File(projectDir, pluginsSdkDirValue); + } + } + + if (pluginsSdkDir == null) { + pluginsSdkDir = new File(projectDir, WorkspaceConstants.DEFAULT_PLUGINS_SDK_DIR); + } + } + + return pluginsSdkDir; + } + private boolean _isValidSDKDir(File pluginsSdkDir) { File buildProperties = new File(pluginsSdkDir, "build.properties"); File portletsBuildXml = new File(pluginsSdkDir, "portlets/build.xml"); @@ -736,4 +843,84 @@ private boolean _isValidSDKDir(File pluginsSdkDir) { return false; } + private Properties _loadProperties(InputStream inputStream) throws IOException { + Properties properties = new Properties(); + + properties.load(inputStream); + + inputStream.close(); + + return properties; + } + + private void _warn(String message) { + BladeCLI bladeCLI = getBladeCLI(); + + bladeCLI.out("WARNING: " + message); + } + + private static class GAV { + + public GAV(Object groupId, Object artifactId, Object version) { + _groupId = Optional.ofNullable(groupId); + _artifactId = Optional.ofNullable(artifactId); + _version = Optional.ofNullable(version); + } + + public GAV(String jarName) { + _groupId = Optional.empty(); + _artifactId = Optional.empty(); + _version = Optional.empty(); + _jarName = jarName; + } + + public Object getJarName() { + return _jarName; + } + + public boolean isUnknown() { + if (!_groupId.isPresent() || !_artifactId.isPresent() || !_version.isPresent()) { + return true; + } + + return false; + } + + public String toCompileDependency() { + if (isUnknown()) { + return MessageFormat.format("// Unknown dependency: {0}", getJarName()); + } + + return MessageFormat.format( + "compile group: \"{0}\", name: \"{1}\", version: \"{2}\"", _getGroupId(), _getArtifactId(), + _getVersion()); + } + + private String _getArtifactId() { + return _map(_artifactId); + } + + private String _getGroupId() { + return _map(_groupId); + } + + private String _getVersion() { + return _map(_version); + } + + private String _map(Optional object) { + return object.map( + String.class::cast + ).orElse( + "" + ); + } + + private Optional _artifactId; + private Optional _groupId; + private String _jarName; + private Optional _version; + + } + } \ No newline at end of file diff --git a/cli/src/main/java/com/liferay/blade/cli/command/ConvertServiceBuilderCommand.java b/cli/src/main/java/com/liferay/blade/cli/command/ConvertServiceBuilderCommand.java index 759911917..0fb6b812d 100644 --- a/cli/src/main/java/com/liferay/blade/cli/command/ConvertServiceBuilderCommand.java +++ b/cli/src/main/java/com/liferay/blade/cli/command/ConvertServiceBuilderCommand.java @@ -303,8 +303,6 @@ public void execute() throws Exception { String updatedContent = gradleContent.replaceAll("dependencies \\{", sb.toString()); Files.write(gradlePath, updatedContent.getBytes()); - - System.out.println("Migrating files done, then you should fix breaking changes and re-run build-service task."); } private static boolean _isInExportedApiFolder(File file) { diff --git a/cli/src/main/resources/portal-dependency-jars-62.properties b/cli/src/main/resources/portal-dependency-jars-62.properties index 48543826b..8ed6f4f0e 100644 --- a/cli/src/main/resources/portal-dependency-jars-62.properties +++ b/cli/src/main/resources/portal-dependency-jars-62.properties @@ -1,237 +1,237 @@ -#This is generated by the latest 6.2 portal release and there are several jar files without maven artifact layouts, we need more investigation if we want to support on them +#This is generated by the latest 6.2 portal release and there are several jar files without maven artifact layouts: we need more investigation if we want to support on them abdera.jar= alloy-taglib.jar= -ant.jar=org.apache.ant,ant,1.8.2 +ant.jar=org.apache.ant:ant:1.8.2 antlr2.jar= antlr3-runtime.jar= antlr3.jar= -aopalliance.jar=aopalliance,aopalliance,1.0 -asm-analysis.jar=asm,asm-analysis,3.3 -asm-commons.jar=asm,asm-commons,3.3 -asm-tree.jar=asm,asm-tree,3.3 -asm-util.jar=asm,asm-util,3.3 -asm-xml.jar=asm,asm-xml,3.3 -asm.jar=asm,asm,3.3 -aspectj-rt.jar= -aspectj-weaver.jar= -axiom-api.jar=org.apache.ws.commons.axiom,axiom-api,1.2.10 -axiom-impl.jar=org.apache.ws.commons.axiom,axiom-impl,1.2.10 -axis-ant.jar=axis,axis-ant,1.4 -axis.jar=org.apache.axis,axis,1.4 -backport-concurrent.jar= +aopalliance.jar=aopalliance:aopalliance:1.0 +asm-analysis.jar=asm:asm-analysis:3.3 +asm-commons.jar=asm:asm-commons:3.3 +asm-tree.jar=asm:asm-tree:3.3 +asm-util.jar=asm:asm-util:3.3 +asm-xml.jar=asm:asm-xml:3.3 +asm.jar=asm:asm:3.3 +aspectj-rt.jar=org.aspectj:aspectjrt:1.6.12 +aspectj-weaver.jar=org.aspectj:aspectjweaver:1.6.12 +axiom-api.jar=org.apache.ws.commons.axiom:axiom-api:1.2.10 +axiom-impl.jar=org.apache.ws.commons.axiom:axiom-impl:1.2.10 +axis-ant.jar=axis:axis-ant:1.4 +axis.jar=org.apache.axis:axis:1.4 +backport-concurrent.jar=backport-util-concurrent:backport-util-concurrent:3.1 bcmail.jar= bcprov.jar= -bnd.jar=biz.aQute.bnd,bnd,2.2.0 -bobo-browse.jar=com.browseengine.bobo,bobo-browse,3.2.0 -boilerpipe.jar=de.l3s.boilerpipe,boilerpipe,1.1.0 -bsf.jar=apache-bsf,bsf,2.4.0 -bsh.jar=bsh,bsh,2.0b4 -c3p0.jar=com.mchange,c3p0,0.9.2.1 -cas-client-core.jar=org.jasig.cas,cas-client-core,3.1.9 -ccpp-ri.jar=javax.ccpp,ccpp,1.0 -cglib.jar=cglib,cglib,2.2 +bnd.jar=biz.aQute.bnd:bnd:2.2.0 +bobo-browse.jar=com.browseengine.bobo:bobo-browse:3.2.0 +boilerpipe.jar=de.l3s.boilerpipe:boilerpipe:1.1.0 +bsf.jar=apache-bsf:bsf:2.4.0 +bsh.jar=bsh:bsh:2.0b4 +c3p0.jar=com.mchange:c3p0:0.9.2.1 +cas-client-core.jar=org.jasig.cas:cas-client-core:3.1.9 +ccpp-ri.jar=javax.ccpp:ccpp:1.0 +cglib.jar=cglib:cglib:2.2 chardet.jar= -chemistry-opencmis-client-api.jar=org.apache.chemistry.opencmis,chemistry-opencmis-client-api,0.6.0 -chemistry-opencmis-client-bindings.jar=org.apache.chemistry.opencmis,chemistry-opencmis-client-bindings,0.6.0 -chemistry-opencmis-client-impl.jar=org.apache.chemistry.opencmis,chemistry-opencmis-client-impl,0.6.0 -chemistry-opencmis-commons-api.jar=org.apache.chemistry.opencmis,chemistry-opencmis-commons-api,0.6.0 -chemistry-opencmis-commons-impl.jar=org.apache.chemistry.opencmis,chemistry-opencmis-commons-impl,0.6.0 -commons-beanutils.jar=commons-beanutils,commons-beanutils,1.8.2 -commons-codec.jar=commons-codec,commons-codec,1.9 -commons-collections.jar=commons-collections,commons-collections,3.2.2 -commons-configuration.jar=commons-configuration,commons-configuration,1.6 -commons-dbcp.jar=commons-dbcp,commons-dbcp,1.2.2 -commons-digester.jar=commons-digester,commons-digester,1.8 -commons-discovery.jar=commons-discovery,commons-discovery,0.4 -commons-email.jar=org.apache.commons,commons-email,1.2 -commons-fileupload.jar=commons-fileupload,commons-fileupload,1.2.2 -commons-httpclient.jar=commons-httpclient,commons-httpclient,3.1 -commons-io.jar=commons-io,commons-io,2.1 -commons-lang.jar=commons-lang,commons-lang,2.6 -commons-logging.jar=commons-logging,commons-logging,1.1.3 -commons-math.jar=org.apache.commons,commons-math,2.0 -commons-pool.jar=commons-pool,commons-pool,1.5.4 -commons-validator.jar=commons-validator,commons-validator,1.3.1 -concurrent.jar=concurrent,concurrent,1.3.4 +chemistry-opencmis-client-api.jar=org.apache.chemistry.opencmis:chemistry-opencmis-client-api:0.6.0 +chemistry-opencmis-client-bindings.jar=org.apache.chemistry.opencmis:chemistry-opencmis-client-bindings:0.6.0 +chemistry-opencmis-client-impl.jar=org.apache.chemistry.opencmis:chemistry-opencmis-client-impl:0.6.0 +chemistry-opencmis-commons-api.jar=org.apache.chemistry.opencmis:chemistry-opencmis-commons-api:0.6.0 +chemistry-opencmis-commons-impl.jar=org.apache.chemistry.opencmis:chemistry-opencmis-commons-impl:0.6.0 +commons-beanutils.jar=commons-beanutils:commons-beanutils:1.8.2 +commons-codec.jar=commons-codec:commons-codec:1.9 +commons-collections.jar=commons-collections:commons-collections:3.2.2 +commons-configuration.jar=commons-configuration:commons-configuration:1.6 +commons-dbcp.jar=commons-dbcp:commons-dbcp:1.2.2 +commons-digester.jar=commons-digester:commons-digester:1.8 +commons-discovery.jar=commons-discovery:commons-discovery:0.4 +commons-email.jar=org.apache.commons:commons-email:1.2 +commons-fileupload.jar=commons-fileupload:commons-fileupload:1.2.2 +commons-httpclient.jar=commons-httpclient:commons-httpclient:3.1 +commons-io.jar=commons-io:commons-io:2.1 +commons-lang.jar=commons-lang:commons-lang:2.6 +commons-logging.jar=commons-logging:commons-logging:1.1.3 +commons-math.jar=org.apache.commons:commons-math:2.0 +commons-pool.jar=commons-pool:commons-pool:1.5.4 +commons-validator.jar=commons-validator:commons-validator:1.3.1 +concurrent.jar=concurrent:concurrent:1.3.4 crypt.jar= daim.jar= daisydiff.jar= -displaytag.jar=displaytag,displaytag,1.2 -dom4j.jar=dom4j,dom4j,1.6.1 -easyconf.jar=easyconf,easyconf,0.9.5 +displaytag.jar=displaytag:displaytag:1.2 +dom4j.jar=dom4j:dom4j:1.6.1 +easyconf.jar=easyconf:easyconf:0.9.5 eclipse-core-runtime.jar= eclipselink.jar= -ecs.jar=ecs,ecs,1.4.2 -ehcache-jgroupsreplication.jar=net.sf.ehcache,ehcache-jgroupsreplication,1.7 -ehcache.jar=net.sf.ehcache,ehcache,2.8.3 -fastutil.jar=fastutil,fastutil,5.0.5 -felix-fileinstall.jar=org.apache.felix,org.apache.felix.fileinstall,3.1.10 -flexjson.jar=net.sf.flexjson,flexjson,3.1 -fontbox.jar=org.apache.pdfbox,fontbox,1.8.12 -freemarker.jar=org.freemarker,freemarker,2.3.17 +ecs.jar=ecs:ecs:1.4.2 +ehcache-jgroupsreplication.jar=net.sf.ehcache:ehcache-jgroupsreplication:1.7 +ehcache.jar=net.sf.ehcache:ehcache:2.8.3 +fastutil.jar=fastutil:fastutil:5.0.5 +felix-fileinstall.jar=org.apache.felix:org.apache.felix.fileinstall:3.1.10 +flexjson.jar=net.sf.flexjson:flexjson:3.1 +fontbox.jar=org.apache.pdfbox:fontbox:1.8.12 +freemarker.jar=org.freemarker:freemarker:2.3.17 freshcookies-security.jar= -gif89.jar=com.liferay,net.jmge.gif.gif89,1.0 -groovy.jar=org.codehaus.groovy,groovy,1.7.5 +gif89.jar=com.liferay:net.jmge.gif.gif89:1.0 +groovy.jar=org.codehaus.groovy:groovy:1.7.5 guice.jar= hibernate3.jar= -htmlparser.jar=org.htmlparser,htmlparser,1.6 -httpclient.jar=org.apache.httpcomponents,httpclient,4.5 -httpcore.jar=org.apache.httpcomponents,httpcore,4.4.1 -httpmime.jar=org.apache.httpcomponents,httpmime,4.5 -ical4j.jar=net.fortuna.ical4j,ical4j,1.0 +htmlparser.jar=org.htmlparser:htmlparser:1.6 +httpclient.jar=org.apache.httpcomponents:httpclient:4.5 +httpcore.jar=org.apache.httpcomponents:httpcore:4.4.1 +httpmime.jar=org.apache.httpcomponents:httpmime:4.5 +ical4j.jar=net.fortuna.ical4j:ical4j:1.0 icq.jar= -im4java.jar=org.im4java,im4java,1.2.0 -isoparser.jar=com.googlecode.mp4parser,isoparser,1.0-RC-1 -jabsorb.jar=org.jabsorb,jabsorb,1.3.2 -jackrabbit-api.jar=org.apache.jackrabbit,jackrabbit-api,2.1.6 -jackrabbit-core.jar=org.apache.jackrabbit,jackrabbit-core,2.1.6 -jackrabbit-jcr-commons.jar=org.apache.jackrabbit,jackrabbit-jcr-commons,2.1.6 -jackrabbit-spi-commons.jar=org.apache.jackrabbit,jackrabbit-spi-commons,2.1.6 -jackrabbit-spi.jar=org.apache.jackrabbit,jackrabbit-spi,2.1.6 -jai_codec.jar=javax.media,jai_codec,1.1.3 -jai_core.jar=com.sun,jai_core,1.1.3 +im4java.jar=org.im4java:im4java:1.2.0 +isoparser.jar=com.googlecode.mp4parser:isoparser:1.0-RC-1 +jabsorb.jar=org.jabsorb:jabsorb:1.3.2 +jackrabbit-api.jar=org.apache.jackrabbit:jackrabbit-api:2.1.6 +jackrabbit-core.jar=org.apache.jackrabbit:jackrabbit-core:2.1.6 +jackrabbit-jcr-commons.jar=org.apache.jackrabbit:jackrabbit-jcr-commons:2.1.6 +jackrabbit-spi-commons.jar=org.apache.jackrabbit:jackrabbit-spi-commons:2.1.6 +jackrabbit-spi.jar=org.apache.jackrabbit:jackrabbit-spi:2.1.6 +jai_codec.jar=javax.media:jai_codec:1.1.3 +jai_core.jar=com.sun:jai_core:1.1.3 jakarta-regexp.jar= -jamwiki-core.jar=org.jamwiki,jamwiki-core,1.0.7 -java-diff.jar=org.incava,java-diff,1.1 -java-xmlbuilder.jar=com.jamesmurty.utils,java-xmlbuilder,1.1 -javassist.jar=org.javassist,javassist,3.15.0-GA +jamwiki-core.jar=org.jamwiki:jamwiki-core:1.0.7 +java-diff.jar=org.incava:java-diff:1.1 +java-xmlbuilder.jar=com.jamesmurty.utils:java-xmlbuilder:1.1 +javassist.jar=org.javassist:javassist:3.15.0-GA javax.inject.jar= -jaxb-impl.jar=com.sun.xml.bind,jaxb-impl,2.1.11 -jaxen.jar=jaxen,jaxen,1.1.1 -jaxrpc.jar=javax.xml,jaxrpc,1.1 -jaxws-rt.jar=com.sun.xml.ws,jaxws-rt,2.1.7 +jaxb-impl.jar=com.sun.xml.bind:jaxb-impl:2.1.11 +jaxen.jar=jaxen:jaxen:1.1.1 +jaxrpc.jar=javax.xml:jaxrpc:1.1 +jaxws-rt.jar=com.sun.xml.ws:jaxws-rt:2.1.7 jazzy.jar= -jcifs.jar=jcifs,jcifs,1.3.17 -jcl-over-slf4j.jar=org.slf4j,jcl-over-slf4j,1.7.2 -jcommon.jar=org.jfree,jcommon,0.0 -jcr.jar=javax.jcr,jcr,2.0 -jdom.jar=jdom,jdom,1.1 -jempbox.jar=org.apache.pdfbox,jempbox,1.8.12 +jcifs.jar=jcifs:jcifs:1.3.17 +jcl-over-slf4j.jar=org.slf4j:jcl-over-slf4j:1.7.2 +jcommon.jar=org.jfree:jcommon:0.0 +jcr.jar=javax.jcr:jcr:2.0 +jdom.jar=jdom:jdom:1.1 +jempbox.jar=org.apache.pdfbox:jempbox:1.8.12 jena.jar= -jericho-html.jar=net.htmlparser.jericho,jericho-html,3.1 -jets3t.jar=net.java.dev.jets3t,jets3t,0.9.0 -jfreechart.jar=jfree,jfreechart,1.0.13 -jgroups.jar=org.jgroups,jgroups,3.2.10.Final +jericho-html.jar=net.htmlparser.jericho:jericho-html:3.1 +jets3t.jar=net.java.dev.jets3t:jets3t:0.9.0 +jfreechart.jar=jfree:jfreechart:1.0.13 +jgroups.jar=org.jgroups:jgroups:3.2.10.Final jhlabs-filters.jar= -jodconverter.jar=com.artofsolving,jodconverter,2.2.2 +jodconverter.jar=com.artofsolving:jodconverter:2.2.2 jodd.jar= -jrcs-diff.jar=org.suigeneris,jrcs-diff,0.3.0 -jruby.jar=org.jruby,jruby,1.6.5 -json-java.jar= +jrcs-diff.jar=org.suigeneris:jrcs-diff:0.3.0 +jruby.jar=org.jruby:jruby:1.6.5 +json-java.jar=org.json:json:20190722 jsonrpc.jar= jspwiki.jar= -jsqlparser.jar=net.sf.jsqlparser,jsqlparser,0.8.2-SNAPSHOT -jsr107cache.jar=net.sf.jsr107cache,jsr107cache,1.0 -jstl-api.jar=javax.servlet.jsp.jstl,jstl-api,1.2 -jstl-impl.jar=org.glassfish.web,jstl-impl,1.2 -juh.jar=org.openoffice,juh,2.3.0 -juniversalchardet.jar=com.googlecode.juniversalchardet,juniversalchardet,1.0.3 -jurt.jar=org.openoffice,jurt,2.3.0 +jsqlparser.jar=net.sf.jsqlparser:jsqlparser:0.8.2-SNAPSHOT +jsr107cache.jar=net.sf.jsr107cache:jsr107cache:1.0 +jstl-api.jar=javax.servlet.jsp.jstl:jstl-api:1.2 +jstl-impl.jar=org.glassfish.web:jstl-impl:1.2 +juh.jar=org.openoffice:juh:2.3.0 +juniversalchardet.jar=com.googlecode.juniversalchardet:juniversalchardet:1.0.3 +jurt.jar=org.openoffice:jurt:2.3.0 jython.jar= -kxml2.jar=net.sf.kxml,kxml2,2.3.0 +kxml2.jar=net.sf.kxml:kxml2:2.3.0 liferay-icu4j.jar= liferay-yui-compressor.jar= -log4j-extras.jar=log4j,apache-log4j-extras,1.1 -log4j.jar=log4j,log4j,1.2.17 -lucene-analyzers.jar=org.apache.lucene,lucene-analyzers,3.5.0 -lucene-core.jar=org.apache.lucene,lucene-core,3.5.0 -lucene-grouping.jar=org.apache.lucene,lucene-grouping,3.5.0 -lucene-highlighter.jar=org.apache.lucene,lucene-highlighter,3.5.0 -lucene-icu.jar=org.apache.lucene,lucene-icu,3.5.0 -lucene-join.jar=org.apache.lucene,lucene-join,3.5.0 -lucene-memory.jar=org.apache.lucene,lucene-memory,3.5.0 -lucene-misc.jar=org.apache.lucene,lucene-misc,3.5.0 -lucene-queries.jar=org.apache.lucene,lucene-queries,3.5.0 -lucene-queryparser.jar=org.apache.lucene,lucene-queryparser,3.5.0 -lucene-spellchecker.jar=org.apache.lucene,lucene-spellchecker,3.5.0 -mchange-commons-java.jar=com.mchange,mchange-commons-java,0.2.3.4 -memcached.jar=spy,memcached,2.5 -metadata-extractor.jar=com.drewnoakes,metadata-extractor,2.6.2 -mime4j-core.jar=org.apache.james,apache-mime4j-core,0.7.2 -mime4j-dom.jar=org.apache.james,apache-mime4j-dom,0.7.2 -mimepull.jar=org.jvnet,mimepull,1.3 +log4j-extras.jar=log4j:apache-log4j-extras:1.1 +log4j.jar=log4j:log4j:1.2.17 +lucene-analyzers.jar=org.apache.lucene:lucene-analyzers:3.5.0 +lucene-core.jar=org.apache.lucene:lucene-core:3.5.0 +lucene-grouping.jar=org.apache.lucene:lucene-grouping:3.5.0 +lucene-highlighter.jar=org.apache.lucene:lucene-highlighter:3.5.0 +lucene-icu.jar=org.apache.lucene:lucene-icu:3.5.0 +lucene-join.jar=org.apache.lucene:lucene-join:3.5.0 +lucene-memory.jar=org.apache.lucene:lucene-memory:3.5.0 +lucene-misc.jar=org.apache.lucene:lucene-misc:3.5.0 +lucene-queries.jar=org.apache.lucene:lucene-queries:3.5.0 +lucene-queryparser.jar=org.apache.lucene:lucene-queryparser:3.5.0 +lucene-spellchecker.jar=org.apache.lucene:lucene-spellchecker:3.5.0 +mchange-commons-java.jar=com.mchange:mchange-commons-java:0.2.3.4 +memcached.jar=spy:memcached:2.5 +metadata-extractor.jar=com.drewnoakes:metadata-extractor:2.6.2 +mime4j-core.jar=org.apache.james:apache-mime4j-core:0.7.2 +mime4j-dom.jar=org.apache.james:apache-mime4j-dom:0.7.2 +mimepull.jar=org.jvnet:mimepull:1.3 monte-cc.jar= msnm.jar= -nekohtml.jar=net.sourceforge.nekohtml,nekohtml,1.9.14 -netcdf.jar=edu.ucar,netcdf,4.2 -odmg.jar=odmg,odmg,3.0 -openid4java.jar=org.openid4java,openid4java,0.9.8 -oro.jar=oro,oro,2.0.8 -oscache.jar=opensymphony,oscache,2.4.1 -pdfbox.jar=org.apache.pdfbox,pdfbox,1.8.12 -poi-ooxml-schemas.jar=org.apache.poi,poi-ooxml-schemas,3.9 -poi-ooxml.jar=org.apache.poi,poi-ooxml,3.9 -poi-scratchpad.jar=org.apache.poi,poi-scratchpad,3.9 -poi.jar=org.apache.poi,poi,3.9 +nekohtml.jar=net.sourceforge.nekohtml:nekohtml:1.9.14 +netcdf.jar=edu.ucar:netcdf:4.2 +odmg.jar=odmg:odmg:3.0 +openid4java.jar=org.openid4java:openid4java:0.9.8 +oro.jar=oro:oro:2.0.8 +oscache.jar=opensymphony:oscache:2.4.1 +pdfbox.jar=org.apache.pdfbox:pdfbox:1.8.12 +poi-ooxml-schemas.jar=org.apache.poi:poi-ooxml-schemas:3.9 +poi-ooxml.jar=org.apache.poi:poi-ooxml:3.9 +poi-scratchpad.jar=org.apache.poi:poi-scratchpad:3.9 +poi.jar=org.apache.poi:poi:3.9 portal-client.jar= portal-impl.jar= portal-pacl.jar= portals-bridges.jar= portletbridge-core.jar= portletbridge-portlet.jar= -quartz.jar=org.quartz-scheduler,quartz,2.1.7 +quartz.jar=org.quartz-scheduler:quartz:2.1.7 rdffilter.jar= -rhino.jar=rhino,js,1.6R7 -ridl.jar=org.openoffice,ridl,2.3.0 -rome.jar=rome,rome,1.0 +rhino.jar=rhino:js:1.6R7 +ridl.jar=org.openoffice:ridl:2.3.0 +rome.jar=rome:rome:1.0 ruby-gems.jar= -saaj-api.jar=javax.xml.soap,saaj-api,1.3 -saaj-impl.jar=com.sun.xml.messaging.saaj,saaj-impl,1.3 -scala-library.jar=org.scala-lang,scala-library,2.9.2 -scribe.jar=org.scribe,scribe,1.0.8 -serializer.jar=xalan,serializer,2.7.1 -simplecaptcha.jar=nl.captcha,simplecaptcha,1.1.1 -slf4j-api.jar=org.slf4j,slf4j-api,1.7.2 -soap.jar=soap,soap,2.2 -spring-aop.jar=org.springframework,spring-aop,3.0.7.RELEASE -spring-asm.jar=org.springframework,spring-asm,3.0.7.RELEASE -spring-aspects.jar=org.springframework,spring-aspects,3.0.7.RELEASE -spring-beans.jar=org.springframework,spring-beans,3.0.7.RELEASE -spring-context-support.jar=org.springframework,spring-context-support,3.0.7.RELEASE -spring-context.jar=org.springframework,spring-context,3.0.7.RELEASE -spring-core.jar=org.springframework,spring-core,3.0.7.RELEASE -spring-expression.jar=org.springframework,spring-expression,3.0.7.RELEASE -spring-jdbc.jar=org.springframework,spring-jdbc,3.0.7.RELEASE -spring-jms.jar=org.springframework,spring-jms,3.0.7.RELEASE -spring-orm.jar=org.springframework,spring-orm,3.0.7.RELEASE -spring-oxm.jar=org.springframework,spring-oxm,3.0.7.RELEASE -spring-transaction.jar=org.springframework,spring-tx,3.0.7.RELEASE +saaj-api.jar=javax.xml.soap:saaj-api:1.3 +saaj-impl.jar=com.sun.xml.messaging.saaj:saaj-impl:1.3 +scala-library.jar=org.scala-lang:scala-library:2.9.2 +scribe.jar=org.scribe:scribe:1.0.8 +serializer.jar=xalan:serializer:2.7.1 +simplecaptcha.jar=nl.captcha:simplecaptcha:1.1.1 +slf4j-api.jar=org.slf4j:slf4j-api:1.7.2 +soap.jar=soap:soap:2.2 +spring-aop.jar=org.springframework:spring-aop:3.0.7.RELEASE +spring-asm.jar=org.springframework:spring-asm:3.0.7.RELEASE +spring-aspects.jar=org.springframework:spring-aspects:3.0.7.RELEASE +spring-beans.jar=org.springframework:spring-beans:3.0.7.RELEASE +spring-context-support.jar=org.springframework:spring-context-support:3.0.7.RELEASE +spring-context.jar=org.springframework:spring-context:3.0.7.RELEASE +spring-core.jar=org.springframework:spring-core:3.0.7.RELEASE +spring-expression.jar=org.springframework:spring-expression:3.0.7.RELEASE +spring-jdbc.jar=org.springframework:spring-jdbc:3.0.7.RELEASE +spring-jms.jar=org.springframework:spring-jms:3.0.7.RELEASE +spring-orm.jar=org.springframework:spring-orm:3.0.7.RELEASE +spring-oxm.jar=org.springframework:spring-oxm:3.0.7.RELEASE +spring-transaction.jar=org.springframework:spring-tx:3.0.7.RELEASE spring-web-portlet.jar= spring-web-servlet.jar= spring-web-struts.jar= -spring-web.jar=org.springframework,spring-web,3.0.7.RELEASE -stax-ex.jar=org.jvnet.staxex,stax-ex,1.2 +spring-web.jar=org.springframework:spring-web:3.0.7.RELEASE +stax-ex.jar=org.jvnet.staxex:stax-ex:1.2 stax.jar= -streambuffer.jar=com.sun.xml.stream.buffer,streambuffer,0.9 -stringtemplate.jar=org.antlr,stringtemplate,3.0 -struts-el.jar=struts,struts-el,1.2.9 +streambuffer.jar=com.sun.xml.stream.buffer:streambuffer:0.9 +stringtemplate.jar=org.antlr:stringtemplate:3.0 +struts-el.jar=struts:struts-el:1.2.9 struts.jar= -tagsoup.jar=org.ccil.cowan.tagsoup,tagsoup,1.2.1 -tika-core.jar=org.apache.tika,tika-core,1.3 -tika-parsers.jar=org.apache.tika,tika-parsers,1.3 +tagsoup.jar=org.ccil.cowan.tagsoup:tagsoup:1.2.1 +tika-core.jar=org.apache.tika:tika-core:1.3 +tika-parsers.jar=org.apache.tika:tika-parsers:1.3 tomcat-jdbc.jar= -truezip.jar=truezip,truezip,6.7 -unoil.jar=org.openoffice,unoil,2.3.0 -urlrewrite.jar=net.java.dev.urlrewrite,urlrewrite,2.6.0 +truezip.jar=truezip:truezip:6.7 +unoil.jar=org.openoffice:unoil:2.3.0 +urlrewrite.jar=net.java.dev.urlrewrite:urlrewrite:2.6.0 util-bridges.jar= util-java.jar= util-slf4j.jar= util-taglib.jar= -vaadin.jar=com.vaadin,vaadin,6.8.12 -velocity-tools.jar=velocity-tools,velocity-tools,1.4 -velocity.jar=org.apache.velocity,velocity,1.6.4 -vorbis-java-core.jar=org.gagravarr,vorbis-java-core,0.1 -vorbis-java-tika.jar=org.gagravarr,vorbis-java-tika,0.1 -wsdl4j.jar=wsdl4j,wsdl4j,1.6.1 +vaadin.jar=com.vaadin:vaadin:6.8.12 +velocity-tools.jar=velocity-tools:velocity-tools:1.4 +velocity.jar=org.apache.velocity:velocity:1.6.4 +vorbis-java-core.jar=org.gagravarr:vorbis-java-core:0.1 +vorbis-java-tika.jar=org.gagravarr:vorbis-java-tika:0.1 +wsdl4j.jar=wsdl4j:wsdl4j:1.6.1 wstx.jar= xalan.jar= -xbean-spring.jar=org.apache.xbean,xbean-spring,2.8 +xbean-spring.jar=org.apache.xbean:xbean-spring:2.8 xbean.jar= -xercesImpl.jar=xerces,xercesImpl,2.11.0 -xml-apis.jar=xml-apis,xml-apis,1.4.01 -xmlsec.jar=org.apache.santuario,xmlsec,1.4.5 -xmpcore.jar=com.adobe.xmp,xmpcore,5.1.2 -xpp3.jar=xpp3,xpp3,1.1.4c -xstream.jar=com.thoughtworks.xstream,xstream,1.4.7 -xuggle-xuggler-noarch.jar=xuggle,xuggle-xuggler,5.4 -xz.jar=org.tukaani,xz,1.0 \ No newline at end of file +xercesImpl.jar=xerces:xercesImpl:2.11.0 +xml-apis.jar=xml-apis:xml-apis:1.4.01 +xmlsec.jar=org.apache.santuario:xmlsec:1.4.5 +xmpcore.jar=com.adobe.xmp:xmpcore:5.1.2 +xpp3.jar=xpp3:xpp3:1.1.4c +xstream.jar=com.thoughtworks.xstream:xstream:1.4.7 +xuggle-xuggler-noarch.jar=xuggle:xuggle-xuggler:5.4 +xz.jar=org.tukaani:xz:1.0 \ No newline at end of file From f383241814605027a67d8699f6d5b931ff5c1198 Mon Sep 17 00:00:00 2001 From: Gregory Amerson Date: Wed, 12 Feb 2020 16:42:14 -0600 Subject: [PATCH 13/14] BLADE-510 use double quotes instead of single --- .../blade/cli/command/ConvertCommand.java | 2 +- .../blade/cli/command/ConvertCommandTest.java | 24 +++++++++---------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/cli/src/main/java/com/liferay/blade/cli/command/ConvertCommand.java b/cli/src/main/java/com/liferay/blade/cli/command/ConvertCommand.java index 1d0d69539..3cdef2559 100644 --- a/cli/src/main/java/com/liferay/blade/cli/command/ConvertCommand.java +++ b/cli/src/main/java/com/liferay/blade/cli/command/ConvertCommand.java @@ -617,7 +617,7 @@ private void _convertToWarProject(File pluginsSdkDir, File warsDir, File pluginD if ((name != null) && (org != null) && (rev != null)) { dependencies.add( MessageFormat.format( - "compile group: ''{0}'', name: ''{1}'', version: ''{2}''", org, name, rev)); + "compile group: \"{0}\", name: \"{1}\", version: \"{2}\"", org, name, rev)); } } } diff --git a/cli/src/test/java/com/liferay/blade/cli/command/ConvertCommandTest.java b/cli/src/test/java/com/liferay/blade/cli/command/ConvertCommandTest.java index 6130af931..54e59531a 100644 --- a/cli/src/test/java/com/liferay/blade/cli/command/ConvertCommandTest.java +++ b/cli/src/test/java/com/liferay/blade/cli/command/ConvertCommandTest.java @@ -517,8 +517,8 @@ public void testReadIvyXml() throws Exception { _contains( new File(projectDir, "wars/sample-dao-portlet/build.gradle"), - ".*compile group: 'c3p0', name: 'c3p0', version: '0.9.0.4'.*", - ".*compile group: 'mysql', name: 'mysql-connector-java', version: '5.0.7'.*"); + ".*compile group: \"c3p0\", name: \"c3p0\", version: \"0.9.0.4\".*", + ".*compile group: \"mysql\", name: \"mysql-connector-java\", version: \"5.0.7\".*"); args = new String[] {"--base", projectDir.getPath(), "convert", "sample-tapestry-portlet"}; @@ -526,11 +526,11 @@ public void testReadIvyXml() throws Exception { _contains( new File(projectDir, "wars/sample-tapestry-portlet/build.gradle"), - ".*compile group: 'hivemind', name: 'hivemind', version: '1.1'.*", - ".*compile group: 'hivemind', name: 'hivemind-lib', version: '1.1'.*", - ".*compile group: 'org.apache.tapestry', name: 'tapestry-annotations', version: '4.1'.*", - ".*compile group: 'org.apache.tapestry', name: 'tapestry-framework', version: '4.1'.*", - ".*compile group: 'org.apache.tapestry', name: 'tapestry-portlet', version: '4.1'.*"); + ".*compile group: \"hivemind\", name: \"hivemind\", version: \"1.1\".*", + ".*compile group: \"hivemind\", name: \"hivemind-lib\", version: \"1.1\".*", + ".*compile group: \"org.apache.tapestry\", name: \"tapestry-annotations\", version: \"4.1\".*", + ".*compile group: \"org.apache.tapestry\", name: \"tapestry-framework\", version: \"4.1\".*", + ".*compile group: \"org.apache.tapestry\", name: \"tapestry-portlet\", version: \"4.1\".*"); File ivmXmlFile = new File(projectDir, "wars/sample-tapestry-portlet/ivy.xml"); @@ -547,11 +547,11 @@ public void testReadLiferayPlguinPackageProperties() throws Exception { _contains( new File(projectDir, "wars/sample-hibernate-portlet/build.gradle"), - ".*compile group: 'commons-collections', name: 'commons-collections', version: '3.2.2'.*", - ".*compile group: 'commons-httpclient', name: 'commons-httpclient', version: '3.1'.*", - ".*compile group: 'dom4j', name: 'dom4j', version: '1.6.1'.*", - ".*compile group: 'javax.xml.soap', name: 'saaj-api', version: '1.3'.*", - ".*compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.2'.*"); + ".*compile group: \"commons-collections\", name: \"commons-collections\", version: \"3.2.2\".*", + ".*compile group: \"commons-httpclient\", name: \"commons-httpclient\", version: \"3.1\".*", + ".*compile group: \"dom4j\", name: \"dom4j\", version: \"1.6.1\".*", + ".*compile group: \"javax.xml.soap\", name: \"saaj-api\", version: \"1.3\".*", + ".*compile group: \"org.slf4j\", name: \"slf4j-api\", version: \"1.7.2\".*"); _notContains( new File(projectDir, "wars/sample-hibernate-portlet/build.gradle"), ".*antlr2.*", ".*hibernate3.*", From 14c81b795211a8ff4a4eb63cafe40d469bf4eb5e Mon Sep 17 00:00:00 2001 From: Lawrence Lee Date: Fri, 14 Feb 2020 11:12:46 -0600 Subject: [PATCH 14/14] BLADE-516 Add 5 sec timeout to automatic update check --- cli/src/main/java/com/liferay/blade/cli/BladeCLI.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cli/src/main/java/com/liferay/blade/cli/BladeCLI.java b/cli/src/main/java/com/liferay/blade/cli/BladeCLI.java index c41dca0cc..5d457191b 100644 --- a/cli/src/main/java/com/liferay/blade/cli/BladeCLI.java +++ b/cli/src/main/java/com/liferay/blade/cli/BladeCLI.java @@ -889,7 +889,12 @@ private String _getUpdateVersionIfAvailable(boolean snapshots) { _out = System.out; - updateCommand.execute(); + long timeout = 5000L; + long startTime = System.currentTimeMillis(); + + while (System.currentTimeMillis() - startTime < timeout) { + updateCommand.execute(); + } } finally { System.setOut(currentStdOut);