简体   繁体   中英

Building multiple runnable jars in maven eclipse

I have a java project in eclipse that contains multiple classes.I recently converted the project to a maven project and i am new to maven.I set the dependencies in the pom.xml and everything is fine.However , i want to make a runnable jar file from each class keeping in mind the jar files/libraries i am using in my project should be used/extracted by the obtained jar.

How can i do it in maven?I was able to do it using the export before now its not working.

Thanks for your help

一种方法是为每个可运行的JAR文件制作一个单独的POM文件(并因此制作Eclipse项目)。

If you want maven to build your project into multiple jars it's probably a good idea to step back and re-asses how you project is structured and why you chose to use maven in the first place. There are actually ways to do this but they're all horrible. You don't want maven to build multiple jars and you certainly don't want to make a runnable jar file for each class. You potentially need to split your project into multiple smaller ones.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM