AspectJ Maven Plugin cannot compile my project

前端 未结 5 1540
鱼传尺愫
鱼传尺愫 2021-02-18 18:53

I try to use aspectj maven plugin for compile project with aspectj compiler and then I try to package classes into \"war\" file. Unfortunately, it doesn\'t work with following c

5条回答
  •  旧时难觅i
    2021-02-18 19:20

    It will be work after change plugin configuration to following:

    
        org.codehaus.mojo
        aspectj-maven-plugin
        1.6
        
            1.7
            1.7
            1.7
            UTF-8
        
        
            
                process-sources
                
                    compile
                
                
                    1.7
                    1.7
                    1.7
                
            
        
    
    

    But after this I get a lot of different compilation errors:

    [ERROR] Failed to execute goal org.codehaus.mojo:aspectj-maven-plugin:1.6:compile (default) on project tvbs-portlet: Compiler errors:
    [ERROR] error at Entitle.class, entitleId, LockModeType.PESSIMISTIC_WRITE);
    [ERROR]
    [ERROR] /Users/<...>/ejb/BillingEJB.java:43:0::0 PESSIMISTIC_WRITE cannot be resolved or is not a field
    [ERROR] error at .createQuery("select e from Entitle e " +
    [ERROR]
    [ERROR] /Users/<...>/ejb/EntitleEJB.java:62:0::0 The method createQuery(String) in the type EntityManager is not applicable for the arguments (String, Class)
    [ERROR] error at return entityManager.createQuery(
    [ERROR] ^^
    

    Can cause is incorrect aspectj plugin parameters?

提交回复
热议问题