maven编译设置
博客专区 > HGMrWang 的博客 > 博客详情
maven编译设置
HGMrWang 发表于2年前
maven编译设置
  • 发表于 2年前
  • 阅读 10
  • 收藏 0
  • 点赞 0
  • 评论 0

【腾讯云】买域名送云解析+SSL证书+建站!>>>   

摘要: maven idea

idea下设置maven项目的编译

<build>
  <finalName>项目名称</finalName>
      <sourceDirectory>src/main/java</sourceDirectory>
      <outputDirectory>src/main/webapp/WEB-INF/classes</outputDirectory>
  <plugins>
    <!--指定项目jdk编译版本和编码方式-->
    <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-compiler-plugin</artifactId>
      <version>3.1</version>
      <configuration>
        <source>1.7</source>
        <target>1.7</target>
        <encoding>UTF-8</encoding>

      </configuration>

    </plugin>
<!-- 把依赖的jar包拷到lib目录下 -->
<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-dependency-plugin</artifactId>
  <executions>
    <execution>
      <id>copy-dependencies</id>
      <phase>package</phase>
      <goals>
        <goal>copy-dependencies</goal>
      </goals>
      <configuration>
        <outputDirectory>src/main/webapp/WEB-INF/lib</outputDirectory>
        <overWriteReleases>false</overWriteReleases>
        <overWriteSnapshots>false</overWriteSnapshots>
        <overWriteIfNewer>true</overWriteIfNewer>
      </configuration>
    </execution>
  </executions>
</plugin>

<!-- 更改maven默认的打包目录 -->
<plugin>
  <artifactId>maven-war-plugin</artifactId>
  <configuration>
    <webappDirectory>/src/main/webapp</webappDirectory>
    <outputDirectory>src/main/webapp/WEB-INF/war</outputDirectory>
  </configuration>
</plugin>
</plugins>
</build>
标签: Maven
  • 点赞
  • 收藏
  • 分享
粉丝 4
博文 60
码字总数 37681