Git Product home page Git Product logo

exists's Introduction

exists

When you just want to know what exists.

What does this do?

exists will tell you if a specific artifact exists or it will give you all the possibilities that might match what you're looking for. As a bonus, if you looking for versions it'll also tell you if there's a missing maven-metadata.xml file, what the latest version in the metadata file is, and also show you if that version doesn't actually match what the latest version really is.

This currently works with Maven Central, Sonatype releases, Sonatype snapshots, and Sonatype Nexus repository OSS installations that you may be using.

It really doesn't do too much.

Usage: exists [options] [org[:name[:version]]]

When you just want to know what exists.
Either I'll find it or complete it.

Options:

 -h, --help        shows what you're looking at
 -c, --credentials credentials for the passed in withRepository
                   ex. username:password
 -r, --repository  specify a repository
                   ex. [central,sontaype:snapshots,sonatype:url]

Why'd you build this?

The short version was this was built out of annoyance and me going down a rabbit hole to understand why Coursier wouldn't complete snapshots or artifacts from my work's self-hosted Nexus.

The longer version will have to wait until I better understand a few more things and write them down for you to hopefully enjoy and also have a better understanding of a few of the following:

  • What's the difference between release and snapshot repository listings?
  • Why doesn't my self-hosted nexus behave just like maven central?
  • Why is supposed to keep this maven-metadata.xml up to date anyways?
  • Why is my maven-metadata.xml file way out of date on Sonatype releases?

So many fun questions.

For now, feel free to use this in a very similar way you'd use cs complete <artifact>, but also having it work on sbt plugin published to maven central, snapshots, and your self-hosted Sonatype nexus.

O, also I got to play with scala-cli for this, which was a good learning experience.

Using it

To build it locally clone this repo and do a scala-cli package . -o exists -f.

Use it for snapshots

❯ ./exists -r sonatype:snapshots org.scalameta:metals_2.12:
Found up until: org.scalameta:metals_2.12
Latest version according to metadata: 0.10.9+49-60d74a51-SNAPSHOT
Last updated according to metadata: 2021-11-18T20:23:02
Exact match not found, so here are the 10 newest possiblities:
 0.11.0+27-c77d9714-SNAPSHOT
 0.11.0+25-7cc1bc13-SNAPSHOT
 0.11.0+23-bacbde61-SNAPSHOT
 0.11.0+21-8e662d9c-SNAPSHOT
 0.11.0+19-d964693d-SNAPSHOT
 0.11.0+17-69a43f63-SNAPSHOT
 0.11.0+15-ea6ea86c-SNAPSHOT
 0.11.0+13-b6814655-SNAPSHOT
 0.11.0+11-5898e3b5-SNAPSHOT
 0.11.0+10-41d3108e-SNAPSHOT

Use it for sbt plugins

❯ ./exists org.wartremover:sbt-wartremover_2.12_1.0:
Found up until: org.wartremover:sbt-wartremover_2.12_1.0
No mavemen-metadata.xml file was found for this artifact
Exact match not found, so here are the 10 newest possiblities:
 2.4.9
 2.4.8
 2.4.7
 2.4.6
 2.4.5
 2.4.4
 2.4.3
 2.4.2
 2.4.16
 2.4.15

Use it for your custom nexus

❯ ./exists -r $NEXUS_URL -c $NEXUS_USERNAME:$NEXUS_PASSWORD my.org:
Found up until: my.org
Exact match not found, so here are the 3 newest possiblities:
  app1_2.13
  app1_3
  app2_3

Don't

Use this in a serious capacity or as a library. Use Coursier instead. Nothing is being cached here, so you're making a whole bunch of requests since under the hood we are scraping html/xml. Just use Coursier for anything serious.

exists's People

Contributors

ckipp01 avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.