mardi 27 janvier 2015

maven error - package org.junit does not exist

I got a little trouble using maven and junit. Running junit test on its own works perfect, but building with Maven mvn clean test fails. I made sure that all tests are within "src/test/java" and all sources are within "src/main/java", so junit can find them (regarding to other questions this was the problem in many other cases).


So does anybody knows why I this is not working for me?


Error Message snipped:



/D:/pathToProject/myProject/src/test/java/myPackage/MyFile.java:[5,17] package org.junit does not exist


Pom.xml Snipped:



<...project information.../>
<build>
<sourceDirectory>src</sourceDirectory>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source />
<target />
</configuration>
</plugin>
</plugins>
<plugins>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>

Aucun commentaire:

Enregistrer un commentaire