How to make maven deploy like the IDE does

Hello,

 

I am in the process of trying out IntelliJ (the Ultimate trial version 2020.1) to learn how J2EE development works. Therefor, I added the maven framework support to my project. Deployment from the IDE works (local deployment) for my small trial project. However, when I go to the command line, and execute "mvn deploy", the deployment fails ("Deployment failed: repository element was not specified in the POM inside distributionManagement element or in -DaltDeploymentRepository=id::layout::url parameter").

I got as far as figuring out that I need to specify the deployment location in the pom file, and in the project's pom.xml, there indeed is not a trace of the deployment information (configurations). On the other hand, I was surprised that this isn't done automatically by IntelliJ. Somewhere I read that I should close the project and re-import it from the pom.xml file, which I tried, but this didn't work either.

So could someone explain how to keep both inline (automatically), so that I don't necessarily have to open IntelliJ just for some minor change, and to have the possibility to just do a "mvn deploy" from the command line ?

(sorry if this question isn't posted in the most appropriate forum, but in that case, feel free to suggest where it's better to post it...)

Please sign in to leave a comment.