So I'm trying to include two local jar files into a Maven project I have and failing to do so. I've tried working through the solutions in these threads: 1 2 but it still isn't really working. Here are the key pieces of my pom.xml file:
<repository>
<id>local-maven-repo</id>
<url>file://${basedir}/resources</url>
</repository>
and then dependencies:
<dependency>
<groupId>edu.mlab.jar1</groupId>
<artifactId>jar1_local</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>edu.mlab.jar2</groupId>
<artifactId>jar2_local</artifactId>
<version>1.0</version>
</dependency>
Both jar files include package declarations at edu.mlab.jar1
and edu.mlab.jar2
respectively, so that's where I want them. The jar files are in the resources folder, and that's right under the base directory.
That's the setup. Now, when I try mvn package
(after mvn clean
) I get the following error
[ERROR] Failed to execute goal on project PROJECT: Could not resolve dependencies for project edu.mlab.project:PROJECT:war:1.0-SNAPSHOT: The following artifacts could not be resolved: edu.mlab.jar1:jar1_local:jar:1.0, edu.mlab.jar2:jar2_local:jar:1.0: Failure to find edu.mlab.jar1:jar1_local:jar:1.0 in file:///Users/mlab/Desktop/2016/project_web/resources was cached in the local repository, resolution will not be reattempted until the update interval of local-maven-repo has elapsed or updates are forced -> [Help 1]
I'm not really sure what's going wrong seeing as my jar1 and jar2 are exactly in the resources folder. Also, I've tried the approach of importing them with the system scope, but that won't work for my purposes as I want them included in the war artifact.
Thanks so much!