From 4ba38a49310f3754cec0f0bb6bf145bc83878b0c Mon Sep 17 00:00:00 2001 From: richardyam-tibco Date: Thu, 22 Sep 2022 09:24:38 -0700 Subject: [PATCH] AMBW-46748 [Maven] Profile value is not updated in 'generate pom.xml' once user deploys application using 'external profile'/ 'other profile' option --- .../tibco/bw/maven/plugin/admin/client/RemoteDeployer.java | 5 ++++- .../bw/maven/plugin/application/BWEARInstallerMojo.java | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Source/bw6-maven-plugin/src/main/java/com/tibco/bw/maven/plugin/admin/client/RemoteDeployer.java b/Source/bw6-maven-plugin/src/main/java/com/tibco/bw/maven/plugin/admin/client/RemoteDeployer.java index ba1f0bc4..bd16a704 100644 --- a/Source/bw6-maven-plugin/src/main/java/com/tibco/bw/maven/plugin/admin/client/RemoteDeployer.java +++ b/Source/bw6-maven-plugin/src/main/java/com/tibco/bw/maven/plugin/admin/client/RemoteDeployer.java @@ -339,7 +339,10 @@ public void addAndDeployApplication(final String domainName, final String appSpa } log.info("Deploying the Application with name -> " + appName + " with Profile -> " + profile); deployApplication(domainName, appSpaceName, earName, path, startOndeploy, replace, profile,externalProfile,appDescription); - if(externalProfile){ + // fix from runtime side only + // UI doesn't seem to fix the externalProfile flag when profile is set to an application Profile + // We should use the external profile here if this is really the case + if(externalProfile && !externalProfileLoc.isEmpty() && (profile != null && profile.equals("other")) ) { setProfile(domainName,appSpaceName,version,appName,externalProfileLoc); log.info("Starting Application -> "+ appName); if(startOndeploy){ diff --git a/Source/bw6-maven-plugin/src/main/java/com/tibco/bw/maven/plugin/application/BWEARInstallerMojo.java b/Source/bw6-maven-plugin/src/main/java/com/tibco/bw/maven/plugin/application/BWEARInstallerMojo.java index f1fa2edc..b207afbd 100644 --- a/Source/bw6-maven-plugin/src/main/java/com/tibco/bw/maven/plugin/application/BWEARInstallerMojo.java +++ b/Source/bw6-maven-plugin/src/main/java/com/tibco/bw/maven/plugin/application/BWEARInstallerMojo.java @@ -479,7 +479,10 @@ private boolean validateFields() { } boolean isValidexternalProfileLoc = true; - if(externalProfile && externalProfileLoc.isEmpty()) { + // fix from runtime side only + // UI doesn't seem to fix the externalProfile flag when profile is set to an application Profile + // We should give error only if profile is set to "other" and not an interal application profile + if(externalProfile && externalProfileLoc.isEmpty() && (profile != null && profile.equals("other")) ) { isValidexternalProfileLoc = false; errorMessage.append("[external Profile Location value is required]"); }