0

I successfully made jar library from maven project(simple Hello World text using nanoHTTPD), but I need to import it into Java project so when main class is executed, automatically it starts the Web Server. It does not work that whey when i import the library, only when i have both of projects in my Eclipse and i import entire maven project in my Java Build Path of project.

To be more specific, my project is working with cash drawer and printer, and its creating log file(that is going to be uploaded on web server, that is why I need this). I want to start both things with one main (actually my project manager does).

Biswajit Karmakar
  • 9,799
  • 4
  • 39
  • 41
Spax021
  • 1
  • 1
  • 3

1 Answers1

2

You need to install the jar in your local Maven repository (I assume you don't have a remote repository) with make install. Then, you add the jar in the dependency of you other java project, in your pom.xml.

Dependency management is one of the major points of Maven, actually.

Alexis Dufrenoy
  • 11,784
  • 12
  • 82
  • 124
  • Yes I understand that Dependency management is top priority. Thanks @Alexis Dufrenoy for help, it made me think little bit more (still a newbie at programming) and finally I found answer [here](http://stackoverflow.com/questions/574594/how-can-i-create-an-executable-jar-with-dependencies-using-maven) I added part of code to pom.xml (which include all dependencies) created library and imported to Java project. I would give you feedback, but my reputation is still under 15, sry – Spax021 May 26 '16 at 08:42