X-Git-Url: https://gerrit.onap.org/r/gitweb?p=policy%2Fengine.git;a=blobdiff_plain;f=BRMSGateway%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fpolicy%2Fbrms%2Fapi%2FBrmsPush.java;h=9651618b7da3e3e2f28051a4752151b97f303e0d;hp=0c43aeef719a078c57cd5823b08cb03c84826f28;hb=02544540c9bb24c87e0c2497476feaf98197ca15;hpb=1c5d6cdf3793b0691686dc34c742f62582daff50 diff --git a/BRMSGateway/src/main/java/org/onap/policy/brms/api/BrmsPush.java b/BRMSGateway/src/main/java/org/onap/policy/brms/api/BrmsPush.java index 0c43aeef7..9651618b7 100644 --- a/BRMSGateway/src/main/java/org/onap/policy/brms/api/BrmsPush.java +++ b/BRMSGateway/src/main/java/org/onap/policy/brms/api/BrmsPush.java @@ -60,7 +60,7 @@ import javax.persistence.Persistence; import javax.persistence.TypedQuery; import javax.ws.rs.ProcessingException; import org.apache.commons.io.FileUtils; -import org.apache.commons.lang.StringEscapeUtils; +import org.apache.commons.lang3.StringEscapeUtils; import org.apache.maven.model.Dependency; import org.apache.maven.model.DeploymentRepository; import org.apache.maven.model.DistributionManagement; @@ -117,7 +117,7 @@ public class BrmsPush { private static final Logger LOGGER = FlexLogger.getLogger(BrmsPush.class.getName()); private static final String PROJECTSLOCATION = "RuleProjects"; private static final String[] GOALS = {"clean", "deploy"}; - private static final String DEFAULT_VERSION = "1.6.0-SNAPSHOT"; + private static final String DEFAULT_VERSION = "1.6.1"; private static final String DEPENDENCY_FILE = "dependency.json"; private static final String PROP_AES_KEY = "org.onap.policy.encryption.aes.key"; public static final String BRMSPERSISTENCE = "brmsEclipselink.persistencexml"; @@ -256,8 +256,8 @@ public class BrmsPush { repUrlList = new ArrayList<>(); repUrlList.add(repUrl); } - repUserName = config.getProperty("repositoryUsername"); - repPassword = PeCryptoUtils.decrypt(config.getProperty("repositoryPassword")); + repUserName = getValue(config.getProperty("repositoryUsername")); + repPassword = PeCryptoUtils.decrypt(getValue(config.getProperty("repositoryPassword"))); if (repUserName == null || repPassword == null) { LOGGER.error(XACMLErrorConstants.ERROR_DATA_ISSUE + "repostoryUserName and respositoryPassword properties are required."); @@ -367,6 +367,13 @@ public class BrmsPush { } + private String getValue(final String value) { + if (value != null && value.matches("[$][{].*[}]$")) { + return System.getenv(value.substring(2, value.length() - 1)); + } + return value; + } + private static void setBackupMonitor(final BackUpMonitor instance) { bm = instance; }