<build> <!--指定配置文件的地址,里面的配置会作为参数替换其他配置文件的占位符--> <filters> <filter>https://www.cnblogs.com/yangyongjie/sync-deploy/config/${active.env}/config.properties</filter> <!-- 多个文件可配置多个filter --> </filters> <resources> <resource> <directory>${basedir}/src/main/resources</directory> <filtering>true</filtering> </resource> </resources> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> </plugin> </plugins> </build> <profiles> <profile> <id>dev</id> <properties> <active.env>dev</active.env> </properties> <activation> <activeByDefault>true</activeByDefault> </activation> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-resources-plugin</artifactId> <executions> <execution> <id>copy-resources</id> <phase>validate</phase> <goals> <goal>copy-resources</goal> </goals> <configuration> <outputDirectory>${basedir}/target/classes</outputDirectory> <!--资源过滤--> <resources> <resource> <directory>https://www.cnblogs.com/yangyongjie/sync-deploy/config/dev</directory> <filtering>true</filtering> <includes> <include>logback.xml</include> <include>redis.properties</include> <!-- 把需要的copy过来 --> </includes> </resource> </resources> </configuration> </execution> </executions> </plugin> </plugins> </build> </profile> <profile> <id>pre</id> <properties> <active.env>pre</active.env> </properties> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-resources-plugin</artifactId> <executions> <execution> <id>copy-resources</id> <phase>validate</phase> <goals> <goal>copy-resources<idea新建子模块/goal> </goals> <configuration> <!--复制到哪去--> <outputDirectory>${basedir}/target/classes</outputDirectory> <!--资源过滤--> <resources> <resource> <directory>https://www.cnblogs.com/yangyongjie/sync-deploy/config/pre</directory> <filtering>true</filtering> <!--复制哪些文件过来--> <includes> <include>logback.xml</include> <include>redis.properties</include> </includes> </resource> </resources> </configuration> </execution> </executions> </plugin> </plugins> </build> </profile> <profile> <id>prd</id> <properties> <active.env>prd</active.env> </properties> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-resources-plugin</artifactId> <executions> <execution> <id>copy-resources</id> <phase>validate</phase> <goals> <goal>copy-resources</goal> </goals> <configuration> <!--复制到哪去--> <outputDirectory>${basedir}/target/classes</outputDirectory> <!--资源过滤--> <resources> <resource> <directory>https://www.cnblogs.com/yangyongjie/sync-deploy/config/prd</directory> <filtering>true</filtering> <!--复制哪些文件过来--> <includes> <include>logback.xml</include> <include>redis.properties</include> </includes> </resource> </resources> </configuration> </execution> </executions> </plugin> </plugins> </build> </profile> </profiles>
今天的文章
idea新建子模块分享到此就结束了,感谢您的阅读。
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。
如需转载请保留出处:https://bianchenghao.cn/130841.html