Skip to content

Commit

Permalink
LPD-29388 com.liferay.ide.maven.core: updates usages
Browse files Browse the repository at this point in the history
  • Loading branch information
drewbrokke committed Aug 2, 2024
1 parent cebeee4 commit a4a702e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Require-Bundle: biz.aQute.bndlib,
com.liferay.ide.project.core,
com.liferay.ide.server.core,
com.liferay.ide.theme.core,
com.liferay.release.util,
org.apache.commons.io,
org.apache.httpcomponents.httpclient,
org.apache.httpcomponents.httpcore,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,20 @@
package com.liferay.ide.maven.core;

import com.liferay.ide.core.ILiferayProject;
import com.liferay.ide.core.ProductInfo;
import com.liferay.ide.core.util.CoreUtil;
import com.liferay.ide.core.util.FileUtil;
import com.liferay.ide.core.util.ReleaseUtil;
import com.liferay.ide.core.util.SapphireContentAccessor;
import com.liferay.ide.core.workspace.LiferayWorkspaceUtil;
import com.liferay.ide.core.workspace.WorkspaceConstants;
import com.liferay.ide.project.core.ProjectCore;
import com.liferay.ide.project.core.modules.BladeCLI;
import com.liferay.ide.project.core.util.ProjectUtil;
import com.liferay.ide.project.core.workspace.NewLiferayWorkspaceOp;
import com.liferay.ide.project.core.workspace.NewLiferayWorkspaceProjectProvider;
import com.liferay.release.util.ReleaseEntry;

import java.io.File;

import java.util.Map;
import java.util.Objects;
import java.util.Properties;

import org.apache.maven.model.Model;
Expand Down Expand Up @@ -61,7 +59,7 @@ public IStatus createNewProject(NewLiferayWorkspaceOp op, IProgressMonitor monit

IPath workspaceLocation = location.append(workspaceName);

String version = get(op.getTargetPlatform());
String version = get(op.getProductVersion());

StringBuilder sb = new StringBuilder();

Expand Down Expand Up @@ -93,29 +91,15 @@ public IStatus createNewProject(NewLiferayWorkspaceOp op, IProgressMonitor monit

String targetPlatform = get(op.getTargetPlatform());

Map<String, ProductInfo> productInfos = ProjectUtil.getProductInfos();
properties.setProperty(WorkspaceConstants.WORKSPACE_BOM_VERSION, targetPlatform);

ProductInfo productInfo = null;
ReleaseEntry releaseEntry = ReleaseUtil.getReleaseEntry(targetPlatform);

for (ProductInfo product : productInfos.values()) {
try {
if (Objects.equals(product.getTargetPlatformVersion(), targetPlatform)) {
productInfo = product;
if (releaseEntry != null) {
properties.setProperty(WorkspaceConstants.BUNDLE_URL_PROPERTY, releaseEntry.getBundleURL());

break;
}
}
catch (Exception exception) {
exception.printStackTrace();
}
MavenUtil.updateMavenPom(pomModel, pomFile);
}

properties.setProperty(WorkspaceConstants.WORKSPACE_BOM_VERSION, targetPlatform);

properties.setProperty(
WorkspaceConstants.BUNDLE_URL_PROPERTY, ProjectUtil.decodeBundleUrl(productInfo));

MavenUtil.updateMavenPom(pomModel, pomFile);
}
catch (Exception e) {
LiferayMavenCore.logError(e);
Expand Down

0 comments on commit a4a702e

Please sign in to comment.