arnaudroger / SimpleFlatMapper

Fast and Easy mapping from database and csv to POJO. A java micro ORM, lightweight alternative to iBatis and Hibernate. Fast Csv Parser and Csv Mapper
http://simpleflatmapper.org
MIT License
437 stars 76 forks source link

Maven dependencies are downloaded with wrong classifier #677

Closed Mincol closed 5 years ago

Mincol commented 5 years ago

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 commented 5 years ago

is that in intellij ?

arnaudroger commented 5 years ago

is check https://github.com/arnaudroger/SimpleFlatMapper/issues/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 commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

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