-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
+ support jdk 13+ + build with LTS jdks 8, 11 and 17
- Loading branch information
1 parent
7cb23a6
commit 5718d34
Showing
72 changed files
with
2,509 additions
and
693 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,8 +55,8 @@ If you would just like to download/access the MMA tool (compiled version), you c | |
See the following commands in order to clone, build and run this project | ||
|
||
``` | ||
$ git clone --recursive [email protected]:mulesoft/mule-migration-tool.git | ||
$ cd mule-migration-tool/ | ||
$ git clone --recursive [email protected]:mulesoft/mule-migration-assistant.git | ||
$ cd mule-migration-assistant/ | ||
$ mvn clean package | ||
$ cd runner/target | ||
$ java -jar mule-migration-assistant-runner-*CURRENT VERSION*.jar [parameters] | ||
|
@@ -72,6 +72,7 @@ $ java -jar mule-migration-assistant-runner-*CURRENT VERSION*.jar [parameters] | |
| help | Show all the parameters to define on MMA | No | | ||
| cancelOnError | Use cancelOnError = true the MMA stop migration if a exception occurs (default false) | No | | ||
| projectParentGAV | Use projectParentGAV 'groupId:artifactId:version' to migrate your parent inside the pom.xml | No | | ||
| jsonReport | Generate migration report in JSON format | No | | ||
|
||
|
||
### User Documentation | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
128 changes: 128 additions & 0 deletions
128
mule-migration-tool-api/src/main/java/com/mulesoft/tools/migration/step/ReportingStep.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,128 @@ | ||
/* | ||
* Copyright (c) 2020, Mulesoft, LLC. All rights reserved. | ||
* Use of this source code is governed by a BSD 3-Clause License | ||
* license that can be found in the LICENSE.txt file. | ||
*/ | ||
package com.mulesoft.tools.migration.step; | ||
|
||
import static com.mulesoft.tools.migration.step.category.MigrationReport.Level.ERROR; | ||
|
||
import com.mulesoft.tools.migration.project.model.ApplicationModel; | ||
import com.mulesoft.tools.migration.step.category.ApplicationModelContribution; | ||
import com.mulesoft.tools.migration.step.category.MigrationReport; | ||
import com.mulesoft.tools.migration.util.ExpressionMigrator; | ||
|
||
import java.util.List; | ||
|
||
import org.jdom2.Element; | ||
import org.jdom2.Namespace; | ||
import org.jdom2.xpath.XPathExpression; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
/** | ||
* Wrapper of ApplicationModelContribution steps that enables detailed reporting | ||
* of the element migration result. | ||
* | ||
* @author Mulesoft Inc. | ||
*/ | ||
public class ReportingStep implements ApplicationModelContribution, ExpressionMigratorAware { | ||
|
||
private static final Logger logger = LoggerFactory.getLogger(ReportingStep.class); | ||
|
||
private final ApplicationModelContribution targetStep; | ||
|
||
public ReportingStep(ApplicationModelContribution step) { | ||
targetStep = step; | ||
} | ||
|
||
/** | ||
* Wraps the step execution in order to report the element migration result | ||
* | ||
* success: | ||
* - report error count not increased OR | ||
* - report error count increased same amount as mel/dw errors | ||
* failure: | ||
* - report error count > mel/dw errors OR | ||
* - exception thrown | ||
*/ | ||
@Override | ||
public void execute(Element element, MigrationReport report) { | ||
int entriesBefore = report.getReportEntries(ERROR).size(); | ||
int melFailuresBefore = report.getMelExpressionsFailureCount(); | ||
int dwFailuresBefore = report.getDwTransformsFailureCount(); | ||
try { | ||
targetStep.execute(element, report); | ||
if (targetStep.shouldReportMetrics()) { | ||
if (report.getReportEntries(ERROR).size() <= entriesBefore + (report.getMelExpressionsFailureCount() - melFailuresBefore) | ||
+ (report.getDwTransformsFailureCount() - dwFailuresBefore)) { | ||
report.addComponentSuccess(element); | ||
} else { | ||
report.addComponentFailure(element); | ||
} | ||
} | ||
} catch (Exception e) { | ||
logger.warn("Exception {} -- migrating {}:{}", e, element != null ? element.getNamespacePrefix() : "null", | ||
element != null ? element.getName() : "null"); | ||
if (targetStep.shouldReportMetrics()) { | ||
report.addComponentFailure(element); | ||
} | ||
throw e; | ||
} | ||
} | ||
|
||
@Override | ||
public String getDescription() { | ||
return targetStep.getDescription(); | ||
} | ||
|
||
@Override | ||
public XPathExpression getAppliedTo() { | ||
return targetStep.getAppliedTo(); | ||
} | ||
|
||
@Override | ||
public void setAppliedTo(String xpathExpression) { | ||
targetStep.setAppliedTo(xpathExpression); | ||
} | ||
|
||
@Override | ||
public ApplicationModel getApplicationModel() { | ||
return targetStep.getApplicationModel(); | ||
} | ||
|
||
@Override | ||
public void setApplicationModel(ApplicationModel appModel) { | ||
targetStep.setApplicationModel(appModel); | ||
} | ||
|
||
@Override | ||
public List<Namespace> getNamespacesContributions() { | ||
return targetStep.getNamespacesContributions(); | ||
} | ||
|
||
@Override | ||
public void setNamespacesContributions(List<Namespace> namespaces) { | ||
targetStep.setNamespacesContributions(namespaces); | ||
} | ||
|
||
@Override | ||
public boolean shouldReportMetrics() { | ||
return targetStep.shouldReportMetrics(); | ||
} | ||
|
||
@Override | ||
public void setExpressionMigrator(ExpressionMigrator expressionMigrator) { | ||
if (targetStep instanceof ExpressionMigratorAware) { | ||
((ExpressionMigratorAware) targetStep).setExpressionMigrator(expressionMigrator); | ||
} | ||
} | ||
|
||
@Override | ||
public ExpressionMigrator getExpressionMigrator() { | ||
if (targetStep instanceof ExpressionMigratorAware) { | ||
return ((ExpressionMigratorAware) targetStep).getExpressionMigrator(); | ||
} | ||
return null; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
...pi/src/main/java/com/mulesoft/tools/migration/step/category/ComponentMigrationStatus.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* Copyright (c) 2020, Mulesoft, LLC. All rights reserved. | ||
* Use of this source code is governed by a BSD 3-Clause License | ||
* license that can be found in the LICENSE.txt file. | ||
*/ | ||
package com.mulesoft.tools.migration.step.category; | ||
|
||
/** | ||
* Indicates the migration result, either success or failure for all the instances of a given component. | ||
* | ||
* @author Mulesoft Inc. | ||
*/ | ||
public class ComponentMigrationStatus { | ||
|
||
private int success; | ||
private int failure; | ||
|
||
public int getSuccess() { | ||
return success; | ||
} | ||
|
||
public int getFailure() { | ||
return failure; | ||
} | ||
|
||
public void success() { | ||
success++; | ||
} | ||
|
||
public void failure() { | ||
failure++; | ||
} | ||
} |
Oops, something went wrong.