1. src/main/java 之外的java 代碼也不要打進去需要怎麼配置:
idea 中 file-->settings-->project structure-->project settings-->modules,右鍵 src/main下面的存放有java代碼的文件夾,勾選sources ,這種方式只是爲了idea語法上不報錯,但是執行 mvn install還是會報找不到 類的錯誤(其實下面配置好了,這這裏不配置也是可以install成功的)
!-- 指定多個源代碼目錄、多個資源文件目錄 -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.8</version>
<executions>
<execution>
<id>add-source</id>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>src/main/xxx</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>