Chapter 2. Get Started
2.1. Install Windup Copy linkLink copied to clipboard!
- Download the latest Windup ZIP distribution.
- Extract the ZIP file in to a directory of your choice.
2.2. Execute Windup Copy linkLink copied to clipboard!
2.2.1. Overview Copy linkLink copied to clipboard!
These instructions use the replaceable variable WINDUP_HOME to refer to the fully qualified path to your Windup installation. For more information, see About the WINDUP_HOME Variable.
2.2.2. Run Windup Copy linkLink copied to clipboard!
- Open a terminal and navigate to the WINDUP_HOME directory.
Run Windup against the application using the appropriate command.
See Windup Command Line Arguments below for a detailed description of the available command line arguments.
The basic command to run Windup uses the following syntax.
For Linux: $ bin/windup --input INPUT_ARCHIVE_OR_FOLDER --output OUTPUT_REPORT_DIRECTORY --source SOURCE_TECHNOLOGY --target TARGET_TECHNOLOGY --packages PACKAGE_1 PACKAGE_2 PACKAGE_N For Windows: > bin\windup.bat --input INPUT_ARCHIVE_OR_FOLDER --output OUTPUT_REPORT_DIRECTORY --source SOURCE_TECHNOLOGY --target TARGET_TECHNOLOGY --packages PACKAGE_1 PACKAGE_2 PACKAGE_N
For Linux: $ bin/windup --input INPUT_ARCHIVE_OR_FOLDER --output OUTPUT_REPORT_DIRECTORY --source SOURCE_TECHNOLOGY --target TARGET_TECHNOLOGY --packages PACKAGE_1 PACKAGE_2 PACKAGE_N For Windows: > bin\windup.bat --input INPUT_ARCHIVE_OR_FOLDER --output OUTPUT_REPORT_DIRECTORY --source SOURCE_TECHNOLOGY --target TARGET_TECHNOLOGY --packages PACKAGE_1 PACKAGE_2 PACKAGE_NCopy to Clipboard Copied! Toggle word wrap Toggle overflow To evaluate an application archive, use the following syntax:
bin/windup --input INPUT_ARCHIVE_OR_FOLDER --output OUTPUT_REPORT_DIRECTORY --source SOURCE_TECHNOLOGY --target TARGET_TECHNOLOGY --packages PACKAGE_1 PACKAGE_2 PACKAGE_N --target eap
bin/windup --input INPUT_ARCHIVE_OR_FOLDER --output OUTPUT_REPORT_DIRECTORY --source SOURCE_TECHNOLOGY --target TARGET_TECHNOLOGY --packages PACKAGE_1 PACKAGE_2 PACKAGE_N --target eapCopy to Clipboard Copied! Toggle word wrap Toggle overflow To run Windup against application source code, add the
--sourceModeargument:bin/windup --sourceMode --input INPUT_ARCHIVE_OR_FOLDER --output OUTPUT_REPORT_DIRECTORY --source SOURCE_TECHNOLOGY --target TARGET_TECHNOLOGY --packages PACKAGE_1 PACKAGE_2 PACKAGE_N
bin/windup --sourceMode --input INPUT_ARCHIVE_OR_FOLDER --output OUTPUT_REPORT_DIRECTORY --source SOURCE_TECHNOLOGY --target TARGET_TECHNOLOGY --packages PACKAGE_1 PACKAGE_2 PACKAGE_NCopy to Clipboard Copied! Toggle word wrap Toggle overflow To override the default Fernflower decompiler, pass the
-Dwindup.decompilerargument on the command line. For example, to use the Procyon compiler, use the following syntax:bin/windup -Dwindup.decompiler=procyon --input INPUT_ARCHIVE_OR_FOLDER --output OUTPUT_REPORT_DIRECTORY --source SOURCE_TECHNOLOGY --target TARGET_TECHNOLOGY --packages PACKAGE_1 PACKAGE_2 PACKAGE_N
bin/windup -Dwindup.decompiler=procyon --input INPUT_ARCHIVE_OR_FOLDER --output OUTPUT_REPORT_DIRECTORY --source SOURCE_TECHNOLOGY --target TARGET_TECHNOLOGY --packages PACKAGE_1 PACKAGE_2 PACKAGE_NCopy to Clipboard Copied! Toggle word wrap Toggle overflow
See Windup Command Examples below for concrete examples of commands that use source code directories and archives located in the Windup GitHub repository.
You should see the following result upon completion of the command:
**SUCCESS*** Windup report created: PATH_TO_REPORTS/index.html Access it at this URL: file:///home/username/PATH_TO_REPORTS/index.html**SUCCESS*** Windup report created: PATH_TO_REPORTS/index.html Access it at this URL: file:///home/username/PATH_TO_REPORTS/index.htmlCopy to Clipboard Copied! Toggle word wrap Toggle overflow WarningDepending on the size of the application and the hardware Windup is running on, this command can take a very long time. For tips on how to improve performance, see Optimize Windup Performance.
Open the
OUTPUT_REPORT_DIRECTORY/index.htmlfile in a browser to access the report. The following subdirectories in theOUTPUT_REPORT_DIRECTORYcontain the supporting information for the report:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - For details on how to evaluate the report data, see Review the Report.
2.2.3. Windup Help Copy linkLink copied to clipboard!
To see the complete list of available arguments for the windup command, open a terminal, navigate to the WINDUP_HOME directory, and execute the following command:
bin/windup --help
bin/windup --help
2.2.4. Windup Command Line Arguments Copy linkLink copied to clipboard!
The following is a detailed description of the available Windup command line arguments.
- --input INPUT_ARCHIVE_OR_FOLDER
- This is the fully qualified path of the application archive or folder you plan to migrate. This argument is required.
- --output OUTPUT_REPORT_DIRECTORY (optional)
This is the fully qualified path to the folder that will contain the the report information produced by Windup.
- If omitted, the report will be generated in a INPUT_ARCHIVE_OR_FOLDER.report folder.
If the output directory exists, you will be prompted with the following (with a default of N).
Overwrite all contents of "/home/username/OUTPUT_REPORT_DIRECTORY" (anything already in the directory will be deleted)? [y,N]
Overwrite all contents of "/home/username/OUTPUT_REPORT_DIRECTORY" (anything already in the directory will be deleted)? [y,N]Copy to Clipboard Copied! Toggle word wrap Toggle overflow However, if you specify the
--overwriteargument, Windup will proceed to delete and recreate the folder.WarningBe careful not to specify a report output directory that contains important information!
- --sourceMode (optional)
- If specified, indicates the application to be evaluated contains source files rather than compiled binaries.
- --source SOURCE_1 SOURCE_2 (optional)
A space delimited list of one or more source technologies, servers, platforms, or frameworks to migrate from.
TipFor the list of the available
--sourceservers or frameworks, use the--listSourceTechnologiesargument on thewindupcommand line as in the following example.bin/windup --listSourceTechnologies
bin/windup --listSourceTechnologiesCopy to Clipboard Copied! Toggle word wrap Toggle overflow - --target TARGET_1 TARGET_2 (optional)
A space delimited list of one or more target technologies, servers, platforms, or frameworks to migrate to. If you do not specify this option, you are prompted to select a target. The default target technology is
eap.TipFor the list of the available
--targetservers or frameworks, use the--listTargetTechnologiesargument on thewindupcommand line as in the following example.bin/windup --listTargetTechnologies
bin/windup --listTargetTechnologiesCopy to Clipboard Copied! Toggle word wrap Toggle overflow - --packages PACKAGE_1 PACKAGE_2 PACKAGE_N (optional)
A space delimited list of the packages to be evaluated by Windup.
-
In most cases, you are interested only in evaluating custom application class packages and not standard Java EE or 3rd party packages. For example, if the MyCustomApp application uses the package
com.mycustomapp, you provide that package using the--packagesargument on the command line. -
It is not necessary to provide the standard Java EE packages, like
java.utilorjavax.ejb. While you can provide package names for standard Java EE 3rd party software like
org.apache, it is usually best not to include them as they should not impact the migration effort.WarningIf you omit the
--packagesargument, every package in the application is scanned, which can impact performance. It is best to provide this argument with one or more packages.
-
In most cases, you are interested only in evaluating custom application class packages and not standard Java EE or 3rd party packages. For example, if the MyCustomApp application uses the package
- --overwrite (optional)
-
Specify this argument only if you are certain you want to force Windup to delete the existing OUTPUT_REPORT_DIRECTORY folder. If you do not specify this argument and the
--outputfolder exists, you are prompted to choose whether to overwrite the contents. - --includeTags TAG_1 TAG_2 (optional)
Limit processing to rules that contain the specified tags. If this option is not specified, all tags are processed. Multiple tags are delimited by spaces.
TipFor the list of the available tags, use the
--listTagsargument on thewindupcommand line as in the following example.bin/windup --listTag
bin/windup --listTagCopy to Clipboard Copied! Toggle word wrap Toggle overflow - --excludeTags TAG_1 TAG_2 (optional)
- Do not process rules that contain the specified tags. If this option is not specified, all tags are processed.
- --userRulesDirectory CUSTOM_RULES_DIRECTORY (optional)
-
By default, Windup looks for rules in the
${user.home}/.windup/rules/directory. This option allows you to provide the fully qualified path to a user directory containing additional custom XML rules that should be loaded and executed by Windup. The XML ruleset files must use one of the following extensions:*.windup.groovyor*.windup.xml. - --userIgnorePath CUSTOM_IGNORE_DIRECTORY (optional)
-
Windup looks for file names matching the pattern
*windup-ignore.txtto identify files that should be ignored. By default, it looks for these files in the~/.windup/ignore/andWINDUP_HOME/ignore/directories, but this option allows you to create files with this pattern name in a different directory. - --exportCSV (optional)
-
Export the report data to a CSV formatted file on your local file system. Windup creates the file in the folder specified by the
--outputargument. The CSV file can be imported into your favorite spreadsheet program for data manipulation and analysis. For details, see Export the Report for Use by Spreadsheet Programs. - --additionalClassPath JAR_OR_DIRECTORY_1 JAR_OR_DIRECTORY_2 (optional)
Use this option to add additional JAR files or directories to the classpath. For example:
--additionalClassPath MyClasses.jar com/mycompany/
--additionalClassPath MyClasses.jar com/mycompany/Copy to Clipboard Copied! Toggle word wrap Toggle overflow - --excludePackages PACKAGE_1 PACKAGE_2 PACKAGE_N (optional)
- This is a space-delimited list of the packages to be excluded by Windup.
- --offline (optional)
- If specified, do all processing offline and do not fetch information from the internet.
- --updateRulesets (optional)
Update the core rulesets distributed with Windup. It first checks for the existence of newer release, and if found, replaces the current rulesets directory with the new one.
TipTo update the rulesets without analyzing an application, pass only this argument on the
windupcommand line as in the following example.bin/windup --updateRulesets
bin/windup --updateRulesetsCopy to Clipboard Copied! Toggle word wrap Toggle overflow - --batchMode (optional)
- Specifies that Windup should be run in a non-interactive mode without prompting for confirmation. This mode takes the default values for any parameters not passed in via the command line.
2.2.5. Windup Command Examples Copy linkLink copied to clipboard!
The following examples report against applications located in the Windup source test-files directory.
2.2.5.1. Source Code Example Copy linkLink copied to clipboard!
The following command runs against the seam-booking-5.2 application source code. It evaluates all org.jboss.seam packages and creates a folder named 'seam-booking-report' in the /home/username/windup-reports/ directory to contain the reporting output.
bin/windup --sourceMode --input /home/username/windup-source/test-files/seam-booking-5.2/ --output /home/username/windup-reports/seam-booking-report --target eap --packages org.jboss.seam
bin/windup --sourceMode --input /home/username/windup-source/test-files/seam-booking-5.2/ --output /home/username/windup-reports/seam-booking-report --target eap --packages org.jboss.seam
2.2.5.2. Archive Example Copy linkLink copied to clipboard!
The following command runs against the jee-example-app-1.0.0.ear EAR archive. It evaluates all com.acme and org.apache packages and creates a folder named 'jee-example-app-1.0.0.ear-report' in the /home/username/windup-reports/ directory to contain the reporting output.
bin/windup --input /home/username/windup-source/test-files/jee-example-app-1.0.0.ear/ --output /home/username/windup-reports/jee-example-app-1.0.0.ear-report --target eap --packages com.acme org.apache
bin/windup --input /home/username/windup-source/test-files/jee-example-app-1.0.0.ear/ --output /home/username/windup-reports/jee-example-app-1.0.0.ear-report --target eap --packages com.acme org.apache
2.2.5.3. Windup Quickstart Examples Copy linkLink copied to clipboard!
For more concrete examples, see the Windup quickstarts located on GitHub here: https://github.com/windup/windup-quickstarts. If you prefer, you can download the latest release ZIP or TAR distribution of the quickstarts.
The quickstarts provide examples of Java-based and XML-based rules you can run and test using Windup. The README instructions provide a step-by-step guide to run the quickstart example. You can also look through the code examples and use them as a starting point for creating your own rules.
2.3. Review the Report Copy linkLink copied to clipboard!
2.3.1. About the Report Copy linkLink copied to clipboard!
When you execute Windup, the report is generated in the OUTPUT_REPORT_DIRECTORY you specify for the --output argument in the command line. This output directory contains the following files and subdirectories:
The report examples shown are a result of analyzing com.acme and org.apache packages in the test-files/jee-example-app-1.0.0.ear application, which is located in the Windup core source repository. The report was generated using the using the following command.
WINDUP_HOME/bin/windup --input /home/username/windup-source/test-files/jee-example-app-1.0.0.ear/ --output /home/username/windup-reports/jee-example-app-1.0.0.ear-report --target eap --packages com.acme org.apache
WINDUP_HOME/bin/windup --input /home/username/windup-source/test-files/jee-example-app-1.0.0.ear/ --output /home/username/windup-reports/jee-example-app-1.0.0.ear-report --target eap --packages com.acme org.apache
2.3.2. Access the Reports Copy linkLink copied to clipboard!
Use your favorite browser to open the index.html file located in the output report directory. You should see something like the following:
Windup Report: Index Page
This page lists the application that was processed along with the technologies that were encountered. It also provides links to the following additional reports.
| Report | How to Access the Report |
|---|---|
|
Click on the link under the | |
|
Click on the | |
|
Click on the | |
|
Click on the |
2.3.2.1. Application Report Copy linkLink copied to clipboard!
2.3.2.1.1. Overview and Application Messages Copy linkLink copied to clipboard!
The first section of the application report page summarizes the entire application migration effort by technology type both graphically and in list format. This is followed by the Application Messages section, which contains useful information about general migration requirements for the application, such as the need to replace deprecated libraries or the need to resolve potential class loading issues.
In the following example, the "JEE Example App" is assigned 73 story points related to 10 different technologies. It also displays one application message "Deploying log4j.jar can result in non-deterministic ClassLoading issues. It is recommended to use the built-in JBoss EAP Log4j module configured via `jboss-deployment-structure.xml`" with a link to the rule that triggered it.
The estimated Story Points change as new rules are added to Windup. The values here may not match what you see when you test this application.
Windup Report: Overview and Application Messages
2.3.2.1.2. Archive Analysis Sections Copy linkLink copied to clipboard!
Depending on whether you run Windup against source or compiled code, the report next provides details by file, or by file within each archive. Each archive summary begins with a total of the story points assigned to its migration, followed by a table detailing the changes required for each file in the archive. The report contains the following columns.
| Column Name | Description |
|---|---|
| Name | The name of the file being analyzed. |
| Technology | The type of file being analyzed, for example: Java Source, Decompiled Java File, Manifest, Properties, EJB XML, Spring XML, Web XML, Hibernate Cfg, Hibernate Mapping |
| Issues | Warnings about areas of code that need review or changes. |
| Estimated Story Points | Level of effort required to migrate the file. Story Points are covered in more detail in the Windup Rules Development Guide. |
The following is an example of the archive analysis summary section of a Windup Report. The following is an the analysis of the WINDUP_SOURCE/test-files/jee-example-app-1.0.0.ear/jee-example-services.jar.
Windup Report: Archive Detail
2.3.2.1.3. File Analysis Pages Copy linkLink copied to clipboard!
The analysis of the jee-example-services.jar lists the files in the JAR and the warnings and story points assigned to each one. Notice the com.acme.anvil.listener.AnvilWebLifecycleListener file, at the time of this test, has 20 warnings and is assigned 10 story points. Click on the file to see the detail.
- The Information section provides a summary of the story points and notes that the file was decompiled by Windup.
- This is followed by the file source code listing. Warnings appear in the file at the point where migration is required.
In this example, warnings appear at various import statements, declarations, and method calls. Each warning describes the issue and the action that should be taken.
Windup Report: Source Report - Part 1
Later in the source code, warnings appear for the creation of the InitialContext and for JNDI lookup names.
Windup Report: Source Report - Part 2
2.3.2.2. Rule Provider Execution Report Copy linkLink copied to clipboard!
As stated above,access this report by clicking on the All Rules link at the bottom of the index page. This report provides the list of rule providers that executed when running the Windup migration command against the application. The report contains the following columns.
| Column Name | Description |
|---|---|
| Rule-ID | The Rule ID |
| Rule | The Java code for the rule |
| Statistics | Statistics behind the graph |
| Status? | Whether the rule executed or not |
| Result? | Whether the execution was successful or not |
| Failure Cause | The reason for an execution failure |
Windup Report: Rule Provider Report
2.3.2.3. Windup FreeMarker Functions and Directives Report Copy linkLink copied to clipboard!
Access this report by clicking on the Windup FreeMarker Methods link on the initial index page. This report lists all the registered functions and directives that were used to build the report. It is useful if you plan to build your own custom report or for debugging purposes.
Windup Report: FreeMarker Functions and Directives
2.3.2.4. Send Feedback Form Copy linkLink copied to clipboard!
Access the feedback form by clicking on the Send Feedback link on the initial index page. The form allows you to rate the product, talk about what you like and what needs to be improved. You can also attach a file.
Send Feedback Form
2.4. Export the Report for Use by Spreadsheet Programs Copy linkLink copied to clipboard!
Windup provides the ability to export the report data, including the Classifications and Hints, to a flat file on your local file system. The export function currently supports the CSV file format, which presents the report data as fields delimited by a comma (,) separator.
Windup follows the Common Format and MIME Type for Comma-Separated Values (CSV) Files standard for escaping special characters contained within each field in the file. The exported file has the following characteristics.
- The file is named with the `.csv' file extension.
The first row is a header listing the names of the fields.
"Rule Id","Problem type","Title","Description","Links","Application","File Name","File Path","Line","Story points"
"Rule Id","Problem type","Title","Description","Links","Application","File Name","File Path","Line","Story points"Copy to Clipboard Copied! Toggle word wrap Toggle overflow Each field is enclosed in double quotes (").
"FindUnboundJavaReferencesRuleProvider","hint","Unresolved Class Binding","","","JEE Example EJB Services (org.windup.example:jee-example-services:1.0.0)","ProductCatalogLocalHome.java","/home/username/windup-reports/jee-example-app-1.0.0.ear-report/archives/jee-example-services.jar/com/acme/anvil/service/ProductCatalogLocalHome.java","9","5"
"FindUnboundJavaReferencesRuleProvider","hint","Unresolved Class Binding","","","JEE Example EJB Services (org.windup.example:jee-example-services:1.0.0)","ProductCatalogLocalHome.java","/home/username/windup-reports/jee-example-app-1.0.0.ear-report/archives/jee-example-services.jar/com/acme/anvil/service/ProductCatalogLocalHome.java","9","5"Copy to Clipboard Copied! Toggle word wrap Toggle overflow Any double quote (") appearing within a field is preceded with another double quote.
"MyWindupRule","hint",""Replace the ""foo"" class","Replace the ""foo"" class instances with ""bar""",,"MyApp","MyApp.java","home/username/MyApp","200","8"
"MyWindupRule","hint",""Replace the ""foo"" class","Replace the ""foo"" class instances with ""bar""",,"MyApp","MyApp.java","home/username/MyApp","200","8"Copy to Clipboard Copied! Toggle word wrap Toggle overflow
The CSV formatted file can be imported and manipulated by spreadsheet software such as Microsoft Excel and OpenOffice or LibreOffice Calc. Spreadsheet software provide the ability to sort, analyze, evaluate, and manage the result data from a Windup report.
2.4.1. Enable the Export Functionality Copy linkLink copied to clipboard!
To enable export of the report into CSV file, run Windup with --exportCSV argument. The CSV file will be created in the directory specified by the --output argument.
2.4.2. Import the CSV File into a Spreadsheet Copy linkLink copied to clipboard!
- Start the spreadsheet software (LibreOffice Calc, OpenOffice Calc, Microsoft Excel, etc.).
-
Choose
File-→ `Open'. - Navigate to the CSV exported file and select it.
- The data is now ready to analyze in the spreadsheet software.
For more information or to resolve any issues, check the help for your spreadsheet software.
2.4.3. Overview of the CSV data structure Copy linkLink copied to clipboard!
The CSV formatted output file contains the following data fields:
- Rule Id
- The ID of the rule that generated the given item.
- Problem type
- "Hint" or "Classification"
- Title
- The title of the Classification or Hint. This field summarizes the issue for the given item.
- Description
- The detailed description of the issue for the given item.
- Links
- URLs that provide additional information about the issue. A link consists of two attributes: the link and a description of the link.
- Application
- The name of the application for which this item was generated.
- File Name
- The name of the file for the given item.
- File Path
- The file path of the file for the given item.
- Line
- The line number of the file for the given item.
- Story points
- The number of story points, which represent the level of effort, assigned to the given item.