Enjoy our new tool for building MTA archives!
Dear developers of full-stack (aka MTA) applications,
“Change means that what was before wasn’t perfect. People want things to be better” – Esther Dyson
At SAP we constantly strive to make the necessary changes to provide you with improved tools and services.
In this blog, I am proud to present a new tool for building MTA archives – the Cloud MTA Build Tool. The tool has been released as open source and is now production-ready.
Along with the new tool’s production-ready release, we officially announce the deprecation of the Multitarget Application Archive Builder. Version 1.1.20 of this old tool will be the last released version. It will be available for download from the SAP Development Tools site until May 31, 2020. After that date, the Multitarget Application Archive Builder will not be supported anymore.
Below, I will answer the questions that I believe may have stemmed from my introduction. If you have additional questions, please feel free to ask in comments to this blog. You can find all the information about the new builder in this manual.
Friendly Command Line Interface
The default build process that implements our best practices for building MTA projects is activated by a simple command: mbt build
It’s much shorter than the old command “java -jar mta.jar –build-target=CF build”, isn’t it?
And of course, there are standard CLI Help commands (mbt [command] –help or mbt [command] -h) that can help you learn about the other available commands and their parameters.
Control of the build process
Feel free … With the new tool, you are no longer limited by the predefined build flow and fixed command sets for building your application’s modules. The new tool offers multiple features to easily adjust the default MTA build procedure for your project needs or even to construct your own process.
You can configure your own commands for building modules.
For example, the build tool is configured to run the default Grunt task when building HTML5 modules. If you defined an additional task in the module’s Grunfile.js, you can now apply it instead of the default one as follows:
Use this option if you need to run additional steps before building modules. For example, if you have modules with identical dependencies (as with HTML5 modules), you can adjust your project so that all dependencies are downloaded once at the beginning of the project build and then these artifacts are referenced from the single module build. Think how this can boost your project’s build performance! This type of configuration is already used for SAP Fiori Projects in SAP Business Application Studio.
If you do not maintain your project sources in a standard MTA structure, but you still want to leverage the advantages of MTA for deployment, this option is for you. You can configure a pipeline that builds your project’s components (a.k.a. modules) using the technology or infrastructure of your choice, define the MTA deployment descriptor (a mtad.yaml file) that describes the target runtime project structure, and then use the ‘assemble’ command to package the modules’ build artifacts into a valid MTA archive.
If you are not satisfied with the provided defaults and cannot configure the build process using build parameters in the ‘mta.yaml’ file, consider using the two-step build approach. The new tool leverages GNU Make as a build engine. Using a dedicated command, you can generate a native GNU Make file (“Makefile.mta”) with the default configurations for building the MTA project according to our best practices and then adjust the build process directly in the “Makefile.mta” file.
These commands are useful if, for example, you want to build and deploy only specific modules for testing purposes, or if you decide to tailor your own build process for packaging MTA archives. In future releases, we are planning to expose additional commands, e.g. a dedicated command for project validation.
Not satisfied with the provided defaults? Found a bug?
The new tool is open-source and is thus open for contributions. Learn more about the contribution process.
Is the new Cloud MTA Build Tool compatible with the deprecated Multitarget Application Archive Builder?
Do not worry! The new and old tools are compatible, meaning that for the same configurations in the ‘mta.yaml’ file, the new tool generates an equivalent MTA archive.
However, minor adjustments in your project’s ‘mta.yaml’ file are required in the following cases:
- Your project contains HTML5 modules and your ‘mta.yaml’ file has the “deploy_mode=html5-repo” global parameter that causes these modules to be deployed into the HTML5 Application Repository in Cloud Foundry.
- You are using npm-opts, grunt-opt, or maven-opts build parameters.
- If you have custom extensions for SAP Web IDE Full-Stack and you need to rebuild them using the Cloud MTA Build Tool, for example, as part of a new version release process.
The manual shows you how to adjust the build configurations in the ‘mta.yaml’ file to get the expected behavior.
Is the new Cloud MTA Build Tool compatible with the MTA build option in SAP Web IDE Full-Stack and SAP Web IDE for SAP HANA?
SAP Web IDE Full-Stack uses the deprecated Multitarget Application Archive Builder for building MTA projects. This option is also deprecated and will be available only until May 31, 2020. Instead, you have an option for building projects with the new tool and you are able to choose between the options for a smooth migration. Pay attention to the differences between the tools explained in the previous question.
SAP Web IDE for SAP HANA provides its own mechanism for building MTA archives. If you build your project developed in SAP Web IDE for SAP HANA using the new Cloud MTA Build Tool (e.g. in the CI/CD pipeline), you will get an equivalent MTA archive. To build these projects in CI/CD pipelines, you can also use some of the advanced features of the new tool (for example, the custom builder) if you configure them using an MTA extension.
What should I do to start using the new Cloud MTA Build Tool instead of the deprecated Multitarget Application Archive Builder?
1. Adjust your project sources
There are very few features that the new tool handles differently. Please check here if they are relevant for your project, and if they are, adjust the project accordingly.
If you try to build the project without these changes, the MTA build tool will identify the cases and will fail the build with the corresponding errors.
2. If you are building MTA projects in SAP Web IDE Full-Stack, select the “Build with Cloud MTA Build tool” option that will be available soon. The MTA build with the deprecated Multi-target Application Archive Builder will be available until June 30, 2020 to ensure you have enough time for migration to the new tool.
3. If you build your project locally, adjust your build environment
4. Setup the new MTA build tool in your project delivery/CI/CD pipelines.
You can report an issue directly in the tool’s git repository following our issue template.
If you still have questions regarding the new Cloud MTA Build Tool, do not hesitate to ask! We are happy to answer your questions and hear your feedback.
I hope you enjoy using the new tool!