欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

maven集成idea

程序员文章站 2022-04-26 09:38:33
...

第一步:
在main目录下创建两个文件java 和resource:把java编程源码目录,把resource变成资源目录
maven集成idea
maven集成idea
第二步:配置tomcat
maven集成idea
maven集成idea
maven集成idea
maven集成idea
maven集成idea
第三步:
由于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>