use of com.mulesoft.tools.migration.exception.MigrationStepException in project mule-migration-assistant by mulesoft.
the class SetSecureProperties method execute.
@Override
public void execute(Path projectBasePath, MigrationReport report) throws RuntimeException {
try {
List<String> secureProperties = resolveSecureProperties(projectBasePath);
if (!secureProperties.isEmpty()) {
MuleArtifactJsonModel currentModel = MuleArtifactJsonModelUtils.buildMuleArtifactJson(projectBasePath.resolve(MULE_ARTIFACT_JSON));
MuleArtifactJsonModel updatedModel = MuleArtifactJsonModelUtils.buildMinimalMuleArtifactJson(currentModel.getMinMuleVersion(), secureProperties);
FileUtils.write(projectBasePath.resolve(MULE_ARTIFACT_JSON).toFile(), updatedModel.toString(), MULE_ARTIFACT_DEFAULT_CHARSET);
}
} catch (IOException e) {
throw new MigrationStepException("Could not update secureProperties based on mule-app.properties", e);
}
}
Aggregations