jQuery plugin which fetches the latest version of a Maven artifact from the central repos.
$.fn.artifactVersion({
'groupId': 'com.squareup',
'artifactId': 'otto'
}, function(version, url) {
$('.download').attr('href', url);
$('.version').text('Version ' + version);
});
$.fn.artifactVersions({
'groupId': 'com.squareup.spoon',
'artifactId': 'spoon-client'
}, function(versions) {
$.each(versions, function() {
$('.versions').append(
$('<li>').append(
$('<a>').attr('href', this.url).text(this.name)
)
);
});
});
Spoon client versions:
$.fn.artifactVersion({
'groupId': 'com.squareup.okhttp',
'artifactId': 'okhttp',
'classifier': 'jar-with-dependencies'
}, function(version, url) {
$('.download').attr('href', url);
$('.version').text('Version ' + version);
});
$.fn.artifactVersion({
'groupId': 'net.simonvt.messagebar',
'artifactId': 'messagebar',
'packaging': 'aar'
}, function(version, url) {
$('.download').attr('href', url);
$('.version').text('Version ' + version);
});