【发布时间】:2015-08-21 19:21:52
【问题描述】:
我是第一次使用 IntelliJ IDEA Community Edition,使用 Maven 搭建 TDD 环境。下面提供了我正在尝试测试的代码以及我遇到的警告消息以及项目结构。
项目结构:
代码:
package miscellaneous;
import org.junit.Test;
import static org.junit.Assert.*;
public class TestHello {
// Methods to be tested.....
private int Add1Plus1(int i, int j) {
return (i + j);
}
@Test
public void testAdd1Plus1() throws Exception {
assertEquals(2, Add1Plus1(1, 1));
}
}
配置详情:
- Java 编译器: 1.8.0_45
- Maven 版本: 3.0.5
- Maven 用户设置文件的路径: /home/sandeep/Desktop/MyDocs/repos/git-repos/public/MavenCodeBase/settings.xml
- Maven 本地存储库的路径: /home/sandeep/Desktop/MyDocs/repos/maven-repos
- pom.xml: http://pastebin.com/462Uytad
警告信息:
Warning:java: source value 1.5 is obsolete and will be removed in a future release
Warning:java: target value 1.5 is obsolete and will be removed in a future release
Warning:java: To suppress warnings about obsolete options, use -Xlint:-options.
问题:
是什么导致了这些消息?修复这些警告消息的好方法/推荐方法是什么?
【问题讨论】:
-
你的 pom 没有显示任何编译插件的配置,尝试在你的 pom.xml 中设置 -source and -target
标签: java intellij-idea