How to configure NES for Spring: Foundations 5.3.x
First, please review our Minimum Requirements to ensure a smooth installation.
For Maven
Follow these easy steps:
- Update your pom.xml with NES package versions and repository details
- Install and run!
Example Reference Application
You can access and clone the these sample applications using NES for Spring to try out installing and building. A more detailed README file is provided in the example application.
Additionally, you can view an example Github commit to see exactly what code aspects to change to drop-in NES packages.
Detailed Maven Instructions
1. Substitute Spring Boot references in your pom.xml like the following (use appropriate version):
Note: Use the Latest Versions of NES for Spring Artifacts to find the NES replacement version.
<parent>
<groupId>com.herodevs.nes.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<!-- NES version here -->
<version>2.7.18-spring-boot-2.7.19</version>
<relativePath />
</parent>
...
<dependencies>
<dependency>
<groupId>com.herodevs.nes.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>com.herodevs.nes.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<!-- other dependencies as needed -->
</dependencies>
...
<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>
2. Add your email address to the global Maven settings file in your home directory (~/.m2/settings.xml) or wherever you store project secrets. (preferably not in source code)
<settings>
<servers>
<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>
3. Install and run your application
./mvnw clean install -U
./mvnw spring-boot:run
Note, if your Maven settings.xml file is located in a path other than Maven's global path, use "-s path/to/settings.xml".
./mvnw -s ./settings.xml clean install -U
For Gradle
Follow these easy steps:
- Update your build.gradle
- Update your Gradle properties file
- Build and run!
Example Reference Application
You can access and clone the these sample applications using NES for Spring to try out installing and building. A more detailed README file is provided in the example application.
Additionally, you can view an example Github commit to see exactly what code aspects to change to drop-in NES packages.
Detailed Gradle Instructions
1. Substitute Spring Boot references in your build.gradle like the following:
Note: Use the Latest Versions of NES for Spring Artifacts to find the NES replacement version.
plugins {
id 'java'
id 'com.herodevs.nes.springframework.boot' version '2.7.18-spring-boot-2.7.19'
id 'io.spring.dependency-management' version '1.0.15.RELEASE'
}
...
repositories {
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)
}
}
mavenCentral()
}
...
dependencies {
implementation "com.herodevs.nes.springframework.boot:spring-boot-starter-web"
implementation "com.herodevs.nes.springframework.boot:spring-boot-starter-security"
implementation "com.herodevs.nes.springframework.boot:spring-boot-starter-validation"
}
2. Add NES repository information to global Gradle properties file (e.g. ~/.gradle/gradle.properties)
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
3. Add the NES maven repository to settings.gradle.
pluginManagement {
repositories {
...
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)
}
}
mavenCentral()
...
}
}
4. Install and run your application
./gradlew bootRun
Additional Information
The direct download URLs for NES for Spring: Foundations 5.3.x follow this format:
base_url: https://registry.nes.herodevs.com/maven/com/herodevs/nes/springframework/boot/
package_name: spring-boot-starter-parent
version: 2.7.18-spring-boot-2.7.19
filename: [package_name] + [version] + extension
[base_url] / [package_name] / [version] / [filename]
Example