Most likely your problem was because of <scope>test</scope>
(in some cases also <scope>provided</scope>
), as mentioned @thangaraj.
Documentation says:
This scope indicates that the dependency is not required for normal use of the application, and is only available for the test compilation and execution phases. Test dependencies aren’t transitive and are only present for test and execution classpaths.
So, if you don't need dependecies for test purposes then you can use instead of (what you will see in mvnrepository):
<!-- https://mvnrepository.com/artifact/org.slf4j/slf4j-nop -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-nop</artifactId>
<version>1.7.24</version>
<scope>test</scope>
</dependency>
Without any scopes (by default would be compile scope when no other scope is provided):
<!-- https://mvnrepository.com/artifact/org.slf4j/slf4j-nop -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-nop</artifactId>
<version>1.7.25</version>
</dependency>
This is the same as:
<!-- https://mvnrepository.com/artifact/org.slf4j/slf4j-nop -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-nop</artifactId>
<version>1.7.25</version>
<scope>compile</scope>
</dependency>