kand
kand

Reputation: 2338

Java Play Custom Dependencies Issue

So I added a custom dependency to my Play! application, so now my dependencies file looks ilke this:

require:
    - play
    - provided -> myjar 1.1.0

repositories: 
    - provided: 
       type:       local 
       artifact:   "${application.path}/lib/[module]-[revision].jar" 
       contains: 
         - provided -> * 

It ran once, but now I can't seem to get it to run again. Play! will throw an error saying that it cannot resolve one of the classes contained in myjar.

As a side note, I included this jar in my eclipse workspace, and eclipse has no problem finding the classes Play cannot; so I know at least that these classes exist within the jar and this is some issue with Play!. Also I've run deps and deps --sync both of which seem to recognize myjar.

Does anyone know what issue I could be having here?

EDIT: So it appears that my jar file is corrupt for some reason. I'm confused because it was literally working one minute then the next it was not. The only change I can think of that I did myself was renaming the file... Is it possible play or eclipse is doing something funky here?

Upvotes: 1

Views: 602

Answers (2)

digiarnie
digiarnie

Reputation: 23355

What if you try cleaning first and then doing the standard commands:

play clean
play deps --sync
play eclipsify

After that, if you go to your project in eclipse, does your jar, myjar-1.1.0, appear in the classpath?

Upvotes: 1

Linh Nguyen
Linh Nguyen

Reputation: 659

As you add the jar to your eclipse workspace, Play didn't resolve the dependencies.

After modifying the dependencies file, you should run:

play dependencies

Then, if you use eclipse, eclipsify it:

play eclipsify

This way, both play and eclipse will find your jar.

Upvotes: 2

Related Questions