gpt4 book ai didi

java - maven在 Spring 不显示颜色

转载 作者:行者123 更新时间:2023-11-30 10:06:36 25 4
gpt4 key购买 nike

我在执行测试时尝试显示颜色,但它不适用于 spring 2

我试过了

spring.output.ansi.enabled=always

还是一样的结果。

我试过这个网站:

Enable Color in Spring Boot Test Console Log

但只有“黑白”,颜色永远不会出现

我有 maven 3.5.2 和 spring/boot 2

单元测试结果: enter image description herespringboot 测试结果: enter image description here

最佳答案

您的 pom.xml 配置是什么。取决于您使用哪个组/工件来运行 mvn verify

我正在使用 org.codehaus.mojo 但我一直无法让它工作,我切换到 org.springframework.boot/spring-boot-maven-plugin 并且它对我有用.

试试这个配置再试一次:

<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<id>pre-integration-test</id>
<goals>
<goal>start</goal>
</goals>
</execution>
<execution>
<id>post-integration-test</id>
<goals>
<goal>stop</goal>
</goals>
</execution>
</executions>
</plugin>

编辑:此外,请确保您拥有:

            <plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>

关于java - maven在 Spring 不显示颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54584811/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com