Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to generate jar and war both in project

we have two different project . And and the controller is almost same in two project.

project A has controller inside it. So generating war for it is not problem.

But project B is requiring Controller's jar of project A controller.

Can any body tell me how can i generate the jar file from the controller of project A which i can use in project B?

like image 236
Zuned Ahmed Avatar asked Apr 17 '12 11:04

Zuned Ahmed


People also ask

How do you make a war jar?

To create war file, you need to use jar tool of JDK. You need to use -c switch of jar, to create the war file. Go inside the project directory of your project (outside the WEB-INF), then write the following command: jar -cvf projectname.

Does war file contain jar?

The WAR file (Web Application Resource or Web Application ARchive) is a container for JAR files, JavaServer Pages, Java Servlets, Java classes, XML files, tag libraries, static sites (HTML and associated files), and other resources that make up an online application. A file entitled web.

When can you make war and jar?

JAR files allow us to package multiple files in order to use it as a library, plugin, or any kind of application. On the other hand, WAR files are used only for web applications. The structure of the archives is also different. We can create a JAR with any desired structure.


1 Answers

The default solution for such thing is to have two separate modules one for the war and one for the controller module. Don't start fighting with Maven.

like image 54
khmarbaise Avatar answered Sep 24 '22 18:09

khmarbaise