Unable to use Intellij with a generated sources folder

后端 未结 11 1857
孤城傲影
孤城傲影 2020-12-01 01:00

Related question How to configure IntelliJ IDEA and/or Maven to automatically add directories with Java source code generated using jaxb2-maven-plugin?

I have a cust

11条回答
  •  时光取名叫无心
    2020-12-01 01:46

    Whoever wrote that plugin screwed up big time. That's not the way to do it!

    Any workaround would be a huge hack, make the plugin developer aware of his bug.

    Sorry, that's the only thing to do.


    OK here's a hack, directly after your plugin's execution, use the antrun plugin to move the directory somewhere else:

    
        maven-antrun-plugin
        1.6
        
          
            process-sources
            
              
                
                    
                
              
            
            
              run
            
          
        
    
    

    In this example, toolname should be replaced by anything that uniquely identifies the plugin that created the code and com stands for the root of the created packages. If you have multiple package roots, you probably need multiple tasks.

    But if the plugin adds the folder as source folder, then you're screwed.

提交回复
热议问题