jimmoores / quandl4j

Java wrapper for Quandl REST API
quandl4j.org
Apache License 2.0
78 stars 22 forks source link

OpenGamma no longer publish old artifacts via maven.opengamma.com #22

Closed george-hawkins-work closed 8 years ago

george-hawkins-work commented 8 years ago

We have been using quandl4j for a while without problem but a new employee had issues. The reason was we all have com.opengamma.external.json cached in our local .m2 repositories but it seems maven.opengamma.com is no longer publishing old artifacts like this.

OpenGamma now seems to have a space on bintray and they also seem to be publishing their main products, like Strata, to Maven Central (e.g. see the Strata README).

I just tried building quandl4j locally but without much luck due its dependence on maven.opengamma.com. I suggest clearing out ~/.m2/repository/com/opengamma and seeing if you have the same issues (if you have something like Sonatype Nexus proxying remote repos for you then you'll obviously have to clear out things there too).

george-hawkins-work commented 8 years ago

For reference Quandl4J works fine if we pull it in like this:

<dependency>
    <groupId>com.jimmoores</groupId>
    <artifactId>quandl</artifactId>
    <version>1.3.0</version>
    <exclusions>
        <exclusion>
            <groupId>com.opengamma.external.json</groupId>
            <artifactId>json</artifactId>
        </exclusion>
    </exclusions>
</dependency>
<dependency>
    <groupId>org.json</groupId>
    <artifactId>json</artifactId>
    <version>20160810</version>
</dependency>

I understand the reasons you outline in #11 for not including org.json:json - the clause you refer to is indeed childish and stupid (quite apart from any legal aspects).

Maybe it's time to consider Jackson. We use it for all our JSON related work (as do Spring and pretty much everyone else). E.g. parsing arbitrary JSON into a Map is as easy as:

String jsonString = ...
ObjectMapper mapper = new ObjectMapper();

Map<String, ?> data = mapper.readValue(jsonString, new TypeReference<Map<String, ?>>() { });
jimmoores commented 8 years ago

Sorry you've been having trouble. Relying on OpenGamma to actually maintain a repo and not just deprecate everything is obviously pointless. I'll start looking into an alternative as a priority. Thanks for the information. I'll update this thread when I have some news.

jimmoores commented 8 years ago

The artifacts are still there, you need to browse to http://maven.opengamma.com/nexus/content/groups/public to see them (served out of an S3 bucket), but, for whatever reason, I regularly get reports of failures because of it so I'll proceed with replacing the library anyhow.

george-hawkins-work commented 8 years ago

OK - a few hours later http://maven.opengamma.com/nexus/content/groups/public/com/opengamma/external/json/json/1.0.0.v20101106/ seems to be available again.

But neither com.opengamma.external.json nor maven.opengamma.com look like they're big on OpenGamma's radar anymore (i.e. there's no Github repo for the first and they now seem to be using other services for their main artifacts) so maybe it's still worth considering shifting to something like Jackson.

jimmoores commented 8 years ago

No, I agree - I've switched to Jackson - more specifically a datatype module called jackson-datatype-json-org that solves the immediate problem by supporting the org.json data types in Jackson without introducing compatibility issues for current users. It's not that clear which Jackson model would be best (the tree model in databind I'm guessing?) as the JSON returned by Quandl is poorly defined. This is probably a 2.0 change, but it's great that Jackson has this module as it means we should be able to retain decent API compatibility.

I've pushed up an updated POM. Seems to be a drop in replacement. George, I appreciate you forcing the issue, it's a bit overdue!

jimmoores commented 8 years ago

I've now published 1.4.0 with the changes to Maven Central, tagged in git, moved master to 1.5.0-SNAPSHOT, updated the documentation and website and added you to the contributors list (unless you object).

george-hawkins-work commented 8 years ago

Wow - I'm a contributor based on one small suggestion. Thanks 😄 And thanks for Quandl4J.