<bdo id='lxpws'></bdo><ul id='lxpws'></ul>

<legend id='lxpws'><style id='lxpws'><dir id='lxpws'><q id='lxpws'></q></dir></style></legend>

      1. <small id='lxpws'></small><noframes id='lxpws'>

        <tfoot id='lxpws'></tfoot>
        <i id='lxpws'><tr id='lxpws'><dt id='lxpws'><q id='lxpws'><span id='lxpws'><b id='lxpws'><form id='lxpws'><ins id='lxpws'></ins><ul id='lxpws'></ul><sub id='lxpws'></sub></form><legend id='lxpws'></legend><bdo id='lxpws'><pre id='lxpws'><center id='lxpws'></center></pre></bdo></b><th id='lxpws'></th></span></q></dt></tr></i><div id='lxpws'><tfoot id='lxpws'></tfoot><dl id='lxpws'><fieldset id='lxpws'></fieldset></dl></div>
      2. Maven:在不同的源代码级别上编译和测试

        Maven: compiling and testing on different source levels(Maven:在不同的源代码级别上编译和测试)
        <i id='fLrku'><tr id='fLrku'><dt id='fLrku'><q id='fLrku'><span id='fLrku'><b id='fLrku'><form id='fLrku'><ins id='fLrku'></ins><ul id='fLrku'></ul><sub id='fLrku'></sub></form><legend id='fLrku'></legend><bdo id='fLrku'><pre id='fLrku'><center id='fLrku'></center></pre></bdo></b><th id='fLrku'></th></span></q></dt></tr></i><div id='fLrku'><tfoot id='fLrku'></tfoot><dl id='fLrku'><fieldset id='fLrku'></fieldset></dl></div>
          <tbody id='fLrku'></tbody>
        1. <tfoot id='fLrku'></tfoot>
          <legend id='fLrku'><style id='fLrku'><dir id='fLrku'><q id='fLrku'></q></dir></style></legend>
              <bdo id='fLrku'></bdo><ul id='fLrku'></ul>

              <small id='fLrku'></small><noframes id='fLrku'>

                  本文介绍了Maven:在不同的源代码级别上编译和测试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我目前正在开发一个将在嵌入式设备上运行的项目.该设备运行 Java ME JRE(相当于 Java 1.4).

                  I am currently working on a project which will run on an embedded device. The device runs a Java ME JRE (comparable to Java 1.4).

                  因为这个 maven 被配置为编译为 source &目标等级 1.4.

                  Because of this maven is configured to compile for source & target level 1.4.

                  是否可以在不同的源/目标级别上运行 Maven 测试阶段?因为这样我可以使用 Mockito 进行单元测试.

                  Is it possible to run the maven test phase on a different source/target level? Because this way I could use Mockito for unit-testing.

                  推荐答案

                  编译和testCompile maven 编译器插件 的目标.您可以通过在 pom 中定义属性来更改设置:

                  The source and target versions can be set separately for the compile and testCompile goals of the maven compiler plugin. You can change the settings either by defining properties in your pom:

                  <properties>
                      <maven.compiler.source>1.4</maven.compiler.source>
                      <maven.compiler.target>1.4</maven.compiler.target>
                      <maven.compiler.testSource>1.5</maven.compiler.testSource>
                      <maven.compiler.testTarget>1.5</maven.compiler.testTarget>
                  </properties>
                  

                  或者通过编译器插件的显式配置:

                  Or by explicit configuration of the compiler plugin:

                  <plugin>
                      <groupId>org.apache.maven.plugins</groupId>
                      <artifactId>maven-compiler-plugin</artifactId>
                      <version>2.4</version>
                      <configuration>
                          <source>1.4</source>
                          <target>1.4</target>
                          <testSource>1.5</testSource>
                          <testTarget>1.5</testTarget>
                      </configuration>
                  </plugin>
                  

                  这篇关于Maven:在不同的源代码级别上编译和测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  How can I detect integer overflow on 32 bits int?(如何检测 32 位 int 上的整数溢出?)
                  Local variables before return statements, does it matter?(return 语句之前的局部变量,这有关系吗?)
                  How to convert Integer to int?(如何将整数转换为整数?)
                  How do I create an int array with randomly shuffled numbers in a given range(如何在给定范围内创建一个随机打乱数字的 int 数组)
                  Inconsistent behavior on java#39;s ==(java的行为不一致==)
                  Why is Java able to store 0xff000000 as an int?(为什么 Java 能够将 0xff000000 存储为 int?)
                    <bdo id='8jqVA'></bdo><ul id='8jqVA'></ul>
                    <tfoot id='8jqVA'></tfoot>

                        <small id='8jqVA'></small><noframes id='8jqVA'>

                          <legend id='8jqVA'><style id='8jqVA'><dir id='8jqVA'><q id='8jqVA'></q></dir></style></legend>

                            <i id='8jqVA'><tr id='8jqVA'><dt id='8jqVA'><q id='8jqVA'><span id='8jqVA'><b id='8jqVA'><form id='8jqVA'><ins id='8jqVA'></ins><ul id='8jqVA'></ul><sub id='8jqVA'></sub></form><legend id='8jqVA'></legend><bdo id='8jqVA'><pre id='8jqVA'><center id='8jqVA'></center></pre></bdo></b><th id='8jqVA'></th></span></q></dt></tr></i><div id='8jqVA'><tfoot id='8jqVA'></tfoot><dl id='8jqVA'><fieldset id='8jqVA'></fieldset></dl></div>

                              <tbody id='8jqVA'></tbody>