java-faker icon indicating copy to clipboard operation
java-faker copied to clipboard

由于snakeyaml版本较低,和jackson-databind一起用会报错Could not find snakeyaml-2.0-a…

Open dianbaiyizhong opened this issue 2 years ago • 3 comments

Could not find snakeyaml-2.0-android.jar (org.yaml:snakeyaml:2.0). Searched in the following locations: https://maven.aliyun.com/repository/public/org/yaml/snakeyaml/2.0/snakeyaml-2.0-android.jar

Possible solution:

  • Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html

dianbaiyizhong avatar Jun 23 '23 13:06 dianbaiyizhong

Please use https://github.com/datafaker-net/datafaker instead

bodiam avatar Oct 10 '23 22:10 bodiam

Yes @bodiam , before your reply I already using DataFaker. Thanks : )

luisangelorjr avatar Oct 10 '23 23:10 luisangelorjr

You can fix this by explicitly specifying a classifier for snakeyaml:

    testImplementation 'org.yaml:snakeyaml:1.26:android'
    testImplementation 'com.github.javafaker:javafaker:1.0.2'

But that leaves a problem with the old version of snakeyaml and its vulnerabilities: -> https://mvnrepository.com/artifact/org.yaml/snakeyaml/1.26

Not sure why the author needed this classifier in pom.xml:

        <dependency>
            <groupId>org.yaml</groupId>
            <artifactId>snakeyaml</artifactId>
            <version>1.26</version>
            <classifier>android</classifier>
        </dependency>

The java-faker builds fine and passes all tests with this dependency:

        <dependency>
            <groupId>org.yaml</groupId>
            <artifactId>snakeyaml</artifactId>
            <version>2.2</version>
        </dependency>

But apparently the project is dead. The author hasn't accepted Pull Requests for a long time.

kaperusov avatar Feb 07 '24 11:02 kaperusov