I have several Java projects using ExtJs applications as a web client. Library frankly not small. The full archive of more than 60M megabytes weighs, and applications in active development have to drag and drop all this from CVS. And if you add the slow Internet to the latter, then everything becomes completely sad. The application also has a dozen classes there, and the weight is already over fifty megabytes.
what
There was an idea to arrange this library in the form of a plug-in. After a certain share of RTFM, it was decided to do it through maven. He has such a thing as war-layout. Allows you to "glue" several applications into one, and you can clearly specify what to include and what not.
how
Creating an overlay project
It's simple.
Create an empty web application.
To folder
src/main/webapp/lib/extJs/
(Ways regarding the root of the project. May depend on your configuration and your desire to be CVN) we unpack archive with ExtJs, downloaded from a site of sencha. Attention! At the time of writing the post, the archive contained the ext-NUMBER_VERSIONS_ExtJs folder . We do not need this folder. It is necessary to unpack its contents. This will allow us to have the same path for any version of extJs. We will manage the version elsewhere.
In pom.xml in the project settings do not forget to register
<version>__ExtJs-RELEASE</version>
and
<packaging>war</packaging>
Now it’s enough for us to perform
mvn clean install
to download to the local maven repository, or, like ours, configure Jenkins to monitor the CSV repository and automatically download new versions to nexus.
Connect to another project
In pom.xml, you must specify the dependence on the above created project.
We were able to update the ExtJs version by simply changing the dependency version in pom.xml. On the other side of the scale, the maveno overlays are not too fast, but this is solved by discarding all unnecessary. Moreover, if we decide to overload some basic functions of ExtJs, we will not need to copy the code into all projects.