I have a Maven project in which I need to use a dependency that is local. To include it in the project, in pom.xml
I do:
<dependency>
<groupId>com.something.library</groupId>
<artifactId>theId</artifactId>
<version>1.0.0</version>
<scope>system</scope>
<systemPath>C:/Tests/libs/something.jar</systemPath>
</dependency>
When I build and run the project through the IntelliJ IDE, the project starts normally and runs as expected. However, when I do:
mvn compile
mvn exec:java -D"exec.mainClass"="org.example.Main"
I'm prompted with the information, that one of the classes from within that jar package, can't be found (again, that was not the case when I tried running through IDE).
Am I doing something wrong here?
Try installing the JAR in you local Repo. Many tutorials exist for this, e.g. baeldung.com/install-local-jar-with-maven
TBH I have never used
<scope>system</scope>
<systemPath>C:/Tests/libs/something.jar</systemPath>
Only examples I have seen are relative to the project root. Remove the C:
... perhaps it is something about jumping from one drive to another in Windows??