---
title: 'Get the latest version of a maven groupId:artifactId via Node.js script'
url: 'https://tutego.de/blog/javainsel/2021/10/get-the-latest-version-of-a-maven-groupidartifactid-via-node-js-script'
markdown: 'https://tutego.de/blog/javainsel/2021/10/get-the-latest-version-of-a-maven-groupidartifactid-via-node-js-script.md'
date: '2021-10-20'
description: "//\_npm\_install\_node-fetch import\_fetch\_from\_'node-fetch'; const\_groupId\_=\_\"org.apache.maven.plugins\"; const\_artifactId\_=\_\"maven-compiler-plugin\"; const\_url\_=\_`http://search.maven.org/solrsearch/select?q=g:\"${groupId}\"+AND+a:\"${artifactId}\"`; const\_response\_=\_await\_fetch(url); const\_body\_=\_await\_res…"
taxonomy:
  category:
    - Allgemein
---

# Get the latest version of a maven groupId:artifactId via Node.js script

![Illustration einer tropischen Insel mit Palmen und einem hohen Berg](https://tutego.de/blog/javainsel/user/themes/tutego/images/insel-cover.jpg)# Java Blog für Programmierer

[Java Blog für Programmierer](https://tutego.de/blog/javainsel/)

## Get the latest version of a maven groupId:artifactId via Node.js script

20.10.2021 · [Christian Ullenboom](https://tutego.de/blog/javainsel/author/admin/)

 ```javascript
// npm install node-fetch
import fetch from 'node-fetch';
const groupId = "org.apache.maven.plugins";
const artifactId = "maven-compiler-plugin";
const url = `http://search.maven.org/solrsearch/select?q=g:"${groupId}"+AND+a:"${artifactId}"`;
const response = await fetch(url);
const body = await response.json();
const version = body.response.docs[0].latestVersion;
console.log(version);
```

Kategorien: [Allgemein](https://tutego.de/blog/javainsel/category/allgemein/)

[← Alle Beiträge](https://tutego.de/blog/javainsel/)
