If another server is running on the selected port when calling run, ask the user:
"The server port PORT_NUMBER is taken by another process. What other port would you like to use? (default: PORT_NUMBER + 1): "
The server port is passed here https://github.com/openmrs/openmrs-sdk/blob/master/maven-plugin/src/main/java/org/openmrs/maven/plugins/Run.java#L160
You need to find a way to check if the port is taken or not before passing it.