The distribution Management pom.xml section is responsible to define:
This data are used in the deploy phase
Three steps are needed:
with Repository Manager - Nexus, in the pom.xml, we set the repository locations
<distributionManagement>
<repository>
<id>nexus</id>
<name>Releases</name>
<url>http://localhost:8081/repository/maven-releases</url>
</repository>
<snapshotRepository>
<id>nexus</id>
<name>Snapshot</name>
<url>http://localhost:8081/repository/maven-snapshots</url>
</snapshotRepository>
</distributionManagement>
and in settings.xml the credentials
<settings>
...
<servers>
<server>
<id>nexus</id>
<username>admin</username>
<password>admin123</password>
</server>
</servers>
...
</settings>
See also: Maven - (Password|Credentials)
Maven - (Deploy|Distribution) Phase
mvn clean deploy