1

我已经完成了一些关于生成 JBoss Windup 报告的演示。在每个演示中,他们都使用了 EAR 文件。是否可以为.java文件生成 Windup 报告?我已经尝试过,但出现以下错误。

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)
4

2 回答 2

2

不,我不这么认为。我相信最好的办法是为你的 ear/war 文件运行 windup,然后提供你的类所在的包,如下所示:

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 输出将为您提供易于浏览的报告,并找到您需要的有关班级的信息。假设您的类是商业应用服务器的专有 API 部分,那么报告会告诉您这部分需要重构以及为此付出了多少努力。

您可以在此处找到一些指南:

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

希望能有用。:)

于 2015-07-14T14:02:23.320 回答
1

首先,您使用的是 Windup 0.6.x。问题是从 2014 年开始的。现在是 2016 年,Windup 发生了很大变化。

Windup 2.x+可以分析源文件项目。那是因为它对 EAR 所做的是它首先对它进行反编译,然后再扫描.java文件。所以试试:

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

老实说,我没有尝试将其指向单个.java文件 :) 如果您出于某种原因需要这样做,请创建http://issues.jboss.org/browse/WINDUP问题。

于 2016-04-29T02:20:47.307 回答