带你了解Java Maven的打包操作

80F9BB04-0D29-BA71-9114-FBE30DC2D9BF.png

F5B4EF38-FCC4-F27D-12D0-A3F34768A5F2.png

DD27D5BB-91DD-0336-C631-EFF6ABB75FC1.png

6F20BA52-0D68-A167-8F51-220B06255AA6.png

C44E060D-F09D-2E22-11E1-8CF1CAA9F3C6.png

BE7F4DF7-D5D5-FB95-55A7-9F9F1AB1D2B5.png

<profiles>
    <profile>
      <id>dev</id>
      <properties>
              <env>dev</env>
      </properties>
      <!--未指定环境时,默认打包dev环境-->
      <activation>
        <activeByDefault>true</activeByDefault>
      </activation>
    </profile>
    <profile>
      <id>test</id>
      <properties>
        <env>test</env>
      </properties>
    </profile>
    <profile>
      <id>product</id>
      <properties>
        <env>product</env>
      </properties>
    </profile>
  </profiles>

240673B7-2D58-62C7-F749-B0714C264CBA.png

<!--对于项目资源文件的配置放在build中-->
    <resources>
      <resource>
        <directory>src/main/resources/${env}</directory>
      </resource>
      <resource>
        <directory>src/main/java</directory>
        <includes>
          <include>**/*.xml</include>
          <include>**/*.properties</include>
          <include>**/*.tld</include>
        </includes>
        <filtering>false</filtering>
      </resource>
    </resources>

0BE46243-9406-1B86-7418-4A8C1E884F50.png

收藏 (0)
评论列表
正在载入评论列表...
我是有底线的
为您推荐
    暂时没有数据