Skip to content

An older jar is used instead of the one indicated in %%loadFromPOM #31

Closed
@r0x07k

Description

@r0x07k

While debugging the milvus-io/milvus-sdk-java#1040 issue I found out that JJava is using a random jar version for some reason.

Here is the reproduction:

%%loadFromPOM
    <dependency>
        <groupId>com.google.code.gson</groupId>
        <artifactId>gson</artifactId>
        <version>2.10.1</version>
    </dependency>

import com.google.gson.JsonElement;
import com.google.gson.JsonParser;

String jsonString = "{\"name\":\"John\", \"age\":30}";
// This method is available in Gson 2.8.6 and later
JsonElement jsonElement = JsonParser.parseString(jsonString);
System.out.println(jsonElement);

The error:

|   JsonElement jsonElement = JsonParser.parseString(jsonString);
cannot find symbol
  symbol:   method parseString(java.lang.String)

So, the 2.8.5 or older version is used in fact. The same code works fine if run as a normal Java SE application.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions