Deploying a maven-based installer

Something similar was set to the maven user list , but I have a situation similar to this.

I have a service packaged as .WAR that is created by maven. However, this .WAR file requires configuration: I need to pack it in different ways, depending on user input. In principle, the user must choose the components himself, he would like to add to the WAR and define some simple configuration for these components.

What do I need to do:

  • Create an โ€œeasyโ€ installer that will not contain maven artifacts (or, if this is not possible, all of them = โ€œheavyโ€ installer).
  • When the end user launches the installer, he is prompted to specify a list of components for the package (= flags)
  • For each component, the installer requests configuration parameters (then they should be saved as .property files, one per component).
  • Then the installer extracts only the necessary artifacts (user-selected + those that are required), and replaces the property files (s) in these artifacts with those specified in step 3 (or places them in the / "classes).
  • Finally, it creates a ready-to-use WAR package and (optionally) launches tomcat (or berth) in the background.

IzPack helps solve only step 2. But is there a universal solution for this?

+4
source share
1 answer

I do not know any universal solutions that do this, especially something that packs a configured WAR. IzPack can collect installation parameters (and possibly help solve Step 3), IzPack has an advanced Web Installers feature that can help solve Step 4, but as far as I know, this is not a build / packaging tool, so it wonโ€™t cover the fifth step (most important).

Maybe the maven archetype can help here (interactively). But I'm not even sure that the archetype will offer you the necessary level of flexibility. In other words, it will not be easy.

In fact, in your case, I think that Ant (with Maven Ant Tasks or Ivy) would be the best option, I know that this is not what you asked for, but I do not think that Maven is the right tool for your use.

+2
source

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


All Articles