Xero-Java icon indicating copy to clipboard operation
Xero-Java copied to clipboard

Make java lib Java 17 compatible

Open ulrichenslin opened this issue 2 years ago • 8 comments

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

ulrichenslin avatar Jul 22 '23 14:07 ulrichenslin

Any thoughts on when this PR might be approved?

mcmar47 avatar Sep 07 '23 21:09 mcmar47

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

cmxiv avatar Oct 23 '23 07:10 cmxiv

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

mchip22 avatar Oct 26 '23 16:10 mchip22

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.

savvyben avatar Jan 25 '24 14:01 savvyben

@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 avatar Feb 08 '24 11:02 dalli98

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

dalli98 avatar Feb 08 '24 11:02 dalli98

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

savvyben avatar Feb 08 '24 12:02 savvyben

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>

dalli98 avatar Feb 08 '24 13:02 dalli98

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

manishT72 avatar Jun 21 '24 16:06 manishT72