maven集成idea
程序员文章站
2022-04-26 09:38:33
...
第一步:
在main目录下创建两个文件java 和resource:把java编程源码目录,把resource变成资源目录
第二步:配置tomcat
第三步:
由于jdk1.8与idea自带的tomcat6不兼容,所以需要配置tomcat7,并且要是2.2版本的,在pom.xml中配置插件tomcat7:
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.2</version>
</plugin>
</plugins>
</pluginManagement>
</build>
第四步:
在build中配置resource,来防止资源导出失败问题
<resources>
<resource>
<targetPath>${basedir}/target/classes/</targetPath>
<directory>${basedir}/../../app.framecore/src/main/resources</directory>
<includes>
<include>**/*.sql</include>
<include>**/*.xml</include>
<include>**/*.properties</include>
</includes>
</resource>
<resource>
<targetPath>${basedir}/target/classes/</targetPath>
<directory>${basedir}/../app.pms.cust.api/src/main/resources</directory>
<includes>
<include>**/*.sql</include>
<include>**/*.xml</include>
<include>**/*.properties</include>
</includes>
</resource>
</resources>
上一篇: Idea常用知识--Maven
下一篇: ****实验Lab4