Click here to Skip to main content
15,867,704 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
C#
I have a library project which is built in maven. It has its dependencies. I need to export this project as a jar (Not a runnable jar). Should I include the dependencies along with my jar or should I not? Because when I exported the dependencies with my jar, there were conflicts when the same jars of different versions were used for projects that added this project as a dependency. But if I don't export with the dependencies, at run time this library project throws NoClassDefFound errors for its dependencies. So what is the right way to do this? If I don't export the dependencies with my jar, is there a way that the project using this library project could download those jars for the library project? If that is how I would do it, then wouldn't it mean that the project using this project must be using maven too? It won't be a good practice as whoever uses this library should be able to use whatever the build tools they want. I am pretty new to maven. Please advice.


What I have tried:

I tried creating the jar without dependency. But its throwing NoClassDefFound errors. I also tried with dependencies. But this causes conflicts to arise.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900