Packaging and distribution of packaging

We have a common code that is laid out in packages, as expected. Some of these packages handler, processor, util, registration, etc.

Common here means that they will be reused in several Java / Java EE projects that are not related to each other.

The question is packaging for distribution.

Each package contains different function blocks, but together they represent an API.

Should we combine the individual functionality in a JAR and eventually add 8 to 10 cans. For example: a box for a handler, a registration banner, etc.

or

Should we use the least common denominator approach, which is a basic assembly of 5 mandatory packages in one bank. Anyone else needs a bank as a base and can choose additional banks.

Our build system is Ant + Ivy, and these dependencies will be resolved at compile time and build time.

0
source share
3 answers

If you have many, many API classes (Spring, I think) or are aware of some interference between them, I believe that there are very few reasons to break them into separate banks. The only reason for breaking the API in individual jars is to make different teams work independently.

Managing a single bank simplifies many things, and you should not fix a problem that does not exist.

+5

. BTW, maven, pom.xml, .

. , , jar , , . , . . , manifest.mf. Maven jar. .

0

api mulitple jars,

Advantages of a single jar If an application wants to use more than one jar, for example, registration, as well as use. it should include only 1 jar.

Limitation If the size of your jar is very large and you use only the classes of use in the bank. This can increase the size of the application, if the size of the application is not a problem for you, then you can avoid it.

0
source

All Articles