Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maven dependencies are downloaded with wrong classifier #677

Closed
Mincol opened this issue Aug 21, 2019 · 5 comments

Comments

@Mincol
Copy link

commented Aug 21, 2019

This might be maven knowledge problem, but maybe not.
from my pom.xml

<properties>
	<maven.compiler.source>1.8</maven.compiler.source>
	<maven.compiler.target>1.8</maven.compiler.target>
	<sfm.version>7.0.3</sfm.version>
</properties>
<dependencyManagement>
	<dependencies>
		<dependency>
			<groupId>org.simpleflatmapper</groupId>
			<artifactId>sfm-csv</artifactId>
			<version>${sfm.version}</version>
		</dependency>
	</dependencies>
</dependencyManagement>
<dependencies>
	<dependency>
		<groupId>org.simpleflatmapper</groupId>
		<artifactId>sfm-csv</artifactId>
	</dependency>
</dependencies>

Maven version 3.6.1.

During run time I get error:
java.lang.UnsupportedClassVersionError: org/simpleflatmapper/util/Enumerable has been compiled by a more recent version of the Java Runtime (class file version 53.0), this version of the Java Runtime only recognizes class file versions up to 52.0

As one can see from image dependencies has wrong classifier:
SFM-JDK9

Is this problem on my end?

@arnaudroger

This comment has been minimized.

Copy link
Owner

commented Aug 21, 2019

is that in intellij ?

@arnaudroger

This comment has been minimized.

Copy link
Owner

commented Aug 21, 2019

is check #673
the classifier is set by the profile that depends on the version of the vm that run maven - I tried to find a better way, but did find any that would work once build, and I'm very open to have a better way of doing that :) -, and intellij as a different vm setting for the maven importer than the project vm...
I'm planning to had some documentation for that ...

@Mincol

This comment has been minimized.

Copy link
Author

commented Aug 21, 2019

Yes, this is IntelliJ Idea. Fix for me os to change JDK for Importer to be java version 1.8
JDKforImporter

Can you explain me, please, why having there Java 11 downloaded classifier jdk9? Thank you for enlightening me.

@arnaudroger

This comment has been minimized.

Copy link
Owner

commented Aug 21, 2019

well currently the classifier is selected via the profile, jdk9 as the module-info and is used for every java version > 9. the java 8 version without a classifier would work too.
I did not find any other way to select the right classifier than using profile on runtime vm. I've experimenting to see if you get it to propagate the classifier from the top dependency to the decending one but did not find a way with maven ... I'm open to suggestion .

@arnaudroger arnaudroger added this to the 8.0.0 milestone Sep 2, 2019

@arnaudroger

This comment has been minimized.

Copy link
Owner

commented Sep 2, 2019

that should be fixed in 8
https://simpleflatmapper.org/2019/09/01/v8.0.0.html
I changed the build and I don't use the classifier anymore, instead it generate different artifactId for each jre version

@arnaudroger arnaudroger closed this Sep 2, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.