Automating the packaging process allows to setup continuous integration on the Nuxeo Package build, its install and the features it provides.
There are multiple ways to build a Nuxeo Package. Focusing on those using the Ant Assembly Maven Plugin, you can find below the three different methods depending on the constraints and objectives, from the better to the quicker method:
See Nuxeo Marketplace Sample for downloading a project with sample architectures, implementing the three below build methods plus the required modules for testing those Nuxeo Packages with Selenium, WebDriver and Gatling.
Applied to the sample project, here are the results from those three methods. Look at the differences in the content, size and build time. The network bandwidth is not evaluated but it also varies respectively from the most to the less, proportionally to the build time.
The recommended method is to build an NXR corresponding to the wanted result after the package install. Then we operate a comparison between that product and a reference one (usually the Nuxeo CAP), and we finally generate the Nuxeo Package which will perform the wanted install.
4 directories, 6 files, 128KB. Build time: 11s.
recommended/ |-- install | |-- artifacts-sample.properties | |-- bundles | | `-- The sample project bundle. | |-- templates | | `-- sample | `-- test-artifacts-sample.properties |-- install.xml `-- package.xml
lib directory is empty because all required third-parties are already included in the basic Nuxeo distribution. The
bundles directory only contains the sample project bundle because all its dependencies are also already included in the basic distribution.
That method is using the same principle for building the Nuxeo Package as for building an NXR, with no final optimization. It is an acceptable compromise between speed and quality.
5 directories, 150 files, 33MB. Build time: 6s.
nonxr/ |-- install | |-- artifacts-sample.properties | |-- bundles | | `-- 46 bundles. | |-- lib | | `-- 99 third-party libraries. | |-- templates | | `-- sample | `-- test-artifacts-sample.properties |-- install.xml `-- package.xml
Here, we are embedding a lot of bundles and libraries which are useless because already included in the basic Nuxeo distribution but that cannot be detected by the build process.
That latest method is explicitly listing everything that must be packaged. It is not recommended except for specific cases, quick solution or proof of concept.
5 directories, 8 files, 1.6MB. Build time: 3s.
explicit/ |-- install | |-- bundles | | `-- The sample project bundle, explicitly listed. | |-- lib | | `-- 4 third-party libraries, explicitly listed. | `-- templates | `-- sample |-- install.xml `-- package.xml
That solution builds a lighter package than the No-NXR method but we don't know if it will be missing some dependencies or not. The embedded bundles and libraries list must be manually maintained.