snowdrop / java-buildpack-client

A simple buildpack (https://buildpacks.io/) platform implementation as a library for java..
Apache License 2.0
13 stars 7 forks source link

Is it possible to make the project compatible with Java 8 #12

Closed fatiiates closed 2 years ago

fatiiates commented 2 years ago

I am developing Jenkins Pipeline(DSL) Plugin for Buildpacks. I'm thinking of performing processes with this client. But Jenkins plugins cannot currently work with Java 11. Jenkins plugins support Java 8 and below.

Is it possible to make the project compatible with Java 8 ?

BarDweller commented 2 years ago

It may be as simple as changing the level in the pom.xml .. I'd need to try.. Java 8 is kinda old now tho! I'm not sure if I used any post 8 features within the code, or what level the dependencies would ask for. If you have time, fork and give it a go, and let me know how it goes! .. I'm not able to get back to this code for a few weeks yet, so you'll probably get an answer quicker if you have a bash yourself =)

fatiiates commented 2 years ago

Thanks, I was able to get it working with java 8. Just one line change in "docker/ContainerUtils.java" was enough.

// docker/ContainerUtils.java  
// IOUtils class comes from org.apache.commons.io.IOUtils  
IOUtils.copy(is, tout);  
// As far as I understand, method "transferTo()"  in line "is.transferTo(tout);"  comes with Java 9.

If it works for you, it is currently in my own repository as a local maven repository.