1

Suppose I have a spring project, like spring data project to persist data or a spring boot project. I want to make a jar file from the mentioned project, so I can use their interfaces/classes/functionalities to persist data in a java core maven project. What configuration I should apply in its POM file to export that project as jar file and add it as a library to my project? Due to some performance issues, I don't want to make the whole project as a Spring project.

MHK
  • 63
  • 1
  • 8
  • Possible duplicate of [How can I create an executable JAR with dependencies using Maven? ](https://stackoverflow.com/questions/574594/how-can-i-create-an-executable-jar-with-dependencies-using-maven) – DvixExtract Oct 09 '18 at 12:26
  • 1
    not at all. Creating a jar file is quite different from what I asked ! – MHK Oct 14 '18 at 14:52

2 Answers2

1

It's easy if you want to use maven in your destination project just execute mvn:install and at the destination project add it in your pom if they are in the same machine

if you need to compile and develop your destination project in another machine you can use repository maven servers like nexus or jfrog

I hope this will be useful for you

Aryan
  • 56
  • 1
  • 3
-1

Create the Runnable JAR file using export option.

Click on your project -> export -> java-> runnable jar file -> select the option to pack requires libraries in the jar

Or programmatically like how-can-i-create-an-executable-jar-with-dependencies-using-maven or executable-jar-with-maven

Alien
  • 15,141
  • 6
  • 37
  • 57