📜 ⬆️ ⬇️

A simple java web application installation (part 1)

So, you wrote your super web application in Java and now you want as many people as possible to download it, get it and start using it? Everything is fine, only for some java-programmers, especially for those who have lived in the J2EE world for the last two years, it may be a discovery that for 99.9% of people in this world the words “Just cover this WAR-nick on your favorite server” turn out to be a hollow sound. Well, ok, maybe not 99.9% and 99.8% - well, or so.

The following is the first part of the tutorial on how to make a beautiful Windows Installer out of your cook (yes, not only do most people not know the word warm, they also use Windows!) Using WiX


Formulation of the problem


So, we have:

We want to create an installation of our application through Windows Installer . During installation, you must:

')
What we will use:

All products are open source

Some moments may not be fully disclosed here - any questions and suggestions are welcomed. This solution is used to create an installer for the EmForge project - this project is open-source, so a working example can be obtained from its sources (for example, via a web viewer: www.emforge.org/browser/EmForge/trunk or simply by taking the source from svn repository svn.emforge.org/svn/emforge/EmForge/trunk

In this part we will look at the process of creating a zip archive with an application ready to run.

So let's go ...

Packing the application with Jetty


First of all, we need to save the user from understanding the word Deploy. There are several possible solutions, for example, you can pack a simple server straight into a war-nick, as they do in Hudson (an interesting solution - but I haven’t figured it out yet). We will go the other way - and create a Zip-archive in which we put Jetty, configured to launch our war-nick.

The idea was taken from this blog: blog.devspan.com/2008/02/creating-distributable-war-project-with.html - here I will describe only the main idea (if necessary - say - I'll write it out in more detail):


As a result, we get a zip in which will lie jetty and your application. The structure of the zip will be approximately as follows:
- etc Jetty
- jetty.xml
- jetty-win32-service.xml
- webdefault.xml
- lib , jetty
- wrapper.dll
- wrapper-3.2.0.jar
- jety-6.1.14.jar
- jetty-util-6.1.14.jar
- jetty-win32-service-java-6.1.14.jar
- servlet-api-2.5-6.1.14.jar
- start-6.1.14.jar
-logs
- webapps
- root

Jetty-Service.exe jetty
jetty-service.conf


Please check:


Well, that's all for now. In principle, this can and will stop - not a lazy user can already just download zip, unpack it and start the server with your application using run.bat or run.sh

We will talk about the solution for “lazy” users in the next series.

Source: https://habr.com/ru/post/55399/


All Articles