Fork me on GitHub
#leiningen
<
2024-01-29
>
Nim Sadeh20:01:04

I upgraded one of my (Java) dependencies in my project.clj file. One of the changes is that one of the classpaths was renamed. My code as-is threw an error about not finding the class which is expected. I changed the name to the new name, but it can't find that either. There seems to be some sort of lein/cider issue where the old version is cached somewhere. Is there a way to clean the dependency record? Is upgrading a package supposed to be this hard?

seancorfield20:01:21

Can you provide specifics? What library? What original version, and what new version? Which class?

seancorfield20:01:36

(in general, updating deps should be easy but...)

vemv20:01:53

IIRC you had a very old enrich-classpath plugin in your project.clj

Nim Sadeh20:01:35

Sure Langchain4J 0.24.0 -> 0.25.0 Per this commit, the class dev.langchain4j.data.document.parser.PdfDocumentParser is now dev.langchain4j.data.document.parser.apache.pdfbox.ApachePdfBoxDocumentParser. An issue I made that was causing my app to crash (document splitter was not concurrency-safe) should be patched in this new version which is why I want to upgrade

Nim Sadeh20:01:41

@U45T93RA6 what do you mean? I have lein-environ and lein-localrepo plugins, 1.2.0 and 0.5.4

vemv20:01:12

There's a plugin named enrich-classpath. A user in this channel recently posted a project.clj with a very old version of it

vemv20:01:50

If that's not it, lein deps :tree is your friend

seancorfield20:01:42

@U05D3EAA6FM Can you share your project.clj -- or at least the various langchain4j dependencies?

Nim Sadeh20:01:34

Oh it might be those local repos I tried to setup a while ago and forgot about

seancorfield20:01:27

You need to add [dev.langchain4j/langchain4j-document-parser-apache-pdfbox "0.25.0"]

Nim Sadeh20:01:02

Oh did they split that out of the main jar?

Nim Sadeh20:01:53

That did it, thanks. This is the last project that will use langchain. Out of curiosity where did you see this?

seancorfield20:01:31

I searched the code repo for the new class -- but it is explained in the Breaking Changes section of the release notes, now that I look there: https://github.com/langchain4j/langchain4j/releases/tag/0.25.0

seancorfield20:01:56

I guess since it isn't yet a 1.x release, they feel it's OK to make breaking changes in a minor update...

Nim Sadeh20:01:56

My fault for not reading the changelog

Nim Sadeh20:01:17

Basically only I use it I think...