小编Jon*_*age的帖子

IntelliJ:运行Junit测试时激活Maven配置文件

我已经声明了一些特定于Maven配置文件的属性.我的pom.xml的一部分:

<profiles>
            <profile>
                <id>release</id>
                <activation>
                    <activeByDefault>true</activeByDefault>
                </activation>
                <properties>
                    <my.properties.file>foo.xml</my.properties.file>
                </properties>
            </profile>
            <profile>
              <id>ci</id>
              <properties>
                <my.properties.file>bar.xml</my.properties.file>
              </properties>
        </profile>
</profiles>
Run Code Online (Sandbox Code Playgroud)

当我通过IntelliJ IDEA 2016启动Junit测试时,我遇到一些使用"ci"Maven配置文件的问题.
我通过"Maven Projects"面板激活我的配置文件,然后我开始测试.问题是"my.properties.file"属性值等于"foo.xml",而不是"bar.xml".

我没有命令行的问题(我可以使用"-Pci"标志).如何告诉IntelliJ使用"ci"配置文件?谢谢.

java junit intellij-idea maven

14
推荐指数
1
解决办法
4293
查看次数

如何让IntelliJ使用包裹的maven(mvnw或mvnw.cmd)?

我刚刚将Maven(https://github.com/takari/maven-wrapper)添加到我的Maven项目中,我想知道是否有办法配置IntelliJ IDEA(在项目级别)以使用包装的Maven(./mvnw)代替看着Maven Home.

intellij-idea wrapper maven

11
推荐指数
1
解决办法
3136
查看次数

String.toUpperCase可能会删除重音符号

我必须申请toUpperCase一个可能包含重音符号的名称("é","à"等).
问题:

  • 使用JUnit,"é".toUpperCase转换为"E",重音被删除
  • 在我的应用程序(Spring REST API)中,"é".toUpperCase转换为"É".输入来自Ember前端,但编码是相同的(UTF-8)

JUnit测试和Spring应用程序使用相同的字符集(UTF-8),语言环境是法语.两者都运行在同一台机器上的Oracle Java 8上(Debian上的Jenkins CI,但我可以在我的计算机上重现这种行为:Windows 7).
我试图指定语言环境toUpperCase(Locale.FRANCE),但它并没有解决我的问题.

您是否意识到可以解释这种差异的事情?

java

10
推荐指数
1
解决办法
674
查看次数

标签 统计

intellij-idea ×2

java ×2

maven ×2

junit ×1

wrapper ×1