Manage many clients with the same Java projects with little change.

I have several java projects with slight differences between them for each client, these differences:

  • differences in jrxml reports
  • differences in property files
  • Changes to Static Classes

Projects differences

When I move on to updating clients, I transferred SVN and generated a WAR for each project (about 90 mb) using Jenkins, uploaded to FTP and installed it on each server.

The problem I am facing is the time that I need to do so, which is 3 to 4 hours for 6 projects every week.

  • Is it possible that all clients are handled by one project (a single WAR) and share the differences outside the war?
  • What would be the best way to do this?
  • Is this recommended or is there a better way to handle this?
+6
source share
2 answers

Is it possible that all clients are handled by one project (one WAR) and share the differences outside the war?

Of course, but ... the bear is with me for a second.

With a 4 hour creation / deployment time, I would say that the problem between the jenkins server and the production servers can be a problem. If the update is not viable, you will need to optimize your project setup.

Typically, 90% of the war file size is made up of the collection of libraries your application relies on to do its job (spring, hibernate, struts, etc.). Suppose you are currently storing them in your WEB-INF / lib folder, you can consider extracting them and installing them in the general path to the application classes, removing them from your war.

This will not shock me if, after this operation, you do not need further optimizations ...

0
source

I found that when I need to save time, this command saves me every time:

rsync -razpv --delete /folder/name server_name:/folder/name 

You can also add:

 --exclude 'file/inside/folder' 

Use it cleanly and wisely, but the process of copying files for some of my collections lasted 20 minutes, now it takes 10 seconds when there are no changes, and less than 1 minute when there are changes.

Also - have you thought about a management tool (puppet / chef / truthful) to do some work?

0
source

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


All Articles