简体   繁体   English

Java 8的循环依赖性分析 - 用于自动构建

[英]Cyclic dependency analysis for Java 8 - for use in an automated build

I'll working on a project that is using JDepend to automatically generate a report of cyclic package dependencies as part of our CI build. 我将开发一个项目,该项目使用JDepend自动生成循环包依赖关系的报告,作为CI构建的一部分。 (I am mainly interested in package level dependencies, so I've been using a cut down version of the XSLT to get a more focused report - otherwise, though, it is vanilla JDepend.) (我主要对包级依赖性感兴趣,所以我一直在使用XSLT的缩减版本来获得更有针对性的报告 - 否则,它是vanilla JDepend。)

However we are about to move the project to Java 8 and I have found that JDepend does not work against code compiled with the JDK 1.8 compiler. 但是我们即将把项目移到Java 8,我发现JDepend对使用JDK 1.8编译器编译的代码不起作用。 JDepend no longer seems to be being actively updated. JDepend似乎不再正在积极更新。

I'm trying to find a replacement that: 我正试图找到一个替代品:

  • Works with JDK 1.8 compiled class and/or jars. 适用于JDK 1.8编译的类和/或jar。
  • Reports cyclic dependencies at the package and/or jar level. 报告包和/或jar级别的循环依赖性。
  • Can be automated from Ant (command line executable would do). 可以从Ant自动化(命令行可执行文件可以)。
  • Produces a report that can be linked from a project home page and opened in a browser (eg HTML or plain text output - not a desktop app). 生成可以从项目主页链接并在浏览器中打开的报告(例如HTML或纯文本输出 - 而不是桌面应用程序)。
  • Also (preferably) produces - or can be configured/tweaked to produce - a focused report of just the cyclic dependencies (as JDepend can, if you modify the XSLT). 此外(最好)生成 - 或者可以配置/调整生成 - 只关注循环依赖的重点报告(如果你修改XSLT,可以像JDepend一样)。

Java 8 includes jdeps.exe in the /bin . Java 8包含/bin jdeps.exe Although this doesn't explicitly call out cyclic dependencies it does show all dependencies for a project's packages. 虽然这没有明确地调用循环依赖关系,但它确实显示了项目包的所有依赖关系。 It's good enough. 这够好了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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