Maven create jar file with both .class and .java files

后端 未结 2 1978
攒了一身酷
攒了一身酷 2020-12-10 12:07

I\'m looking for a way to create jar files containing both .class and .java files for GWT modules. Anyone knows how that could be achieved?

Superthanks!

// N

2条回答
  •  醉话见心
    2020-12-10 13:02

    Edit your resources section in your pom.xml.

    
      ...
      
        
          src/main/resources
        
        
          src/main/java
          
            **/*.java
            **/*.gwt.xml
          
        
      
      ...
    
    

    You can also edit the maven-jar-plugin to exclude them from the final JAR.

    
        maven-jar-plugin
        
          
          
            **/*.java
            **/*.gwt.xml
          
        
    
    

提交回复
热议问题