Deploying a Shared Module on Remote Repository
To deploy a shared module on a remote repository, perform the following steps:
- Procedure
- Import or create a shared module which you want to publish on the remote repository.
-
Right-click the Shared Module and select the Generate POM for Shared module option.
It generates the POM for the shared module.
-
Add the remote repository details in the generated shared module POM in the following format:
<distributionManagement>
<snapshotRepository>
<id>test-repo</id>
<url>http://nexus.test.com/nexus/content/repositories/releases/</url>
</snapshotRepository>
</distributionManagement>
where,
<id>
is the remote repository ID and<url>
is the remote repository URL. -
Mention the repository ID and credential details in the
settigs.xml
file present in the.m2
repository. - Create a
settings.xml
file if it is not present. Ensure that the repository ID is the same insettings.xml
andpom.xml
files. -
Right-click the Shared module and create a new Run\Debug Configuration for Maven. Then, select the shared module project and run the
clean deploy
goal.This deploys the shared module on the remote repository mentioned in the
POM.xml
file of the shared module.
<servers><server>
<id>test-repo</id>
<username>$username</username>
<password>$password</password>
</server>
</servers>