use of com.mulesoft.tools.migration.project.model.pom.PomModelUtils.MULE_APPLICATION_3_PACKAGING_TYPE in project mule-migration-assistant by mulesoft.
the class UpdateMuleMavenPlugin method execute.
@Override
public void execute(PomModel pomModel, MigrationReport report) throws RuntimeException {
String packagingType = pomModel.getPackaging();
if (StringUtils.equals(packagingType, MULE_APPLICATION_3_PACKAGING_TYPE)) {
pomModel.setPackaging(MULE_APPLICATION_4_PACKAGING_TYPE);
}
Plugin muleMavenPlugin = pomModel.removePlugin(p -> p.getArtifactId().equals(MULE_MAVEN_PLUGIN_ARTIFACT_ID)).orElse(buildMule4MuleMavenPluginConfiguration());
muleMavenPlugin.setVersion(MULE_MAVEN_PLUGIN_VERSION);
muleMavenPlugin.setExtensions("true");
Xpp3Dom configuration = muleMavenPlugin.getConfiguration();
if (configuration != null) {
updateDeploymentConfiguration(configuration);
}
pomModel.addPlugin(muleMavenPlugin);
}
Aggregations