Tod*_*odd 3 java junit junit4 maven
我在我们的应用服务器上运行Junits,该服务器因不支持的major.minor版本51.0而失败.但是,Web应用程序然后构建,部署和运行正常.我不明白这是怎么发生的.我的maven编译器的配置如下所示:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<verbose>true</verbose>
<fork>true</fork>
<source>1.7</source>
<target>1.7</target>
<executable>${JAVA_1_7_HOME}/bin/javac</executable>
<encoding>ISO-8859-1</encoding>
<verbose>true</verbose>
</configuration>
</plugin>
Run Code Online (Sandbox Code Playgroud)
而我的Junit依赖:
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
<version>4.10</version>
</dependency>
Run Code Online (Sandbox Code Playgroud)
任何人都可以想到这是失败的原因吗?
在Maven的万无一失,插件是负责运行JUnit测试.尝试添加此配置.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.16</version>
<configuration>
<jvm>${JAVA_1_7_HOME}/bin/javac</jvm>
</configuration>
</plugin>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
6451 次 |
| 最近记录: |