IntelliJ にて Maven プロジェクトを作成し JUnit を dependency する場合の雛形 pom.xml
pom.xml でうまくいかんかったんで
source value 1.5 is obsolete 問題(?) なんてのがあるらしく
build > plugins > plugin > configuration の source, target を 明示的に利用 JDK の ver
(${java.version} ではなく固定値)
にしないと 「JDK 1.5 使ってますよね?」といった warn が出る
対応
<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>yourGroupId</groupId> <artifactId>yourArtifactId</artifactId> <version>0.1</version> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.3</version> <configuration> <source>1.8</source> <target>1.8</target> </configuration> </plugin> </plugins> </build> <dependencies> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.12</version> </dependency> </dependencies> </project>
自分用の補足記事