Multiple jars in one jar file




















Combine multiple jar into one using maven Ask Question. Asked 7 years, 4 months ago. Active 4 years, 9 months ago. Viewed 9k times. HinoHara HinoHara 2 2 gold badges 12 12 silver badges 24 24 bronze badges. I used "add framework support" then I modified the pom. Adi I downloaded maven but I didn't try compile or something because I don't know what to use , is it obligatory to download this plugin?

Add a comment. Active Oldest Votes. Add the following plugin to your pom. Adi Adi 2, 1 1 gold badge 12 12 silver badges 22 22 bronze badges. HinoHara - please see edited answer on how to configure main class.

Let me know if it works. Hi thanks for answer but I still have the same problem , I will copy pom. I just double click on the jar but noting is displayed. Thanks kotes. Please note that this method will not work for other java servers like tomcat etc. Thanks, Suresh Veda. Register or Login.

Welcome back! Sign in with Email. Reset Your Password We'll send an email with a link to reset your password. Stay ahead! Get the latest news, expert insights and market research, tailored to your interests. Sign up with Email. Sign in with email Enter the email address associated with your account. You auth link is expired or incorrect, please try again. Be aware that you may also need to merge any manifest. Use zipgroupfileset with the Ant Zip task.

If you are using gradle, just add the following to build. No plugins required. If you need special options, then go with Fatjar plugin, as initialZero suggests. Open cmd , give path of folder and run command : ant zip.

Extract both jars and create a new one works. Use jar commands shown above. One caveat about manifest file is that you want to extract the jar whose manifest file you want to retain in the last. I know it's an old question and I just wanted to add my two cents no permission to comment yet, so creating a new answer. I do see the value in sumanth.

In my case I wanted to merge some library files mainly generated web service client code into the jar of an application written by me. It was OK to replace the manifests with the one of my own jar. The simplest way of doing this is taking care of the order in which you unzip the original files as Alnitak and sumanth. I wanted to use the zip ant task thank you, ykombinator, for the idea.

See my ant target below. The output directory in my example is called codemodule. The rest of the names are self-explaining. This way its manifest will be retained as the duplicate attribute of the zip ant task is set to preserve. Stack Overflow for Teams — Collaborate and share knowledge with a private group.

Create a free Team What is Teams? Collectives on Stack Overflow. Learn more.



0コメント

  • 1000 / 1000