Skip to content
Advertisement

maven error: package org.junit does not exist

I’m trying to create the javadoc with maven and it fails. It also fails when doing the verify.

JavaScript

I get the following error:

JavaScript

In my pom.xml file I have the following lines:

JavaScript

and my local repository contains the junit jar file:

JavaScript

The code is fine because in my laptop, which I have no access now, I van run:

JavaScript

with no problems, and also the tests work in eclipse IDE.

Advertisement

Answer

Ok, you’ve declared junit dependency for test classes only (those that are in src/test/java but you’re trying to use it in main classes (those that are in src/main/java).

Either do not use it in main classes, or remove <scope>test</scope>.

Advertisement