bonke
V2EX  ›  Java

Maven 编译偶现 bad class 问题

  •  
  •   bonke · Nov 24, 2020 · 2401 views
    This topic created in 2020 days ago, the information mentioned may be changed or developed.

    请教个问题。

    1. maven 编译一个多 module 项目
    2. module A 依赖 module B
    3. module B build 成功
    4. module A 编译的时候,出现
         [ERROR]:cannot access  XXXX.XXXX.XXX (module B 中的一个类)
         [exec]   bad class file:XXXX.XXXX.XXX
         [exec]     unable to access file: corrupted zip file
         [exec]     Please remove or make sure it appears in the correct subdirectory of the classpath.
         但是 module A 最终提示 
         [exec] [INFO] BUILD SUCCESS
    
    1. 解压编译后 module A 的 jar 文件,发现 module A 这个包里没有 class 文件
    2. 解压 module B 的 jar,用 jd-gui 反编译 XXXX.XXXX.XXX ,提示 // INTERNAL ERROR //,其他类都正常。 但是用 Luyten 反编译正常,没有问题。
    3. 重新编译项目,没问题。jd-gui,Luyten 都反编译成功
    4. 将两次编译的 XXXX.XXXX.XXX 的 class 文件通过 Luyten 反编译对比,没有差异。
    5. 通过 javap -verbose 对比两个 class 文件,size,MD5 checksum 也是一致的。
    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2849 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 33ms · UTC 02:47 · PVG 10:47 · LAX 19:47 · JFK 22:47
    ♥ Do have faith in what you're doing.