Best approach to maven project-specific scripts?

Viewed 35

In npm we have the option to define project specific scripts in the package.json file as described here.

What is the best tool/approach to this with maven? I'd like a way to write cross-platform, reproducible scripts with minimal setup.

Example scripts and the raw commands:

  • Build the project into a JAR file, skipping tests, and then deploy as part of a docker-compose deployment

    • mvn package -Dmaven.test.skip=true
    • docker-compose up --build -d
  • Rebuild and replace the running container in the docker-compose deployment

    • mvn package -Dmaven.test.skip=true
    • docker-compose up -d --no-deps --build spring
  • Build the project and run tests without deploying

    • mvn clean install

These commands can be a pain to remember and this is a project that will be used by many students with limited maven and docker experience. So a tool that's easy to install and makes creating scripts that 'just work' when pulling the repository would be great.

0 Answers
Related