I was compiling a project using Maven when I got this error:
Compilation failure: Compilation failure:
[ERROR] /C:/test/unittest/TestManager.java:[3,24] package org.junit does not exist
[ERROR] /C:/test//unittest/TestManager.java:[3,1] static import only from classes and interfaces
[ERROR] /C:/test/unittest/TestManager.java:[138,10] cannot find symbol
[ERROR] symbol: class Test
[ERROR] location: class org.test.unittest.TestManager
[ERROR] /C:/test/unittest/TestManager.java:[19,17] cannot find symbol
[ERROR] symbol: method assertFalse(boolean)
My Junit package was thete as I don't have errors in my code. But NO, I wasn't adding it as a Dependency in the pom but as a jar in my Build Path.
So in order to fix the problem, I have removed JUnit form the Build Path and added it as Dependency:
That is it ;)
Compilation failure: Compilation failure:
[ERROR] /C:/test/unittest/TestManager.java:[3,24] package org.junit does not exist
[ERROR] /C:/test//unittest/TestManager.java:[3,1] static import only from classes and interfaces
[ERROR] /C:/test/unittest/TestManager.java:[138,10] cannot find symbol
[ERROR] symbol: class Test
[ERROR] location: class org.test.unittest.TestManager
[ERROR] /C:/test/unittest/TestManager.java:[19,17] cannot find symbol
[ERROR] symbol: method assertFalse(boolean)
My Junit package was thete as I don't have errors in my code. But NO, I wasn't adding it as a Dependency in the pom but as a jar in my Build Path.
So in order to fix the problem, I have removed JUnit form the Build Path and added it as Dependency:
<dependency> <groupId>junit</groupId> <artifactId>junit-dep</artifactId> <version>4.11</version> </dependency>
That is it ;)
Thanks for posting this
ReplyDeleteThanks for thanking this post
DeleteThis comment has been removed by a blog administrator.
DeleteThis comment has been removed by a blog administrator.
DeleteThis comment has been removed by a blog administrator.
Deletethanks
ReplyDeleteA great thanks to you
ReplyDeleteThis comment has been removed by a blog administrator.
ReplyDelete