maven指定多源碼路徑

實際場景中 有時會有在一個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>

效果
這樣就能夠指定多源碼路徑區分不同的類的不同意義

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章