The mvn deploy command, which uses the Maven Deploy plugin, is for installing the build artifacts (jar file, war file etc. that is being built) to a remote Maven repository.
If you want to do this, then of course you need to tell the plugin where the remote repository is that you want to deploy your build artifacts to. The error message is telling you that you did not specify where the remote repository is:
Deployment failed: repository element was not specified in the POM inside distributionManagement element or in -DaltDeploymentRepository=id::layout::url parameter
So it doesn't know where to upload the build artifacts to.
Was this what you actually intended to do, or did you really want to do something else?
Note: What is meant with "deploying" here is not the same as deploying your application on a Java EE server. Specifically, mvn deploy is not what you need when you want to deploy your application on a Glassfish server.