timrs2998 / pdf-builder

PDF builder written in Kotlin with a statically typed DSL
https://timrs2998.github.io/pdf-builder/
GNU General Public License v3.0
57 stars 16 forks source link

Missing gradle dependencies for pdfbox and kotlin stdlib in release 1.3.1 - 1.5.0 #19

Closed simboel closed 4 years ago

simboel commented 4 years ago

Hi Tim,

thanks for this library. I was about to use it in my project. I added your example code from the README and I got the following error on document {:

Cannot access class 'org.apache.pdfbox.pdmodel.PDDocument'. Check your module classpath for missing or conflicting dependencies

I then added compile "org.apache.pdfbox:pdfbox:2.0.17" to my build.gradle file and everything worked as expected.

I was wondering, why you didn't already include pdfbox as dependency for your library. You didn't mention to include it manually in your README either. After I looked at https://mvnrepository.com/artifact/com.github.timrs2998/pdf-builder?repo=jcenter I saw the problem.

When I click on version 1.3.0, I can see the following configuration for your lib, just like I would've expected it to be.

Compile Dependencies (2) org.apache.pdfbox » pdfbox org.jetbrains.kotlin » kotlin-stdlib

Starting from version 1.3.1 to 1.5.0 (in jcenter) this is missing. They all say:

Compile Dependencies (0)

Currently, I've added the pdfbox dependency manually. But I would really appreciate, if you would configure it to include the dependencies directly.

Best Regards, Simon

timrs2998 commented 4 years ago

Sorry, you are correct. The docs are missing the pdfbox dependency.

The intention was to use the new api/implementation way of declaring dependencies instead of deprecated compile way, and that apache pdfbox be an "api" dependency. I forgot to update the docs with this change. Couple of notes:

timrs2998 commented 4 years ago

So I know you want the dependency added so that users don't need to add pdfbox, however, I think the right solution is to have pdfbox as an "api" dependency (rather than implementation or compile). That makes sense because pdfbox is required on the user's classpath and is used in return types and method parameters on the public api for pdf-builder. Then update the documentation with instructions to add pdfbox as an additional dependency. Let me know your thoughts on that.

simboel commented 4 years ago

At first: Thanks alot for the hint with compile and implementation keyword, I didn't know that.

I'm not an expert on this topic. But as far as I've understood I would agree to your conclusion for the API dependency and the updated documentation.

It would be cool if you mention pdfbox as the underlying base in your project short description, too. I was wondering how you create the pdf because some tools even use third party software your need to install.

timrs2998 commented 4 years ago

FYI I updated the README.md to be explicit about relying on pdfbox and that it's a required dependency.