Skip to content

Commit da6e5ed

Browse files
authored
Merge pull request #499 from RichardHoch/openrewrite
OpenRewrite description for MTA CLI guide
2 parents de00834 + 2044f55 commit da6e5ed

File tree

18 files changed

+15420
-23
lines changed

18 files changed

+15420
-23
lines changed

docs/cli-guide/master.adoc

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ include::topics/templates/document-attributes.adoc[]
77
:numbered:
88
:imagesdir: topics/images
99
:context: cli-guide
10+
:cli-guide:
1011

1112
//Inclusive language statement
1213
include::topics/making-open-source-more-inclusive.adoc[]
@@ -22,13 +23,16 @@ include::topics/what-is-the-toolkit.adoc[leveloffset=+2]
2223
// About the {CLINameTitle}
2324
include::topics/about-cli.adoc[leveloffset=+2]
2425

25-
== Getting started
26+
== Installing and Running the CLI
2627

2728
// Install the CLI
2829
include::topics/installing-web-console-or-cli-tool.adoc[leveloffset=+2]
2930

3031
// Run the CLI
31-
include::topics/execute.adoc[leveloffset=+2]
32+
include::topics/cli-run.adoc[leveloffset=+2]
33+
34+
// Use OpenRewrite recipes
35+
include::topics/using-openrewrite-recipes.adoc[leveloffset=+3]
3236

3337
// Access the Report
3438
include::topics/access-report.adoc[leveloffset=+2]

docs/topics/execute.adoc renamed to docs/topics/cli-run.adoc

Lines changed: 28 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// * docs/cli-guide/master.adoc
44

5-
[id="execute_{context}"]
5+
[id="cli-run_{context}"]
66
= Running the {CLINameTitle}
77

88
You can run {ProductShortName} against your application.
@@ -12,9 +12,11 @@ You can run {ProductShortName} against your application.
1212
. Open a terminal and navigate to the `<MTA_HOME>/bin/` directory.
1313
. Execute the `mta-cli` script, or `mta-cli.bat` for Windows, and specify the appropriate arguments:
1414
+
15-
[source,options="nowrap",subs="+quotes"]
15+
[source,terminal]
1616
----
17-
$ ./mta-cli --input /path/to/jee-example-app-1.0.0.ear --output /path/to/output --source weblogic --target eap:6 --packages com.acme org.apache
17+
$ ./mta-cli --input /path/to/jee-example-app-1.0.0.ear \
18+
--output /path/to/output --source weblogic --target eap:6 \
19+
--packages com.acme org.apache
1820
----
1921
+
2022
* `--input`: The application to be evaluated.
@@ -25,56 +27,63 @@ $ ./mta-cli --input /path/to/jee-example-app-1.0.0.ear --output /path/to/output
2527

2628
. Access the report.
2729

28-
[discrete]
2930
[id="command-examples_{context}"]
30-
== {ProductShortName} Command examples
31+
== {ProductShortName} command examples
3132

3233
[discrete]
3334
=== Running {ProductShortName} on an application archive
3435

3536
The following command analyzes the `com.acme` and `org.apache` packages of the link:https://github.com/windup/windup/blob/master/test-files/jee-example-app-1.0.0.ear[jee-example-app-1.0.0.ear] example EAR archive for migrating from JBoss EAP 5 to JBoss EAP 7:
3637

38+
[source,terminal]
3739
----
38-
$ <MTA_HOME>/bin/mta-cli --input /path/to/jee-example-app-1.0.0.ear --output /path/to/report-output/ --source eap:5 --target eap:7 --packages com.acme org.apache
40+
$ <MTA_HOME>/bin/mta-cli \
41+
--input /path/to/jee-example-app-1.0.0.ear \
42+
--output /path/to/report-output/ --source eap:5 --target eap:7 \
43+
--packages com.acme org.apache
3944
----
4045

4146
[discrete]
4247
=== Running {ProductShortName} on source code
4348

4449
The following command analyzes the `org.jboss.seam` packages of the link:https://github.com/windup/windup/tree/master/test-files/seam-booking-5.2[seam-booking-5.2] example source code for migrating to JBoss EAP 6.
4550

46-
[source,options="nowrap",subs="+quotes"]
51+
[source,terminal]
4752
----
48-
$ <MTA_HOME>/bin/mta-cli --sourceMode --input /path/to/seam-booking-5.2/ --output /path/to/report-output/ --target eap:6 --packages org.jboss.seam
53+
$ <MTA_HOME>/bin/mta-cli --sourceMode --input /path/to/seam-booking-5.2/ \
54+
--output /path/to/report-output/ --target eap:6 --packages org.jboss.seam
4955
----
5056

5157
[discrete]
5258
=== Running cloud-readiness rules
5359

5460
The following command analyzes the `com.acme` and `org.apache` packages of the link:https://github.com/windup/windup/blob/master/test-files/jee-example-app-1.0.0.ear[jee-example-app-1.0.0.ear] example EAR archive for migrating to JBoss EAP 7. It also evaluates for cloud readiness:
5561

56-
[source,options="nowrap",subs="+quotes"]
62+
[source,terminal]
5763
----
58-
$ <MTA_HOME>/bin/mta-cli --input /path/to/jee-example-app-1.0.0.ear --output /path/to/report-output/ --target eap:7 --target cloud-readiness --packages com.acme org.apache
64+
$ <MTA_HOME>/bin/mta-cli --input /path/to/jee-example-app-1.0.0.ear \
65+
--output /path/to/report-output/ \
66+
--target eap:7 --target cloud-readiness --packages com.acme org.apache
5967
----
6068

6169
[discrete]
6270
=== Overriding {ProductShortName} properties
6371

6472
To override the default _Fernflower_ decompiler, pass the `-Dwindup.decompiler` argument on the command line. For example, to use the _Procyon_ decompiler, use the following syntax:
6573

66-
[source,options="nowrap",subs="+quotes"]
74+
[source,terminal]
6775
----
68-
$ <MTA_HOME>/bin/mta-cli -Dwindup.decompiler=procyon --input <INPUT_ARCHIVE_OR_DIRECTORY> --output <OUTPUT_REPORT_DIRECTORY> --target <TARGET_TECHNOLOGY> --packages <PACKAGE_1> <PACKAGE_2>
76+
$ <MTA_HOME>/bin/mta-cli -Dwindup.decompiler=procyon \
77+
--input <INPUT_ARCHIVE_OR_DIRECTORY> --output <OUTPUT_REPORT_DIRECTORY> \
78+
--target <TARGET_TECHNOLOGY> --packages <PACKAGE_1> <PACKAGE_2>
6979
----
7080

71-
[discrete]
7281
[id="cli-bash-completion_{context}"]
73-
== About {ProductShortName} {CLINameTitle} Bash completion
82+
== {ProductShortName} {CLINameTitle} Bash completion
7483

7584
The {ProductShortName} {CLIName} provides an option to enable Bash completion for Linux systems, allowing the {ProductShortName} command-line arguments to be auto completed by pressing the Tab key when entering the commands. For instance, when Bash completion is enabled, entering the following displays a list of available arguments.
7685

77-
[source,options="nowrap",subs="+quotes"]
86+
[source,terminal]
7887
----
7988
$ <MTA_HOME>/bin/mta-cli [TAB]
8089
----
@@ -85,7 +94,7 @@ $ <MTA_HOME>/bin/mta-cli [TAB]
8594

8695
To enable Bash completion for the current shell, execute the following command:
8796

88-
[source,options="nowrap",subs="+quotes"]
97+
[source,terminal]
8998
----
9099
$ source <MTA_HOME>/bash-completion/mta-cli
91100
----
@@ -98,25 +107,24 @@ The following commands allow Bash completion to persist across restarts:
98107

99108
* To enable Bash completion for a specific user across system restarts, include the following line in that user's `~/.bashrc` file.
100109
+
101-
[source,options="nowrap",subs="+quotes"]
110+
[source,terminal]
102111
----
103112
source <MTA_HOME>/bash-completion/mta-cli
104113
----
105114

106115
* To enable Bash completion for all users across system restarts, copy the {ProductName} {CLIName} Bash completion file to the `/etc/bash_completion.d/` directory as the root user.
107116
+
108-
[source,options="nowrap",subs="+quotes"]
117+
[source,terminal]
109118
----
110119
# cp <MTA_HOME>/bash-completion/mta-cli /etc/bash_completion.d/
111120
----
112121

113-
[discrete]
114122
[id="accessing-help_{context}"]
115123
== Accessing {ProductShortName} help
116124

117125
To see the complete list of available arguments for the `mta-cli` command, open a terminal, navigate to the `<MTA_HOME>` directory, and execute the following command:
118126

119-
[source, options="nowrap",subs="+quotes"]
127+
[source,terminal]]
120128
----
121129
$ <MTA_HOME>/bin/mta-cli --help
122130
----

docs/topics/proc_cli-execute.adoc

Whitespace-only changes.

docs/topics/proc_using-openrewrite-recipes.adoc

Whitespace-only changes.

docs/topics/rn-new-features.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ To execute the rules, use the target `jakarta-ee`.
1818

1919
link:https://docs.openrewrite.org/[OpenRewrite] automates large-scale, distributed source code refactoring. You can execute OpenRewrite recipes by using the link:{ProductDocUserGuideURL}[{ProductShortName} CLI].
2020

21-
The first OpenRewrite recipe, which is shipped with {ProductShortName} 5.2.1, renames imported `javax` packages to their `jakarta` equivalents.
21+
The OpenRewrite recipe `org.jboss.windup.JavaxToJakarta`, which is shipped with {ProductShortName} 5.2.1, renames imported `javax` packages to their `jakarta` equivalents.
2222

2323
[IMPORTANT]
2424
====
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
// Module included in the following module:
2+
//
3+
// * docs/topics/cli-run
4+
5+
[id=using-openrewrite-recipes_{context}]
6+
= Using OpenRewrite recipes
7+
8+
[IMPORTANT]
9+
====
10+
OpenRewrite recipe support is provided as Technology Preview only. Technology Preview features are not supported with Red Hat production service level agreements (SLAs), might not be functionally complete, and Red Hat does not recommend to use them for production. These features provide early access to upcoming product features, enabling customers to test functionality and provide feedback during the development process.
11+
12+
See link:{KBArticleTechnologyPreview}[Technology Preview features support scope] on the Red&nbsp;Hat Customer Portal for information about the support scope for Technology Preview features.
13+
====
14+
15+
You can refactor the source code of Java applications by using link:https://docs.openrewrite.org/[OpenRewrite] recipes with the {ProductShortName} CLI.
16+
17+
The OpenRewrite recipe `org.jboss.windup.JavaxToJakarta` renames imported `javax` packages to their `jakarta` equivalents.
18+
19+
.Procedure
20+
21+
. Run`mta-cli`, specifying the recipe name and the application:
22+
+
23+
[source,terminal]
24+
----
25+
$ ./mta-cli --openrewrite "-DactiveRecipes=<recipe_name>" \
26+
--input </path/to/source/project> --goal dryRun
27+
----
28+
29+
* `"-DactiveRecipes=<recipe name>"`: Specify the OpenRewrite recipe, for example, `org.jboss.windup.JavaxToJakarta`.
30+
31+
* `--input`: Specify the application to be refactored.
32+
33+
* `--goal`: Optional: The OpenRewrite Maven goal to run.
34+
** `dryRun` : The script returns a list of proposed changes. Ignore the `"Run 'mvn rewrite:run' to apply the recipes"` message.
35+
** `run`: The script applies the changes.
36+
37+
. Run `mta-cli` with `--goal run` to apply the recipe:
38+
+
39+
[source,terminal]
40+
----
41+
$ ./mta-cli --openrewrite "-DactiveRecipes=<recipe name>" \
42+
--input </path/to/source/project> --goal run
43+
----

website/docs/cli-guide/master.adoc

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
include::topics/templates/document-attributes.adoc[]
2+
[id="cli-guide"]
3+
= CLI Guide
4+
5+
:toc:
6+
:toclevels: 4
7+
:numbered:
8+
:imagesdir: topics/images
9+
:context: cli-guide
10+
:cli-guide:
11+
12+
//Inclusive language statement
13+
include::topics/making-open-source-more-inclusive.adoc[]
14+
15+
== Introduction
16+
17+
// About the {UserCLIBookName}
18+
include::topics/about-cli-guide.adoc[leveloffset=+2]
19+
20+
// About {ProductName}
21+
include::topics/what-is-the-toolkit.adoc[leveloffset=+2]
22+
23+
// About the {CLINameTitle}
24+
include::topics/about-cli.adoc[leveloffset=+2]
25+
26+
== Installing and Running the CLI
27+
28+
// Install the CLI
29+
include::topics/installing-web-console-or-cli-tool.adoc[leveloffset=+2]
30+
31+
// Run the CLI
32+
include::topics/cli-run.adoc[leveloffset=+2]
33+
34+
// Access the Report
35+
include::topics/access-report.adoc[leveloffset=+2]
36+
37+
// Review the Reports
38+
include::topics/review-reports.adoc[leveloffset=+1]
39+
40+
// Export the Report in CSV Format
41+
include::topics/csv-export.adoc[leveloffset=+1]
42+
43+
// Mavenize Your Application
44+
include::topics/mavenize.adoc[leveloffset=+1]
45+
46+
// Optimize {ProductShortName} Performance
47+
include::topics/optimize-performance.adoc[leveloffset=+1]
48+
49+
// Configure {ProductShortName} to Exclude Files and Packages
50+
include::topics/exclude-files-and-packages.adoc[leveloffset=+2]
51+
52+
[appendix]
53+
== Reference material
54+
55+
// {ProductShortName} Command-line Arguments
56+
include::topics/cli-args.adoc[leveloffset=+2]
57+
58+
// Added in 4.3.0: list of supported Tech Tags
59+
include::topics/tech-tags.adoc[leveloffset=+2]
60+
61+
// Rule Story Points
62+
include::topics/about-story-points.adoc[leveloffset=+2]
63+
64+
For more information on categorizing tasks, see link:{ProductDocRulesGuideURL}/rule_categories_rules-development-guide#rule_categories_rules-development-guide[Using custom rule categories].
65+
66+
=== Additional Resources
67+
68+
// Get Involved
69+
include::topics/get-involved.adoc[leveloffset=+3]
70+
71+
// Important Links
72+
include::topics/important-links.adoc[leveloffset=+3]
73+
74+
// Report Issues with {ProductShortName}
75+
76+
==== Reporting issues
77+
78+
{ProductShortName} uses Jira as its issue tracking system. If you encounter an issue executing {ProductShortName}, submit a link:{JiraWindupURL}[Jira issue].
79+
80+
// **********************************
81+
// * Appendix: Revision Information *
82+
// **********************************
83+
include::topics/templates/revision-info.adoc[]

0 commit comments

Comments
 (0)