use of com.mulesoft.tools.migration.project.model.pom.Dependency.DependencyBuilder in project mule-migration-assistant by mulesoft.
the class MUnitPomContribution method execute.
@Override
public void execute(PomModel pomModel, MigrationReport report) throws RuntimeException {
pomModel.addDependency(new DependencyBuilder().withGroupId("com.mulesoft.munit").withArtifactId("munit-runner").withVersion(targetVersion("munit-maven-plugin")).withClassifier("mule-plugin").withScope("test").build());
pomModel.addDependency(new DependencyBuilder().withGroupId("com.mulesoft.munit").withArtifactId("munit-tools").withVersion(targetVersion("munit-maven-plugin")).withClassifier("mule-plugin").withScope("test").build());
if (!getMUnitPlugin(pomModel).isEmpty()) {
Plugin munitPlugin = getMUnitPlugin(pomModel).get(0);
munitPlugin.setVersion(targetVersion("munit-maven-plugin"));
} else {
pomModel.addPlugin(buildMunitPlugin());
}
pomModel.removeProperty(MUNIT_SUPPORT_PROPERTY);
pomModel.removeProperty(MUNIT_PROPERTY);
pomModel.addProperty(MUNIT_PROPERTY, targetVersion("munit-maven-plugin"));
}
use of com.mulesoft.tools.migration.project.model.pom.Dependency.DependencyBuilder in project mule-migration-assistant by mulesoft.
the class DomainReferencePomContribution method execute.
@Override
public void execute(PomModel object, MigrationReport report) throws RuntimeException {
Properties properties = new Properties();
File file = getApplicationModel().getSourceProjectBasePath().resolve("src" + separator + "main" + separator + "app" + separator + "mule-deploy.properties").toFile();
if (!file.exists()) {
return;
}
try (FileInputStream inStream = new FileInputStream(file)) {
properties.load(inStream);
} catch (IOException e) {
throw new RuntimeException(e);
}
if (!properties.containsKey("domain")) {
return;
}
String domain = properties.getProperty("domain");
if ("default".equals(domain)) {
return;
}
if (getApplicationModel().getDomainDocuments() == null || getApplicationModel().getDomainDocuments().isEmpty()) {
throw new MigrationAbortException(format("The application to migrate references a domain '%s'. " + "Call the migrator with the 'parentDomainBasePath' parameter indicating the Mule 3 source for that domain.", domain));
}
object.addDependency(new DependencyBuilder().withGroupId("org.mule.migrated").withArtifactId(domain).withVersion("1.0.0-M4-SNAPSHOT").withClassifier("mule-domain").withScope("provided").build());
}
use of com.mulesoft.tools.migration.project.model.pom.Dependency.DependencyBuilder in project mule-migration-assistant by mulesoft.
the class SocketsConfig method addSocketsModule.
public static void addSocketsModule(ApplicationModel applicationModel) {
applicationModel.getPomModel().ifPresent(pom -> pom.addDependency(new DependencyBuilder().withGroupId("org.mule.connectors").withArtifactId("mule-sockets-connector").withVersion(targetVersion("mule-sockets-connector")).withClassifier("mule-plugin").build()));
applicationModel.addNameSpace("sockets", "http://www.mulesoft.org/schema/mule/sockets", "http://www.mulesoft.org/schema/mule/sockets/current/mule-sockets.xsd");
}
use of com.mulesoft.tools.migration.project.model.pom.Dependency.DependencyBuilder in project mule-migration-assistant by mulesoft.
the class SpringPomContribution method execute.
@Override
public void execute(PomModel object, MigrationReport report) throws RuntimeException {
object.addDependency(new DependencyBuilder().withGroupId("org.mule.modules").withArtifactId("mule-spring-module").withVersion(targetVersion("mule-spring-module")).withClassifier("mule-plugin").build());
Dependency springCore = new DependencyBuilder().withGroupId("org.springframework").withArtifactId("spring-core").withVersion(SPRING_VERSION).build();
object.addDependency(springCore);
Dependency springBeans = new DependencyBuilder().withGroupId("org.springframework").withArtifactId("spring-beans").withVersion(SPRING_VERSION).build();
object.addDependency(springBeans);
Dependency springContext = new DependencyBuilder().withGroupId("org.springframework").withArtifactId("spring-context").withVersion(SPRING_VERSION).build();
object.addDependency(springContext);
Dependency springAop = new DependencyBuilder().withGroupId("org.springframework").withArtifactId("spring-aop").withVersion(SPRING_VERSION).build();
object.addDependency(springAop);
Dependency springSecurityCore = new DependencyBuilder().withGroupId("org.springframework.security").withArtifactId("spring-security-core").withVersion(SPRING_SECURITY_VERSION).build();
object.addDependency(springSecurityCore);
Dependency springSecurityConfig = new DependencyBuilder().withGroupId("org.springframework.security").withArtifactId("spring-security-config").withVersion(SPRING_SECURITY_VERSION).build();
object.addDependency(springSecurityConfig);
addSharedLibs(object, springCore, springBeans, springContext, springAop, springSecurityCore, springSecurityConfig);
}
use of com.mulesoft.tools.migration.project.model.pom.Dependency.DependencyBuilder in project mule-migration-assistant by mulesoft.
the class SecurePropertiesPomContribution method execute.
@Override
public void execute(PomModel object, MigrationReport report) throws RuntimeException {
object.addDependency(new DependencyBuilder().withGroupId("com.mulesoft.modules").withArtifactId("mule-secure-configuration-property-module").withVersion(targetVersion("mule-secure-configuration-property-module")).withClassifier("mule-plugin").build());
object.removeDependency(new DependencyBuilder().withGroupId("com.mulesoft.security").withArtifactId("mule-module-security-property-placeholder").withVersion("*").build());
}
Aggregations