Using sonarcloud with auto devops

Hello,
I use gitlab with auto devops pipeline. So i have no gitlab ci config file in my repository.
Now i want to connect to sonarcloud but i need to add beside the variable also the
“only” and “mvn sonar:sonar” options from the given gitlab example file below.
Is it possible to add such configs to auto devops pipeline or do i need to create a specific git lab ci config file and disable the auto devops options?

Kind Regards
Sven

Example file from sonarcloud:
variables:
SONAR_USER_HOME: “${CI_PROJECT_DIR}/.sonar” # Defines the location of the analysis task cache
GIT_DEPTH: “0” # Tells git to fetch all the branches of the project, required by the analysis task
sonarcloud-check:
image: maven:3.6.3-jdk-11
cache:
key: “${CI_JOB_NAME}”
paths:
- .sonar/cache
script:
- mvn verify sonar:sonar
only:
- merge_requests
- master
- develop