Implementing an installer, which is maven-based
Something similar has been asked in maven user list but I have the situation, similar to that.
I have some service, packaged as .WAR, which is build by maven. However, this .WAR file requires customization: I need to package it in different ways, depending on user input. Basically, user should himself select the components, he would like to add to WAR, and define some simple configuration for these components.
What I need to do is:
- Create a "lightweight" installator, that will not contain any maven artifacts (or, if that's not possible, contain all of them = "heavyweight" installator).
- When end user launches the installator, he is asked for the list of components to package (=checkboxes)
- For each component, installator asks for the configuration options (then to be 开发者_JS百科saved as .property files, one per component)
- Installator then fetches only the artifacts needed (selected by user + those which are obligatory), and replaces the property file(s) in those artifacts by those from step 3 (or puts them to "classes/").
- Finally it creates ready to-use WAR package and (optionally) launches tomcat (or jetty) in a background.
IzPack helps to solve step 2 only. But is there any universal solution for that?
I don't know any universal solution doing that, especially something that will package a customized WAR. IzPack can gather install parameters (and maybe help to solve step 3), IzPack has an advanced feature called Web Installers that could help to solve step 4, but to my knowledge, it's not a build/packaging tool, so it won't cover step 5 (the most important).
Maybe a maven archetype could help here (in interactive mode). But I'm not even sure an archetype will offer the level of flexibility you need. In other words, it won't be simple.
Actually, in your case, I think that Ant (with Maven Ant Tasks or Ivy) would be the best option. I know this is not what you asked for but I don't think Maven is the right tool for your use case.
精彩评论