最近在弄一个maven多模块项目,之前没有弄过,有空就学习并且记一下。
创建流程也是比较简单:
第一步
这里选中pom确定即可
然后创建子模块
再下一步完成即可
然后在主项目pom添加设置Java编译的参数
<build>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
</build>在子模块pom文件添加导入eclipse生成eclipse项目
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-eclipse-plugin</artifactId>
<configuration>
<wtpmanifest>true</wtpmanifest>
<wtpapplicationxml>true</wtpapplicationxml>
<wtpversion>2.0</wtpversion>
</configuration>
</plugin>
</plugins>
</build>
这样即可,网上也有很多例子,但是很多都是需要导入后再自行配置,比较麻烦,所以就自己记一下,忘记了容易找。