简体   繁体   中英

Generating Windup report for a .java file (JBoss Migration)

I have gone through few demos on generating the JBoss Windup report. In every demo they have used EAR file. Is it possible to generate Windup report for .java file? I have already tried and I got the following error.

INFO  [ClassPathXmlApplicationContext] Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@80fc33b: startup date [Wed Dec 03 08:46:08 CET 2014]; root of context hierarchy
INFO  [CustomerPackageResolver] Found Package: com.acme
INFO  [ClassPathXmlApplicationContext] Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@81bc954: startup date [Wed Dec 03 08:46:12 CET 2014]; root of context hierarchy
INFO  [CustomerPackageResolver] Found Package: com.acme
INFO  [WindupReportEngine] Creating output path: /tmp/src/main/dk/tdc/ossj/inventory/client/StandaloneClient-java-doc
INFO  [WindupReportEngine]   - To overwrite this in the future, use the -output parameter.
INFO  [ZipInterrogationEngine] Processing: StandaloneClient.java
ERROR [ZipInterrogationEngine] Error unzipping file.
java.util.zip.ZipException: Could not find End Of Central Directory
        at java.util.zip.ZipFile.open(Native Method)
        at java.util.zip.ZipFile.<init>(ZipFile.java:118)
        at java.util.zip.ZipFile.<init>(ZipFile.java:154)
        at org.jboss.windup.interrogator.ZipInterrogationEngine.process(ZipInterrogationEngine.java:81)
        at org.jboss.windup.WindupMetaEngine.processArchive(WindupMetaEngine.java:297)
        at org.jboss.windup.WindupMetaEngine.getArchiveMeta(WindupMetaEngine.java:160)
        at org.jboss.windup.WindupReportEngine.generateReport(WindupReportEngine.java:121)
        at org.jboss.windup.WindupMain.processInput(WindupMain.java:144)
        at org.jboss.windup.WindupMain.main(WindupMain.java:71)
Exception in thread "Main Thread" java.lang.NullPointerException
        at org.jboss.windup.reporting.ReportEngine.process(ReportEngine.java:33)
        at org.jboss.windup.WindupReportEngine.generateReport(WindupReportEngine.java:128)
        at org.jboss.windup.WindupMain.processInput(WindupMain.java:144)
        at org.jboss.windup.WindupMain.main(WindupMain.java:71)

No, I don't think so. I believe the best thing to do is run windup for your ear/war file, then provide the package where your classes are locate like this:

windup --sourceMode \
  --input <path to your web project file .ear or .war>  \
  --output <path to place of your preference> \
  --source eap4 eap5 --target eap6 \
  --packages com.yourpackage.something com.another.package \

Windup output will give you a report easy to browse and find the information you need about your class. Lets say your class is a proprietary API part of commercial application server, then the report will tell you this part needs to refactor and how much effort is involve to do this.

You can find some guidelines here:

https://access.redhat.com/documentation/en/red-hat-jboss-migration-toolkit/version-2.4/windup-user-guide/

http://windup.github.io/windup/docs/latest/html/WindupRulesDevelopmentGuide.html

Hope that can be useful. :)

First, you're using Windup 0.6.x. The question was from 2014. It's 2016 and Windup has moved a lot.

Windup 2.x+ can analyze a source files project. That's because what it does with EAR is that it decompiles it first and then scans the .java files. So try:

windupDir/bin/windup --sourceMode --input path/to/your/app --target eap

To be honest, I haven't tried pointing it to a single .java file :) If that's something you need for a reason, create a http://issues.jboss.org/browse/WINDUP issue.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM