I have several java non-maven projects (with one main project) and several maven projects (with one main project). Now I need to use the maven-projects functionalities in the non-maven projects.
I have to say, I know very little about maven. And I'm working in NetBeans IDE.
There are several options I've come up with:
Make non-maven projects maven projects and add dependencies. I cannot do that because others use the non-maven projects their way and I cannot just make changes like this.
Make maven projects non-maven projects and add them as Libraries I cannot do that because there would be a lot of libraries to add. The dependencies might be large.
To non-maven projects add jars as libraries of the maven projects. This is same as the (2) option. I tried it and added all the maven project jars as libraries to my non-maven main project, but at a run-time there was a lot of
NoClassDefFoundError
exceptions because of missing jars (3rd party jars that the maven projects depends on).?
Any ideas?
Thank you in advance.
Solved
I used the pom adjustments from chresse. The whole pom is here: https://codeshare.io/5ZeYN2
I used the maven command from the question Tunaki marked this was duplicate of (how-can-i-create-an-executable-jar-with-dependencies-using-maven)
mvn clean compile assembly:single
Thank you all.