Protocol Buffers Setup
Installation and configuration guide for NES for Protocol Buffers 3.21.x
Setup Instructions
Configure Registry
Create or update your registry configuration:
<settings>
<servers>
<server>
<id>herodevs-nes-registry</id>
<username>any_text_here_not_used</username>
<password>YOUR_NES_ACCESS_TOKEN</password>
</server>
</servers>
</settings>
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
See the guides for Sonatype Nexus or JFrog Artifactory for setup to the HeroDevs NES registry.
Update Build Configuration
Add the NES repository and dependencies to your build configuration:
Look up the latest artifact version in the "Protocol Buffers Release Notes".
<!-- Import the NES protobuf BOM so every protobuf artifact resolves to the NES version -->
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-bom</artifactId>
<version>3.21.12-protobuf-3.21.14</version><!-- Updated Version -->
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<!-- Use the protobuf artifacts your project needs; the BOM manages their versions -->
<dependencies>
<dependency>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java</artifactId>
</dependency>
</dependencies>
<!-- Add NES repository -->
<repositories>
<repository>
<id>herodevs-nes-registry</id>
<url>https://registry.nes.herodevs.com/maven</url>
</repository>
</repositories>
dependencies {
implementation(platform("com.google.protobuf:protobuf-bom:3.21.12-protobuf-3.21.14")) // Updated Version
implementation("com.google.protobuf:protobuf-java")
}
// Add NES Repository
repositories {
maven {
url = uri("${herodevs_nes_registry_url}")
credentials {
username = "${herodevs_nes_registry_user}"
password = "${herodevs_nes_registry_token}"
}
}
mavenCentral()
}
The same NES version is published for protobuf-java-util, protobuf-javalite, protobuf-kotlin, and protobuf-kotlin-lite — swap in the artifact IDs your project depends on. All of them are managed by the imported protobuf-bom.
Build
In order to remove potential obstacles before building your project, make sure the following domains are whitelisted by your firewall/networking team:
registry.nes.herodevs.comassets.nes.herodevs.com
This will ensure that your network/firewall allows connection to our registry.
Run your build tool:
mvn clean install
gradle clean build
Verification
To verify your installation, check that:
- Dependencies are downloaded successfully
- No version conflicts are reported in your build
- Your application starts without errors
Manual Downloads
The direct download URLs for NES for Protocol Buffers packages follow this format:
| Portion | Value |
|---|---|
| base_url | https://registry.nes.herodevs.com/maven/com/google/protobuf/ |
| package_name | protobuf-java |
| version | 3.21.12-protobuf-3.21.14 |
| filename | package_name + version + extension |