SpringBoot jar can not be used as library

32 Views Asked by At

I have abc.jar which is a SpringBoot jar created with below build configuration. I need to use this jar in other project as a library. When I added abc.jar as dependency in pom.xml, it is downloaded but not able to import any class from it.

How to build a jar which can be deployed (SpringBoot) and used as library as well in other projects?

<build>
    <plugins>
      <plugin>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-maven-plugin</artifactId>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-assembly-plugin</artifactId>
        <configuration>
          <descriptorRefs>
            <descriptorRef>jar-with-dependencies</descriptorRef>
          </descriptorRefs>
        </configuration>
        <executions>
          <execution>
            <id>make-assembly</id>
            <phase>package</phase>
            <goals>
              <goal>single</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
0

There are 0 best solutions below