How to deploy jar/war to nexus in the docker build?
<p>I currently following this methods for my maven java project in jenkins</p>

<ol>
<li><p>created a compose file with maven image, and given a entry point command "mvn clean install"</p></li>
<li><p>Created a Dockerfile, From tomcat image. that will copy my war to ../webapps folder</p></li>
<li><p>Once the docker compose up is exited with the code 0, I am starting the docker build with the Dockerfile.</p></li>
<li><p>Then pushing the image to my registry</p></li>
</ol>

<p>Now the problem is. I need to push my war to nexus.</p>

<p>I know , still we can achive by command mvn deploy ....</p>

<p>But is going like all we need to maintain for each and every project.</p>

<p>Previouly I used m2release plugin. that plugin have option to execute the try run and release run. once it done, it automatically change my pom to next vertion and commits to git. </p>

<p>Now I want to achieve that with docker build in jenkins. Or my way of doing is wrong? if yes, what is the correct solution for doing this?</p>