實際場景中 有時會有在一個src下區分多個不同源碼包的情況 ,maven 中的一個插件提供了這個功能
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<executions>
<execution>
<id>add-source</id>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>src/main/staticclass</source>
<source>src/main/bussiness</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
這樣就能夠指定多源碼路徑區分不同的類的不同意義