diff --git a/src/main/java/com/liferay/ide/idea/ui/modules/LiferayModuleBuilder.java b/src/main/java/com/liferay/ide/idea/ui/modules/LiferayModuleBuilder.java index 7fb48826..a3c06c81 100755 --- a/src/main/java/com/liferay/ide/idea/ui/modules/LiferayModuleBuilder.java +++ b/src/main/java/com/liferay/ide/idea/ui/modules/LiferayModuleBuilder.java @@ -31,6 +31,7 @@ import com.liferay.ide.idea.util.CoreUtil; import com.liferay.ide.idea.util.IntellijUtil; import com.liferay.ide.idea.util.LiferayWorkspaceSupport; +import com.liferay.release.util.ReleaseEntry; import java.io.File; @@ -200,6 +201,13 @@ public void setupRootModel(@NotNull ModifiableRootModel modifiableRootModel) { args.add(targetPlatformVersion); } + ReleaseEntry releaseEntry = LiferayWorkspaceSupport.getReleaseEntry("portal", targetPlatformVersion); + + if (releaseEntry != null) { + args.add("--liferay-product"); + args.add(releaseEntry.getProduct()); + } + args.add("-t"); args.add(_type); diff --git a/src/main/java/com/liferay/ide/idea/ui/modules/LiferayWorkspaceBuilder.java b/src/main/java/com/liferay/ide/idea/ui/modules/LiferayWorkspaceBuilder.java index 75cf2cf1..c87f74e6 100644 --- a/src/main/java/com/liferay/ide/idea/ui/modules/LiferayWorkspaceBuilder.java +++ b/src/main/java/com/liferay/ide/idea/ui/modules/LiferayWorkspaceBuilder.java @@ -195,13 +195,19 @@ else if (_liferayProjectType.equals(LiferayProjectType.LIFERAY_GRADLE_WORKSPACE) args.add(_productVersion); } + ReleaseEntry releaseEntry = LiferayWorkspaceSupport.getReleaseEntry("portal", _targetPlatform); + + if (releaseEntry != null) { + args.add("--liferay-product"); + args.add(releaseEntry.getProduct()); + } + args.add("-f"); if (_liferayProjectType.equals(LiferayProjectType.LIFERAY_MAVEN_WORKSPACE)) { args.add("-b"); args.add("maven"); } - } PropertiesComponent component = PropertiesComponent.getInstance(project); @@ -235,8 +241,6 @@ else if (_liferayProjectType.equals(LiferayProjectType.LIFERAY_MAVEN_WORKSPACE)) properties.setProperty(WorkspaceConstants.WORKSPACE_BOM_VERSION, _targetPlatform); - ReleaseEntry releaseEntry = LiferayWorkspaceSupport.getReleaseEntry("portal", _targetPlatform); - if (Objects.nonNull(releaseEntry)) { properties.setProperty(WorkspaceConstants.BUNDLE_URL_PROPERTY, releaseEntry.getBundleURL()); diff --git a/src/main/java/com/liferay/ide/idea/ui/modules/springmvcportlet/SpringMVCPortletModuleBuilder.java b/src/main/java/com/liferay/ide/idea/ui/modules/springmvcportlet/SpringMVCPortletModuleBuilder.java index 7521793b..03c4ddaa 100644 --- a/src/main/java/com/liferay/ide/idea/ui/modules/springmvcportlet/SpringMVCPortletModuleBuilder.java +++ b/src/main/java/com/liferay/ide/idea/ui/modules/springmvcportlet/SpringMVCPortletModuleBuilder.java @@ -32,6 +32,7 @@ import com.liferay.ide.idea.util.CoreUtil; import com.liferay.ide.idea.util.IntellijUtil; import com.liferay.ide.idea.util.LiferayWorkspaceSupport; +import com.liferay.release.util.ReleaseEntry; import java.io.File; @@ -193,12 +194,12 @@ private void _createProject(VirtualFile projectRoot, Project project, String typ args.add("create -d"); args.add(BladeCLI.quote(virtualFile.getPath())); + String targetPlatformVersion = LiferayWorkspaceSupport.getTargetPlatformVersion(project); + if (Objects.equals(typeId, LiferayProjectType.LIFERAY_MAVEN_WORKSPACE)) { args.add("-b"); args.add("maven"); - String targetPlatformVersion = LiferayWorkspaceSupport.getTargetPlatformVersion(project); - if (targetPlatformVersion != null) { args.add("-v"); args.add(targetPlatformVersion); @@ -209,6 +210,15 @@ private void _createProject(VirtualFile projectRoot, Project project, String typ args.add(_liferayProductGroupVersion); } + if (targetPlatformVersion != null) { + ReleaseEntry releaseEntry = LiferayWorkspaceSupport.getReleaseEntry("portal", targetPlatformVersion); + + if (releaseEntry != null) { + args.add("--liferay-product"); + args.add(releaseEntry.getProduct()); + } + } + args.add("--base"); args.add(BladeCLI.quote(project.getBasePath())); args.add("-t");