I have a SpringBoot project being build with maven. I have 2 local libraries I am using but only 1 works and I can't figure out why the other doesn't work. I have both jars included as dependencies in my pom.xml file and have verified that the jars are indeed where I expect them to be:
<dependencies>
<dependency>
<groupId>com.runner</groupId>
<artifactId>librunnermax</artifactId>
<scope>system</scope>
<version>1.0</version>
<systemPath>${project.basedir}/../librunnermax/build/lib/librunnermax.jar</systemPath>
</dependency>
<dependency>
<groupId>com.runner</groupId>
<artifactId>librunnermin</artifactId>
<scope>system</scope>
<version>1.0</version>
<systemPath>${project.basedir}/../librunnermin/build/lib/librunnermin.jar</systemPath>
</dependency>
</dependencies>
The relevant code in these libraries is:
Librunnermax.Max
package com.runner.max;
public class Max {
public static final int MAX = 4;
}
Librunnermin.Min
package com.runner.min;
public class Min {
public static final int MIN = 0;
}
The spring controller I am using is this:
package com.runner.limits_api;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import com.runner.min.Min;
import com.runner.max.Max;
@RestController
public class LimitController
{
@GetMapping("/library")
public int library()
{
return Max.MAX;
}
@GetMapping("/library2")
public int library2()
{
return Min.MIN;
}
}
This all builds sucessfully. I get a limits_api.jar file (which does not list the min/max dependencies in the text of the jar). limits_api.jar is copied to my exec/ dir and the dependencies are copied to my lib/ dir.
project/
src/
limits_api/
librunnermax/
librunnermin/
lib/
exec/
When I run it, I can hit the /library endpoint and get the max value. When I hit the /library2 endpoint I get the ClassNotFoundException because Min class cannot be found. No error is thrown when I run the import statements. Why can Max be found but Min cant?