maven compilation failure

前端 未结 18 2212
不知归路
不知归路 2020-12-07 17:57

I have a weird problem - Some class file couldn\'t be read during maven build.

  1. I have a project A and project B.
  2. Project
18条回答
  •  鱼传尺愫
    2020-12-07 18:45

    The error is pretty clear: "cannot find symbol". Some dependencies can't be resolved (you even have the line and column in the trace of the reference that can't be resolved):

    V:/dhs_tss_build_view/dhs_tssproject/tss/tsscommon-server/src/main/java/us/mn/state/dhs/tss/common/oblix/da/wsdl/OblixLoginAc
    cess.java:[51,60] cannot find symbol
    symbol  : class BusinessException
    location: class us.mn.state.dhs.tss.common.oblix.da.wsdl.OblixLoginAccess
    
    V:/dhs_tss_build_view/dhs_tssproject/tss/tsscommon-server/src/main/java/us/mn/state/dhs/tss/common/app/da/ldap/BaseLdapImpl.j
    ava:[187,14] cannot find symbol
    symbol  : class Phone
    location: class us.mn.state.dhs.tss.common.app.da.ldap.BaseLdapImpl
    
    V:/dhs_tss_build_view/dhs_tssproject/tss/tsscommon-server/src/main/java/us/mn/state/dhs/tss/common/app/da/ldap/BaseLdapImpl.j
    ava:[204,14] cannot find symbol
    symbol  : class Phone
    location: class us.mn.state.dhs.tss.common.app.da.ldap.BaseLdapImpl
    

    Below a couple of things to verify:

    • Check or recheck that these classes are in the jar A (same version as in the pom)
    • Check or recheck the import statement in B sources (should match the package of classes in A)
    • Check or recheck B's pom.xml and especially the declaration of the dependency on A (it's version)
    • Check that the dependency on A is not excluded transitively somewhere in B's pom
    • Is A a SNAPSHOT dependency? If no, delete A from your local repository and rebuild

    Maven is working fine, you have a mistake somewhere.

提交回复
热议问题