SAP / cloud-mta-build-tool

Multi-Target Application (MTA) build tool for Cloud Applications https://sap.github.io/cloud-mta-build-tool
Apache License 2.0
139 stars 60 forks source link

Make maven settings.xml configurable in cli #701

Closed fwilhe closed 4 years ago

fwilhe commented 4 years ago

We're working on project "Piper".

We need to configure maven settings on behalf of the projects that make use of project "Piper".

Maven provides options to configure both project- and global settings:

$ mvn --help

usage: mvn [options] [<goal(s)>] [<phase(s)>]

Options:
 -gs,--global-settings <arg>            Alternate path for the global
                                        settings file
 -s,--settings <arg>                    Alternate path for the user
                                        settings file

But mbt does not expose those options to the cli.

Currently we have to change state of the system by copying the settings file into ~/.m2 cf.

This is not a good option as it alters the state of the system where we're running this on. Please provide a cli to set both settings.

katunin-ng commented 4 years ago

Hi,

Please consider using the "custom" builder https://sap.github.io/cloud-mta-build-tool/configuration/#configuring-the-custom-builder instead of default "maven" one with predefined configurations. With the "custom" builder you can specify any command for building a module.

Regards Natalia

fwilhe commented 4 years ago

I'm aware of custom builders, but this is not a solution.

We're building project "Piper", i.e. we provide building blocks for CI/CD which projects then can use. Hence we don't own/control the mta.yaml file and thus we can't configure custom builders.

mbt's abstraction of maven (and also npm) makes it harder to implement such things and forces us to copy files and thus alter the state of the computer where the piper tool is used. This is not satisfying.

katunin-ng commented 4 years ago

Hi,

The MTA Build Tool is not intended to be an abstraction of maven and npm. Its purpose is to generate a mta archive according to the configurations in the mta.yaml file. By design, when it activates module builds it relies on the tools and their configurations available in the build environment. So if you need to change settings for the complete project, from our perspective the correct way to do it is to "change the state of the system".

In order to provide better integration between tools, I suggest to have a meeting to discuss the details of your requirements. Please set one. My SAP mail is natalia.katunin@sap.com.

Regards Natalia

fwilhe commented 4 years ago

Similar thing also applies to the --registry parameter for npm.

katunin-ng commented 4 years ago

Hi, A project's modules can be configured to be built with any technology: maven, npm, grunt, Gradle, etc. Basically with the "custom" builder, there are no limits. The MBT tool will not expose all technologies configuration options via its interface. You should consider other alternatives. Lets proceed the discussion on the meeting.

Regards Natalia