I am trying use Spring Boot, and create a jar, and install it into my maven repo.
This is a library jar file that will be used as a dependency in my main application, which is also a Spring-Boot application. Right now, I am just working on a hello world example. here is my one class in this project:
public class MyLibrary {
public String getMessage() {
return "Hello World!";
}
}
and my POM basically looks like this:
<modelVersion>4.0.0</modelVersion>
<packaging>jar</packaging>
<groupId>com.me.plugin</groupId>
<artifactId>myLibrary</artifactId>
<version>0.0.1-SNAPSHOT</version>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.7.RELEASE</version>
</parent>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
</dependencies>
But when I try to build, I get 'Unable to find main class" error. Which makes perfect sense to me, but how do I get spring to make a library jar. I know I could add an Application.java with a main method, but that's not what I want, I want a simple jar file, but with all the Spring-Boot annotations, injections, etc...
How would I go about doing this? Is spring boot not what I want here?