Search code examples
javajarplayframeworkwsdlplayframework-1.x

How to set the Play framework local dependencies of a WSDL generated JAR?


I have created a JAR file using Saleforce's WSC. I want to use this JAR file in my Play Framework app (v.1.2.*). As this is a local file, I put the JAR file in a special JAR folder, and set in the dependencies.yml the following lines:

- provided:
        type:       local
        artifact:   ${application.path}/jar/sfpartner.jar
        contains:
            - provided -> *

Unfortunately it doesn't seem to work. I suspect it's because the JAR file doesn't have a revision number. Any idea how to fix it?


Solution

  • The lines you've added to dependencies.yml define a repository: they tell Play Framework to look for packages from the group "provided" under the location you specified.

    You still need to tell Play about the actual dependency. Add a line under the require: section of the file that looks like this:

    - provided -> sfpartner 1.0
    

    The format of these lines is group -> package version, but since your repository only contains one artifact, the package and version you write won't really matter. Usually, you parameterize the artifact element, like this:

        artifact: ${application.path}/jar/[module].jar
    

    This way, the package (module) name determines which jar to use. You might want to do this if you think you'll have more than one non-maven jar files in your project.

    You seem to have another unrelated problem that you discovered when you put the jar file directly in the lib directory. Open another question with more details, or, you know, email me. ;)