Is there a Java/Maven equivalent of package.jsons "bin"?

Karamell :

I'm in Java team where multiple repos need to access a shared set of CI/CD-related bash script files. In a Node team, I would publish a private NPM package exposing these scripts through the bin entry of package.json, which other projects could then use after doing npm install.

I'm not sure if there's a good idea to introduce NPM to this project, so I need help to understand what the best approach would be in a more Java-oriented context.

Karol Dowbecki :

If the scripts are needed only by CI/CD they should be managed there, especially if you share them between the builds. You could replicate what you have with package.json by having JAR with bin scripts and unzipping it as part of the build but it's a brittle solution.

Modern CI/CD solutions use Docker containers to spin up a build environment (e.g. CircleCI, CloudBees). You can add bin scripts to the Docker image used to spin up a build environment node.

If this is not possible you still should be able to define build steps or pipelines. Define a common build step which installs these scripts.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=161259&siteId=1