jpmml / jpmml-sklearn

Java library and command-line application for converting Scikit-Learn pipelines to PMML
GNU Affero General Public License v3.0
531 stars 117 forks source link

Maven `jpmml-sklearn` import error. Cannot resolve `org.jpmml:jpmml-sklearn:x.x.x` #190

Closed kavicastelo closed 10 months ago

kavicastelo commented 10 months ago

I got a problem when installing the jpmml-sklearn dependency for my maven project. I tried to add diffrent kind of versions but got the same error. Here is the latest one.

<dependency>
    <groupId>org.jpmml</groupId>
    <artifactId>jpmml-sklearn</artifactId>
    <version>1.7.45</version>
</dependency>

Dependency downloaded successfully. But cannot resolve.

Here is the error log.

[ERROR] Failed to execute goal on project air_quality: Could not resolve dependencies for project com.api:air_quality:jar:0.0.1-SNAPSHOT: The following artifacts could not be resolved: org.jpmml:jpmml-sk
learn:jar:1.7.45 (absent): org.jpmml:jpmml-sklearn:jar:1.7.45 was not found in https://repo.maven.apache.org/maven2 during a previous attempt. This failure was cached in the local repository and resoluti
on is not reattempted until the update interval of central has elapsed or updates are forced -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal on project air_quality: Could not resolve dependencies for project com.api:air_quality:jar:0.0.1-SNAPSHOT: The following art
ifacts could not be resolved: org.jpmml:jpmml-sklearn:jar:1.7.45 (absent): org.jpmml:jpmml-sklearn:jar:1.7.45 was not found in https://repo.maven.apache.org/maven2 during a previous attempt. This failure
 was cached in the local repository and resolution is not reattempted until the update interval of central has elapsed or updates are forced
vruusmann commented 10 months ago

The JPMML-SkLearn project was modularized when transitioning from 1.6.X to 1.7.X (happened ~two years ago, in January of 2022).

The org.jpmml:jpmml-sklearn artifact now refers to the abstract main/parent module; it serves as an umbrella/coordinator for concrete child modules.

There is no point in importing the org.jpmml:jpmml-sklearn dependency into a third-party software project, because it only provides a project description POM file, and no actual library JAR files.

You want to be including the org.jpmml:pmml-sklearn dependency instead (note the missing "j" prefix to the artifactId part of the coordinate). And, if you want to use LightGBM, XGBoost etc. integrations, then you should also be including the respective org.jpmml:pmml-sklearn-lightgbm, org.jpmml:pmml-sklearn-xgboost, etc. dependencies.