Skip to content

A Maven Badge generator written with Spring Boot

Notifications You must be signed in to change notification settings

patka/maven-badge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Maven Badge Generator

Purpose

This is a very simple Spring Boot application that will generate the well known Maven badges as PNG images.

A Maven badge is this small icon on the projects readme that can tell you the latest version of the project available in Maven. Like this: Maven Central

Although there are maven badge generators available in the internet, I needed one that I can install within the company premises that I can configure for the local Nexus to generate badges that are displayed on the internal Gitlab Readme files.

It is highly inspired by this maven badge project that is written in Ruby but since I don't have any experience in hosting ruby applications in a secure way I created this Java application.

Running

You can clown the repo and with the command

$ mvn package

you can create a runnable jar that can then be copied to the target system.

You can run it by invoking

$ java -jar "-Dmaven.url=https://<yourNexusHere>" MavenBadgeApplication.jar

Usually Sonatype Nexus supports a web service to query the repo. It looks something like this:

https://search.maven.org/solrsearch/select?q=g:org.cognitor.cassandra+AND+a:cassandra-migration&rows=1&core=gav

The url you have to provide here is everything up to the /solrsearch... part.

Usage

Once the application is started you can generate URLs that follow this scheme:

http://localhost:8080/maven/<groupId>/<artifactId>/badge.png

This will return the picture that can be referenced inside any HTML or Markdown page.

This application uses Shield.io to generate the badge.

About

A Maven Badge generator written with Spring Boot

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages