Max
Max

Reputation: 643

Play Framework: how to resolve failure to download a JSON-LIB dependent library?

I am working with Play Framework 1.2.4, and using JSON-LIB to parse some JSON data from Java code.

Initially, I just put the 'json-lib-2.4-jdk15.jar' into the 'lib' folder, and the application worked fine. At some point, I got that this is not the right way to add libraries, and "play dependencies --sync" will even delete the JAR.

This is how my 'dependencies.yml' file looks now:

# Application dependencies

transitiveDependencies: false 

require:
- play
- play -> crud
- play -> secure
- play -> cloudbees 0.2.2
- net.sf.flexjson -> flexjson 2.1
- net.sf.json-lib -> json-lib 2.4

Why I had a successful import of dependencies with 'flexjson', it fails with 'json-lib'.

Running "play dependencies -- verbose" gets to the following error:

:: problems summary ::
:::: WARNINGS
            [NOT FOUND  ] net.sf.json-lib#json-lib;2.4!json-lib.jar (347ms)

    ==== mavenCentral: tried

      http://repo1.maven.org/maven2/net/sf/json-lib/json-lib/2.4/json-lib-2.4.jar

            ::::::::::::::::::::::::::::::::::::::::::::::

            ::              FAILED DOWNLOADS            ::

            :: ^ see resolution messages for details  ^ ::

            ::::::::::::::::::::::::::::::::::::::::::::::

            :: net.sf.json-lib#json-lib;2.4!json-lib.jar

            ::::::::::::::::::::::::::::::::::::::::::::::

Isn't it here? http://mvnrepository.com/artifact/net.sf.json-lib/json-lib/2.4

In addition, the process brings additional JARs to the 'lib' folder: xerces, xalan etc. - even after I asked to ignore transitive dependencies.

2 questions: 1. What did I do wrong? 2. Is there a good way to "force" Play to recognize certain JAR as a "local" library (so it won't be downloaded from external repository), and yet allow working with other modules and libraries via 'dependencies' mechanism

Upvotes: 1

Views: 903

Answers (0)

Related Questions