* Added badge for Maven-Cenral last update. * Update services/maven-central/maven-central-last-update.service.js Co-authored-by: chris48s <chris48s@users.noreply.github.com> * updated according to the review comments. --------- Co-authored-by: chris48s <chris48s@users.noreply.github.com>
14 lines
467 B
JavaScript
14 lines
467 B
JavaScript
import { BaseXmlService } from '../index.js'
|
|
|
|
export default class MavenCentralBase extends BaseXmlService {
|
|
async fetch({ groupId, artifactId, schema }) {
|
|
const group = encodeURIComponent(groupId).replace(/\./g, '/')
|
|
const artifact = encodeURIComponent(artifactId)
|
|
return this._requestXml({
|
|
schema,
|
|
url: `https://repo1.maven.org/maven2/${group}/${artifact}/maven-metadata.xml`,
|
|
httpErrors: { 404: 'artifact not found' },
|
|
})
|
|
}
|
|
}
|