My project structure as below during the integration test.
Project-A
|_conf (contains the configuration files)
|_lib (Contains the all dependencies)
|_pom.xml
|_target
|_test (Contains the integration tests)
When I run the below maven command it download the dependencies from nexus and pointing to the local repositories instead of lib directory.
How Do I tell maven to check lib folder for dependencies instead of local maven repository?
Note : lib contains the all the dependencies which are required to test the project.
mvn surefire:test
If you want to use dependency that is not in maven repo, then you can place those jars in in project (in your case lib directory). And specify the path of the jar to use like below.
<dependency>
<groupId>anything</groupId>
<artifactId>anything</artifactId>
<version>anything</version>
<scope>system</scope>
<systemPath>${basedir}/lib/jar-name.jar</systemPath>
</dependency>
Here you can mention anything for groupId
, artifactId
and version
. These fields are just ignored in this case.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With