if (deploymentStream != null) {
deploymentPlan = createTempFile(null);
copyTo(deploymentPlan, deploymentStream);
}
}
Artifact configID = null;
if(deploymentPlan != null) {
String extracted = ConfigIDExtractor.extractModuleIdFromPlan(deploymentPlan);
if(extracted != null) {
configID = Artifact.create(extracted);
}
} else {
String extracted = ConfigIDExtractor.extractModuleIdFromArchive(moduleArchive);
if(extracted != null) {
configID = Artifact.create(extracted);
}
}
if(configID != null && configID.getGroupId() == null) {
configID = new Artifact(Artifact.DEFAULT_GROUP_ID, configID.getArtifactId(),
configID.getVersion(), configID.getType());
}
ConfigurationManager configurationManager = ConfigurationUtil.getConfigurationManager(kernel);
try {
for (int i = 0; i < modules.length; i++) {
TargetModuleIDImpl module = (TargetModuleIDImpl) modules[i];
Artifact artifact = Artifact.create(module.getModuleID());
if(configID != null && configID.isResolved()) {
if(configID.getGroupId().equals(artifact.getGroupId()) &&
configID.getArtifactId().equals(artifact.getArtifactId()) &&
configID.getVersion().equals(artifact.getVersion())) {
redeploySameConfiguration(configurationManager, artifact, module.getTarget());
} else {
redeployUpdatedConfiguration(configurationManager, artifact, module.getTarget());
}
} else {