惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

B
Blog RSS Feed
有赞技术团队
有赞技术团队
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
阮一峰的网络日志
阮一峰的网络日志
V
V2EX
Y
Y Combinator Blog
Jina AI
Jina AI
G
Google Developers Blog
Last Week in AI
Last Week in AI
博客园 - 叶小钗
H
Hackread – Cybersecurity News, Data Breaches, AI and More
L
LangChain Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
V
Visual Studio Blog
aimingoo的专栏
aimingoo的专栏
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
J
Java Code Geeks
Stack Overflow Blog
Stack Overflow Blog
IT之家
IT之家
The GitHub Blog
The GitHub Blog
D
Docker
量子位
罗磊的独立博客
腾讯CDC

博客园 - 技术宅home

kali捕获wifi握手包 centos7安装mysql8 【继续教育】选准用好“三支一扶”人员,助力乡村振兴战略 【继续教育】深入学***在长三角一体化发展座谈会的重要讲话精神,推动长三角区域一体化和高质量发展 【继续教育】全球战“疫”斗争中的中国优势、 中国力量、中国担当、中国精神 【继续教育】民法典总则编解读 【继续教育】坚持创新在我国现代化建设全局中的核心地位,把科技自立自强作为国家发展的战略支撑 【继续教育】加快构建完整内需体系,形成国内国际双循环相互促进新格局 redis key过期提醒,实现订单自动取消 查看当前服务器中最占内存的程序 百度智能云之语音技术(自动播报语音) StringRedisTemplate获取redis信息 MySQL规范 微信测试公众号手动发送模板消息 spring-boot-starter-parent 与 spring-boot-dependencies Docker 容器知识点 Docker 常用命令 Docker 镜像知识点 Centos离线下载Aria2 AriaNG bt-tracker自动更新
maven多环境IDEA启动报Do not use @ for indentation错误解决...
技术宅home · 2019-10-16 · via 博客园 - 技术宅home

maven多环境配置如下:

<profiles>
        <profile>
            <!--开发环境-->
            <id>dev</id>
            <properties>
                <profileActive>dev</profileActive>
            </properties>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
        </profile>
        <profile>
            <!--测试环境-->
            <id>test</id>
            <properties>
                <profileActive>test</profileActive>
            </properties>
        </profile>
        <profile>
            <!--正式环境-->
            <id>prod</id>
            <properties>
                <profileActive>prod</profileActive>
            </properties>
        </profile>
</profiles>

application.yml使用如下:

spring:
  profiles:
    active: @profileActive@

报错如下:

Caused by: org.yaml.snakeyaml.scanner.ScannerException: while scanning for the next token
found character '@' that cannot start any token. (Do not use @ for indentation)
 in 'reader', line 19, column 13:
        active: @profileActive@

解决方案如下:

<!--build节点增加内容-->
<resources>
        <resource>
                <directory>src/main/resources</directory>
                <!--开启过滤,用指定的参数替换directory下的文件中的参数-->
                <filtering>true</filtering>
        </resource>
</resources>