Deploying a Shared Module on Remote Repository

To deploy a shared module on a remote repository, perform the following steps:

    Procedure
  1. Import or create a shared module which you want to publish on the remote repository.
  2. Right-click the Shared Module and select the Generate POM for Shared module option.

    It generates the POM for the shared module.

  3. 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.

  4. Mention the repository ID and credential details in the settigs.xml file present in the .m2 repository.

  5. Create a settings.xml file if it is not present. Ensure that the repository ID is the same in settings.xml and pom.xml files.
  6. <servers>
    

    <server>

    <id>test-repo</id>

    <username>$username</username>

    <password>$password</password>

    </server>

    </servers>

  7. 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.