To access NES packages in our Maven repository, you will need set up with your NES access token. The instructions below describe how to set up Maven and Gradle clients with your NES access token.
Maven
For setting up Maven to access the NES Registry, locate the Maven settings file used to build the application. This is typically included in the USER_HOME/.m2 folder (e.g. ~/.m2/settings.xml).
Add the following server configuration for the NES registry using the provided NES access token.
<settings>
<servers>
<!-- Other server settings -->
<server>
<id>herodevs-nes-registry</id>
<username>any_text_here_not_used</username>
<configuration>
<httpHeaders>
<property>
<name>Authorization</name>
<value>Bearer NES_TOKEN_HERE</value>
</property>
</httpHeaders>
</configuration>
</server>
</servers>
</settings>
Note: The ID of "herodevs-nes-registry" should match that of the ID for source and plugin repositories in the applications' pom.xml (or parent pom.xml).
Example snippet of the pom.xml.
<repositories>
<repository>
<id>herodevs-nes-registry</id>
<url>https://registry.nes.herodevs.com/maven</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>herodevs-nes-registry</id>
<url>https://registry.nes.herodevs.com/maven</url>
</pluginRepository>
</pluginRepositories>
Gradle
For setting up a Gradle project with access to the NES registry, locate the Gradle properties file used to store variables used for Gradle builds. Typically this is stored in the global "gradle.properties" file (e.g. ~/.gradle/gradle.properties).
Add the following variables in the properties file.
herodevs_nes_registry_url=https://registry.nes.herodevs.com/maven
herodevs_nes_registry_user=any_text_here_not_used
herodevs_nes_registry_token=NES_TOKEN_HERE
Update the application's Gradle source repositories and plugin repositories to use the new NES variables with the following maven configuration. This is typically in the build.gradle and/or settings.gradle files.
maven {
url = uri(providers.gradleProperty("herodevs_nes_registry_url").get())
credentials {
username = providers.gradleProperty("herodevs_nes_registry_user").get()
password = providers.gradleProperty("herodevs_nes_registry_token").get()
}
authentication {
basic(BasicAuthentication)
}
}