How to ignore the Java Source directory during Maven Compilation?

前端 未结 5 2017
傲寒
傲寒 2020-12-13 19:59

I am trying to use the Lombok Maven Plugin to ensure the correct creation of Javadocs when using Lombok.

Lombok Maven introduces a new code generation goal, just pri

5条回答
  •  情书的邮戳
    2020-12-13 20:41

    I recently switched from using the flakey maven-exec-plugin approach to generate raw sources for the javadoc tool to using lombok-maven-plugin

    My setup

    • All sources in src/main/java
    • Generated sources go in target/generated-sources/delombok

    I initially ran into this problem but it seems to be an easy fix: Don't let lombok-maven-plugin add the delombok path to the compiler source paths with addOutputDirectoy. IE

    
        org.projectlombok
        lombok-maven-plugin
        0.11.2.0
        
            
                generate-sources
                
                    delombok
                
            
        
        
            false
            src/main/java
        
    
    

    This seems to of solved the issue for now

    EDIT: Bonus, how to generate proper javadocs with this setup

    
        org.apache.maven.plugins
        maven-javadoc-plugin
        2.8.1
        
            ${project.version}
            target/generated-sources/delombok
        
    
    

提交回复
热议问题