Hacker News new | past | comments | ask | show | jobs | submit login

Java does this pretty well, at least if you use Gradle, I think. You specify the location of the repository in the

  repositories { ... } 
block and then specify (with maven naming scheme)

  dependencies { compile "group:name:version" }
where group might be something like org.apache, name might be apache-commons and version might be 2.5.



It's nothing Gradle-specific - as you say it's the Maven scheme and used by almost all JVM dependency managers. Note also there's a convention of using a domain you control in reverse order as the groupId (i.e. com.mycompany:myproject:1.0) which makes collisions extremely unlikely. Finally it's very easy in the maven ecosystem to run a "proxy repository" for your organization that indefinitely caches all the artifacts you depend on, thus ensuring that your builds will always be reproducible.


the only aweful thing is deploying to the central repository


why? I have used sonatype and it's pretty much log in, promote to production.


It's a very painful process to get set up - no doubt it's easy after the first time. I've ultimately found it easier to go via bintray: http://blog.bintray.com/2014/02/11/bintray-as-pain-free-gate... .

On the positive side, some of the complexity comes through enforcing some standards about what packages go into central - in particular you must have a properly declared license, developer contact information, and GPG sign your releases. Which are things other language ecosystems would do well to enforce.


The first time definitely is a drag, but I had to do it exactly once a few years ago. If I ever need to publish another library, it's trivial. Bintray isn't standard, which isn't the worst thing in the world but does become aggravating at times.


Re Bintray isn't standard: There is no standard, both Bintray and Maven Central are just internet repositories. JCenter is bigger, so if you define "standard" as "bigger one", Bintray is the way to do.

If by "standard" you meant "default", like Maven Central is the default in Maven, here I have some news for you as well. Bintray is the default in Mac OS' Homebrew, Android Studio, Groovy's @Grab, and first class citizen in Gradle, Ivy and SBT.


To be clear the point of the guide I linked is that you can publish to bintray and have them sync it into maven central.


as soon as you are in, yes. but as a startup you need to waiiiiiiit




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: