DiUS / java-faker

Brings the popular ruby faker gem to Java
http://dius.github.io/java-faker
Other
4.77k stars 851 forks source link

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

Open dianbaiyizhong opened 1 year ago

dianbaiyizhong commented 1 year ago

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:

bodiam commented 1 year ago

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

luisangelorjr commented 1 year ago

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

kaperusov commented 9 months ago

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.