-
Notifications
You must be signed in to change notification settings - Fork 30
Cli analyze #847
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Cli analyze #847
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
db4977d
MTA - Eli fix PR#837
anarnold97 3ea5cb6
Delete docs/topics/create-first-xml-rule.adoc
emarcusRH 7fb28e4
adding analyze to mta-cli analysis commands
emarcusRH 6535f9a
updates to mta-cli analyze commands
emarcusRH 4d906b3
updates to mta-cli analyze commands
emarcusRH 5de1baf
Update docs/topics/cli-run.adoc
anarnold97 05dbded
Update docs/topics/cli-run.adoc
anarnold97 a4bf304
Update docs/topics/cli-run.adoc
anarnold97 d987cb4
Update docs/topics/cli-run.adoc
anarnold97 f4b2a2d
Update docs/topics/using-openrewrite-recipes.adoc
anarnold97 2f91734
Update docs/topics/cli-run.adoc
anarnold97 ec4ee18
Update docs/topics/cli-run.adoc
anarnold97 64a896b
Update docs/topics/cli-run.adoc
anarnold97 3e92390
Update cli-run.adoc
anarnold97 48bec4f
Fixing cli-run.adoc for windup
anarnold97 006655a
Fixing using-openrewrite-recipes.adoc
anarnold97 484c551
Update
anarnold97 129feca
Update
anarnold97 3c10b5f
Merge branch 'main' into cli_analyze
anarnold97 43761fc
Update docs/topics/mta-cli-run.adoc
anarnold97 43ae2dd
Update
anarnold97 9dc3561
Update docs/cli-guide/master.adoc
anarnold97 6f95b06
Update mta-cli-run.adoc
anarnold97 6d3c79d
Update mta-cli-run.adoc
anarnold97 44e278e
Update mta-cli-run.adoc
anarnold97 b545e31
Update docs/topics/cli-run.adoc
anarnold97 9cc31bc
Update mta-cli-run.adoc
anarnold97 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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,70 @@ | ||
| // Module included in the following assemblies: | ||
| // | ||
| // * docs/cli-guide/master.adoc | ||
|
|
||
| :_content-type: PROCEDURE | ||
| [id="cli-run_{context}"] | ||
| = Running the {CLINameTitle} | ||
|
|
||
| You can run {ProductShortName} against your application. | ||
|
|
||
| .Procedure | ||
|
|
||
| . Open a terminal and navigate to the `<{ProductShortName}_HOME>/` directory. | ||
|
|
||
| . Execute the `{mta-cli}` script, or `{mta-cli}.exe` for Windows, and specify the appropriate arguments: | ||
|
|
||
| + | ||
| [source,terminal,subs="attributes+"] | ||
| ---- | ||
| $ ./{mta-cli} analyze --input /path/to/jee-example-app-1.0.0.ear \ | ||
| --output /path/to/output --source weblogic --target eap6 \ | ||
| ---- | ||
| + | ||
| * `--input`: The application to be evaluated. | ||
| * `--output`: The output directory for the generated reports. | ||
| * `--source`: The source technology for the application migration. | ||
|
|
||
| . Access the report. | ||
|
|
||
| [id="command-examples_{context}"] | ||
| == {ProductShortName} command examples | ||
|
|
||
| [discrete] | ||
| === Running {ProductShortName} on an application archive | ||
|
|
||
| The following command analyzes 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: | ||
|
|
||
| [source,terminal,subs="attributes+"] | ||
| ---- | ||
| $ <{ProductShortName}_HOME>/{mta-cli} analyze \ | ||
| --input /path/to/jee-example-app-1.0.0.ear \ | ||
| --output /path/to/report-output/ --source eap5 --target eap7 \ | ||
| ---- | ||
| [] | ||
|
|
||
| [discrete] | ||
| === Running {ProductShortName} on source code | ||
|
|
||
| The following command analyzes 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. | ||
|
|
||
| [source,terminal,subs="attributes+"] | ||
| ---- | ||
|
|
||
| $ <{ProductShortName}_HOME>/{mta-cli} analyze --mode source-only --input /path/to/seam-booking-5.2/ \ | ||
| --output /path/to/report-output/ --target eap6 --packages org.jboss.seam | ||
| ---- | ||
| [] | ||
| [discrete] | ||
| === Running cloud-readiness rules | ||
|
|
||
| The following command analyzes 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: | ||
|
|
||
| [source,terminal,subs="attributes+"] | ||
| ---- | ||
| $ <{ProductShortName}_HOME>/{mta-cli} analyze --input /path/to/jee-example-app-1.0.0.ear \ | ||
| --output /path/to/report-output/ \ | ||
| --target eap7 | ||
| ---- | ||
| [] | ||
|
|
File renamed without changes.
This file contains hidden or 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,59 @@ | ||
| // Module included in the following module: | ||
| // | ||
| // * docs/cli-guide-mtr/master.adoc | ||
|
|
||
| [id=using-openrewrite-recipes_{context}] | ||
| = Using OpenRewrite recipes | ||
|
|
||
| [IMPORTANT] | ||
| ==== | ||
| 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. | ||
|
|
||
| See link:{KBArticleTechnologyPreview}[Technology Preview features support scope] on the Red Hat Customer Portal for information about the support scope for Technology Preview features. | ||
| ==== | ||
|
|
||
| You can refactor the source code of Java applications by using link:https://docs.openrewrite.org/[OpenRewrite] recipes with the {ProductShortName} CLI. | ||
|
|
||
| For example, the OpenRewrite recipe `org.jboss.windup.JavaxToJakarta` renames imported `javax` packages to their `jakarta` equivalents. | ||
|
|
||
| .Procedure | ||
|
|
||
| . Run `windup-cli`, specifying the recipe name, the path to the configuration file, and the application: | ||
| + | ||
| [source,terminal,subs="attributes+"] | ||
| ---- | ||
| $ ./windup-cli --openrewrite --input </path/to/source/project> \ | ||
| "-Drewrite.configLocation=<path/to/rewrite.yaml>" \ | ||
| "-DactiveRecipes=<recipe_name>" --goal dryRun | ||
| ---- | ||
|
|
||
| * `"-DactiveRecipes=<recipe name>"`: Specify the OpenRewrite recipe, for example, `org.jboss.windup.JavaxToJakarta`. | ||
|
|
||
| * `--input`: Specify the application to be refactored. The application must be the top of the source code project containing a Maven Project Object Model (POM) XML file, `pom.xml`. | ||
|
|
||
| * `-Drewrite.configLocation=<path/to/rewrite.yaml>` : The location of the `rewrite.yaml` configuration file to use. | ||
| The shipped `rewrite.yaml` configuration files are located in your | ||
| `<{ProductShortName}_HOME>/rules/openrewrite` subfolder, for example,`" -Drewrite.configLocation=<{ProductShortName}_HOME>/rules/openrewrite/jakarta/javax/imports/rewrite.yaml"`. | ||
|
|
||
| * `"-DactiveRecipes=<recipe name>"`: Specify the OpenRewrite recipe, for example, `org.jboss.windup.JavaxToJakarta`. | ||
| + | ||
| You can include more than one recipe by specifying each in the `activeRecipes` parameter. For example, to include the recipes `org.jboss.windup.JavaxInjectToJakartaInject` and `org.jboss.windup.JavaxEjbToJakartaEjb"`, enter the following for `"-DactiveRecipes=<recipe name>"`: | ||
| + | ||
| [source, terminal,subs="attributes+"] | ||
| ---- | ||
| "-DactiveRecipes=org.jboss.windup.JavaxInjectToJakartaInject, \ | ||
| org.jboss.windup.JavaxEjbToJakartaEjb" | ||
| ---- | ||
|
|
||
| * `--goal`: Optional: The OpenRewrite Maven goal to run. | ||
| ** `dryRun` : The script returns a list of proposed changes. Ignore the `"Run 'mvn rewrite:run' to apply the recipes"` message. | ||
| ** `run`: The script applies the changes. | ||
|
|
||
| . Run `windup-cli` with `--goal run` to apply the recipe: | ||
| + | ||
| [source,terminal,subs="attributes+"] | ||
| ---- | ||
| $ ./windup-cli --openrewrite --input </path/to/source/project> \ | ||
| "-Drewrite.configLocation=<path/to/rewrite.yaml>" \ | ||
| "-DactiveRecipes=<recipe_name>" --goal run | ||
| ---- | ||
|
anarnold97 marked this conversation as resolved.
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.