IntelliJはIDEで@Test注釈を認識しません。 IDEとコマンドラインを使ってテストをうまく動かすことができます。しかし、私は "@テスト"の下の赤い詰まったエラーラインを取り除くことができませんIntellijはテスト注釈を認識しません
エラーメッセージは、 "'@Test'メソッドには適用されません"と言います。 。
誰にもこの修正がありますか?
バージョン:のIntelliJ IDEA 15.0.6
誤差画像
私のpom.xmlファイルは、次のようになります。Mavenのプロジェクトで
<?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>javaForTesters</groupId>
<artifactId>javaForTesters</artifactId>
<version>1.0-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</build>