With maven - clean package, xml source files are not included in classpath

后端 未结 2 1804
轻奢々
轻奢々 2020-12-10 01:36

So it seems that Maven package is setup by default to compile but not copy xml files in the java classpath, unless they\'re already there. In Eclipse, I created the simplest

2条回答
  •  青春惊慌失措
    2020-12-10 01:54

    By default maven does not include any files from "src/main/java" (${sourceDirectory} variable). You have two possibilities (choose one of them):

    • put all your resource files (different than java files) to "src/main/resources" - recomended
    • Add to your pom (example from gwt plugin):

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

提交回复
热议问题