Ce contenu n'est pas disponible dans la langue sélectionnée.
Chapter 5. Managing rules
The MTR plugin comes with a core set of System rules for analyzing projects and identifying migration and modernization issues.
You can create and import custom rulesets.
5.1. Viewing rules Copier lienLien copié sur presse-papiers!
You can view system and custom rules, if any, for the MTR plugin.
Prerequisites
- To view system rules, the MTR server must be running.
Procedure
- Click the Rulesets tab.
- Expand System to view system rulesets or Custom to view custom rulesets.
- Expand a ruleset.
- Double-click a rule to open it in a viewer.
- Click the Source tab to view the XML source of the rule.
5.2. Creating a custom ruleset Copier lienLien copié sur presse-papiers!
You can create a custom ruleset in the MTR perspective.
See the Rule Development Guide to learn more about creating custom XML rules.
Procedure
- Click the Rulesets tab.
-
Click the Create Ruleset icon (
).
- Select a project and a directory for the ruleset.
Enter the file name.
NoteThe file must have the extension
.windup.xml
.-
Enter a ruleset ID, for example,
my-ruleset-id
. - Optional: Select Generate quickstart template to add basic rule templates to the file.
- Click Finish.
- The ruleset file opens in an editor and you can add and edit rules in the file.
- Click the Source tab to edit the XML source of the ruleset file.
You can select the new ruleset when you create a run configuration.
5.3. Importing a custom ruleset Copier lienLien copié sur presse-papiers!
You can import a custom ruleset into the MTR plugin to analyze your projects.
Prerequisites
Custom ruleset file with a
.windup.xml
extension.See the Rule Development Guide for information about creating rulesets.
Procedure
- Click the Rulesets tab.
-
Click the Import Ruleset icon (
).
Browse to and select the XML rule file to import.
The custom ruleset is displayed when you expand Custom on the Rulesets tab.
5.4. Submitting a custom ruleset Copier lienLien copié sur presse-papiers!
You can submit your custom ruleset for inclusion in the official MTR rule repository. This allows your custom rules to be reviewed and included in subsequent releases of MTR.
Procedure
- Click the Rulesets tab.
-
Click the Arrow icon (
) and select Submit Ruleset.
Complete the following fields:
- Summary: Describe the purpose of the rule. This becomes the title of the submission.
- Code Sample: Enter an example of the source code that the rule should run against.
- Description: Enter a brief description of the rule.
- Click Choose Files and select the ruleset file.
- Click Submit.