Update Maven CI/CD template to not use "only"

Problem to solve

This CI/CD template uses "only" and should use "rules."

https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Maven.gitlab-ci.yml

Further details

Proposal

Who can address the issue

Other links/references

Edited by 🤖 GitLab Bot 🤖