Maven

As of version 3.1.2 the DidiSoft OpenPGP Library for Java JAR files can be obtained from our private Maven repository located at:

DidiSoft private Maven repository URL: https://repo.didisoft.com/repository/maven/

You can either configure your pom.xml to use the DidiSoft JAR files from our private repository or upload them in your own corporate Maven repository (Artifactory, Nexus, etc.). Both will be illustrated in this chapter.

Table of Contents

Using DidiSoft JAR files directly from DidiSoft Maven repository

This involves two steps.

Step 1) is to register DidiSoft private Maven repository in your Maven settings.xml file. In your ~/.m2/settings.xml you have to specify your login credentials (the same email used for accessing our customers’ section).

<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
                          https://maven.apache.org/xsd/settings-1.0.0.xsd">
...						  
      <servers>
	<server>
            <id>didisoft-repository</id>
            <username>email address for accessing DidiSoft Customers section</username>
            <password>email address for accessing DidiSoft Customers section</password>
        </server>
      </servers>		
...	  
    </settings>

Step 2) is to specify the URL of DidiSoft’s private Maven repository and the actual dependency for the DidiSoft JAR files.

In your Java project pom.xml you have to define the URL of DidiSoft repository:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
 
	...
	<repositories>
		<repository>
		  <id>didisoft-repository</id>
		  <url>https://repo.didisoft.com/repository/maven/</url>
		</repository>
	 </repositories>
	 ...
</project>

Then define the pgplib JAR file as dependency again in your project pom.xml:

   <dependencies>
	<dependency>
	  <groupId>com.didisoft</groupId>
	  <artifactId>pgplib</artifactId>
	  <version>3.1.2.1</version>
	</dependency>
  </dependencies>

Artifactory – DidiSoft repository as remote repository

In JFrog Artifactory you can include DidiSoft repository as a Remote repository, caching the dependencies locally in your Artifactory.

  1. From the navigation bar select Create Repositories -> Remote Repository; type – Maven

2. Fill in DidiSoft repository details

3. In the Advanced tab fill in your email address used to access DidiSoft customers’ section for both Username and Password

4. Click ‘Save & Finish

Nexus – DidiSoft repository as proxy  repository

Sonatype Nexus allows inclusion of third party repositories as proxy repositories, this way dependencies will be cached automatically in your Nexus machine. Just follow the steps below:

  1. Login as Administrator in Sonatype Nexus and switch to ‘Server administration and configuration’

2. From the Repositories screen select ‘Create Repository’

3. Select ‘maven2 (proxy)’ as repository type
4. Fill the details as follows:

Name: didisoft
Layout policy: Permissive
Remote storage: https://repo.didisoft.com/repository/maven/
Use the Nexus truststore: select ‘View certificate‘ -> ‘Add certificate to truststore‘, then check the checkbox for Use the Nexus truststore
HTTP check
Username: email address used to access DidiSoft customers’ section
Password: the same email address used to access DidiSoft customers’ section

5. Click the ‘Create repository‘ button and now you can include the didisoft repository to your maven-public group:

Summary

This chapter illustrated how to obtain DidiSoft OpenPGP Library for Java JAR files from our private Maven repository. The straight way is to include DidiSoft Maven repository as a remote repository in your Maven project pom.xml file.

A more conservative approach is to let your corporate Maven repository to maintain local copies of DidiSoft JAR files, this way reducing dependency upon DidiSoft infrastructure.