public void append(Build other) { Properties properties = other.getProperties(); Env otherEnv = new Env(); if (properties != null) { for (String key : properties.stringPropertyNames()) { boolean isEnvVar = StringUtils.startsWith(key, BuildInfoProperties.BUILD_INFO_ENVIRONMENT_PREFIX); if (isEnvVar) { otherEnv.getEnvVars().put(StringUtils.substringAfter(key, BuildInfoProperties.BUILD_INFO_ENVIRONMENT_PREFIX), properties.getProperty(key)); } else { otherEnv.getSysVars().put(key, properties.getProperty(key)); } } this.env.append(otherEnv); } if (other.getModules() != null) { other.getModules().forEach(this::addModule); } if (other.getBuildDependencies() != null) { this.buildDependencies.addAll(other.getBuildDependencies()); } }