Search in sources :

Example 1 with MULE_APPLICATION_4_PACKAGING_TYPE

use of com.mulesoft.tools.migration.project.model.pom.PomModelUtils.MULE_APPLICATION_4_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);
}
Also used : IntStream.range(java.util.stream.IntStream.range) PomContribution(com.mulesoft.tools.migration.step.category.PomContribution) Set(java.util.Set) MULE_APPLICATION_4_PACKAGING_TYPE(com.mulesoft.tools.migration.project.model.pom.PomModelUtils.MULE_APPLICATION_4_PACKAGING_TYPE) MULE_MAVEN_PLUGIN_ARTIFACT_ID(com.mulesoft.tools.migration.project.model.pom.PomModelUtils.MULE_MAVEN_PLUGIN_ARTIFACT_ID) Xpp3Dom(org.codehaus.plexus.util.xml.Xpp3Dom) MULE_MAVEN_PLUGIN_VERSION(com.mulesoft.tools.migration.project.model.pom.PomModelUtils.MULE_MAVEN_PLUGIN_VERSION) MigrationReport(com.mulesoft.tools.migration.step.category.MigrationReport) StringUtils(org.apache.commons.lang3.StringUtils) OptionalInt(java.util.OptionalInt) HashSet(java.util.HashSet) MULE_APPLICATION_3_PACKAGING_TYPE(com.mulesoft.tools.migration.project.model.pom.PomModelUtils.MULE_APPLICATION_3_PACKAGING_TYPE) PomModelUtils.buildMule4MuleMavenPluginConfiguration(com.mulesoft.tools.migration.project.model.pom.PomModelUtils.buildMule4MuleMavenPluginConfiguration) Plugin(com.mulesoft.tools.migration.project.model.pom.Plugin) PomModel(com.mulesoft.tools.migration.project.model.pom.PomModel) Xpp3Dom(org.codehaus.plexus.util.xml.Xpp3Dom) Plugin(com.mulesoft.tools.migration.project.model.pom.Plugin)

Aggregations

Plugin (com.mulesoft.tools.migration.project.model.pom.Plugin)1 PomModel (com.mulesoft.tools.migration.project.model.pom.PomModel)1 MULE_APPLICATION_3_PACKAGING_TYPE (com.mulesoft.tools.migration.project.model.pom.PomModelUtils.MULE_APPLICATION_3_PACKAGING_TYPE)1 MULE_APPLICATION_4_PACKAGING_TYPE (com.mulesoft.tools.migration.project.model.pom.PomModelUtils.MULE_APPLICATION_4_PACKAGING_TYPE)1 MULE_MAVEN_PLUGIN_ARTIFACT_ID (com.mulesoft.tools.migration.project.model.pom.PomModelUtils.MULE_MAVEN_PLUGIN_ARTIFACT_ID)1 MULE_MAVEN_PLUGIN_VERSION (com.mulesoft.tools.migration.project.model.pom.PomModelUtils.MULE_MAVEN_PLUGIN_VERSION)1 PomModelUtils.buildMule4MuleMavenPluginConfiguration (com.mulesoft.tools.migration.project.model.pom.PomModelUtils.buildMule4MuleMavenPluginConfiguration)1 MigrationReport (com.mulesoft.tools.migration.step.category.MigrationReport)1 PomContribution (com.mulesoft.tools.migration.step.category.PomContribution)1 HashSet (java.util.HashSet)1 OptionalInt (java.util.OptionalInt)1 Set (java.util.Set)1 IntStream.range (java.util.stream.IntStream.range)1 StringUtils (org.apache.commons.lang3.StringUtils)1 Xpp3Dom (org.codehaus.plexus.util.xml.Xpp3Dom)1