XeroAPI / Xero-Java

Official Java client for use with Xero API
MIT License
78 stars 88 forks source link

Make java lib Java 17 compatible #346

Closed ulrichenslin closed 5 months ago

ulrichenslin commented 1 year ago

This change makes the library JDK 1.8, 11 and 17 comparable

mcmar47 commented 1 year ago

Any thoughts on when this PR might be approved?

cmxiv commented 1 year ago

Can someone from the team can give an ETA on this please?

mchip22 commented 1 year ago

Hello - Can the maintainers please comment on the acceptability and plan of the proposed PR ?

savvyben commented 10 months ago

You are going to have to produce a library that is Java 17 compatible sooner or later. We are on Java 21 now! This needs to be done as latest versions of the Java Servlet specification (the jaakrta.*) are not compatible with this library.

dalli98 commented 9 months ago

@mcmar47 @cmxiv @mchip22 @savvyben I solved this issue by using the following dependency for xeroapi in pom.xml

<dependency>
    <groupId>com.github.xeroapi</groupId>
    <artifactId>xero-java</artifactId>
    <version>4.29.1</version>
    <exclusions>
        <exclusion>
            <groupId>org.glassfish.jersey.core</groupId>
            <artifactId>jersey-client</artifactId>
        </exclusion>
        <exclusion>
            <groupId>org.glassfish.jersey.media</groupId>
            <artifactId>jersey-media-multipart</artifactId>
        </exclusion>
        <exclusion>
            <groupId>org.glassfish.jersey.media</groupId>
            <artifactId>jersey-media-json-jackson</artifactId>
        </exclusion>

        <exclusion>
            <groupId>org.glassfish.jersey.core</groupId>
            <artifactId>jersey-common</artifactId>
        </exclusion>
        <exclusion>
            <groupId>org.glassfish.jersey.ext</groupId>
            <artifactId>jersey-entity-filtering</artifactId>
        </exclusion>
    </exclusions>
</dependency>
<dependency>
    <groupId>org.glassfish.jersey.core</groupId>
    <artifactId>jersey-client</artifactId>
    <version>2.27</version>
</dependency>
<dependency>
    <groupId>org.glassfish.jersey.media</groupId>
    <artifactId>jersey-media-multipart</artifactId>
    <version>2.27</version>
</dependency>
<dependency>
    <groupId>org.glassfish.jersey.media</groupId>
    <artifactId>jersey-media-json-jackson</artifactId>
    <version>2.27</version>
</dependency>
<dependency>
    <groupId>org.glassfish.jersey.core</groupId>
    <artifactId>jersey-common</artifactId>
    <version>2.27</version>
</dependency>
<dependency>
    <groupId>org.glassfish.jersey.ext</groupId>
    <artifactId>jersey-entity-filtering</artifactId>
    <version>2.27</version>
</dependency>
dalli98 commented 9 months ago

It looks like xeroapi wants to use jersey 2.27. However, the property is overridden and it uses a newer version which is not compatible

savvyben commented 9 months ago

Hey, @dalli98 , I don't feel that xero api should be using jersey-* imports at all. Feels wrong to me.

dalli98 commented 9 months ago

I did find a better way to override the jersey version in the dependencyManagement within pom.xml:

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.glassfish.jersey</groupId>
                <artifactId>jersey-bom</artifactId>
                <version>2.27</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>
manishT72 commented 5 months ago

@ulrichenslin Thanks for the PR. This has been fixed in v5.0.0. Please test with v5 and let us know.