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

Java dependencies issue #9797

Closed
xtello opened this issue Nov 20, 2023 · 2 comments
Closed

Java dependencies issue #9797

xtello opened this issue Nov 20, 2023 · 2 comments

Comments

@xtello
Copy link

xtello commented Nov 20, 2023

Hello,

I'm trying to use XGBoost in our Java app (Java 17) using Maven (i initially needed to use Gradle but the issue is worse there). When i build, i get the error:

Could not resolve dependencies for project com.example:test-maven:jar:1.0-SNAPSHOT: Failed to collect dependencies at ml.dmlc:xgboost4j_2.13:jar:2.0.2: Failed to read artifact descriptor for ml.dmlc:xgboost4j_2.13:jar:2.0.2: The following artifacts could not be resolved: ml.dmlc:xgboost-jvm_${scala.binary.version}:pom:2.0.2 (absent): ml.dmlc:xgboost-jvm_${scala.binary.version}:pom:2.0.2 was not found in https://repo.maven.apache.org/maven2

Maven config i use:

    <properties>
        <scala.binary.version>2.13</scala.binary.version>
        <!--  <scala.binary.version>2.11</scala.binary.version>-->
    </properties>

    <dependencies>
        <dependency>
            <groupId>ml.dmlc</groupId>
            <artifactId>xgboost4j_${scala.binary.version}</artifactId>
            <version>2.0.2</version>
            <!--  <version>1.1.2</version>  builds with scala binary 2.11 but dynamic lib NOT built for Apple silicon  -->
        </dependency>
        <dependency>
            <groupId>ml.dmlc</groupId>
            <artifactId>xgboost4j-spark_${scala.binary.version}</artifactId>
            <!--  <version>1.1.2</version>-->
            <version>2.0.2</version>
        </dependency>
    </dependencies>

The issue seems to be in https://repo.maven.apache.org/maven2/ml/dmlc/xgboost4j_2.13/2.0.2/xgboost4j_2.13-2.0.2.pom where the Maven can't seem to expand variable ${scala.binary.version} in this external POM even if i declare it in my POM
image

Thanks in advance!
Xavier

@pk044
Copy link

pk044 commented Nov 27, 2023

Same problem with SBT on Scala 2.13. Using version 2.1.0-SNAPSHOT fixed it (although I still had to exclude some transitive 2.12 dependencies).

@hcho3
Copy link
Collaborator

hcho3 commented Dec 19, 2023

The issue has been fixed in the latest patch release (2.0.3).

@hcho3 hcho3 closed this as completed Dec 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants