Typhon0 / AnimateFX

A library of +70 ready-to-use animations for JavaFX
Apache License 2.0
451 stars 66 forks source link

Version 1.2.2 mixes javafx versions #24

Closed 41zu closed 2 years ago

41zu commented 2 years ago

Description

I upgraded this dependency with maven from version 1.2.1 to 1.2.2 and noticed that it adds javafx 17 dependencies to the project. Here are pictures displaying the used dependencies in eclipse: With 1.2.1: https://www.dropbox.com/s/tz57vfr8xbzwnz6/2022-05-28_00-20.png?dl=0 With 1.2.2: https://www.dropbox.com/s/075r8twx6qh57iy/2022-05-28_00-22.png?dl=0

To be exact: It changes javafx-base from javafx-base-18-linux.jar to javafx-base-17-linux.jar and adds javafx-web-17-linux.jar, because I don't use javafx-web.

This results that at startup of the application I get the following warning because of this: Mai 28, 2022 12:31:16 AM javafx.fxml.FXMLLoader$ValueElement processValue WARNUNG: Loading FXML document with JavaFX API of version 18 by JavaFX runtime of version 17 Mai 28, 2022 12:31:17 AM javafx.fxml.FXMLLoader$ValueElement processValue WARNUNG: Loading FXML document with JavaFX API of version 18 by JavaFX runtime of version 17

Then I checked the AnimateFX on mvnrepository (https://mvnrepository.com/artifact/io.github.typhon0/AnimateFX/1.2.2) and saw that it added javafx 17 dependencies as runtime dependencies. In contrast version 1.2.1 doesn't specify any dependencies.

Reproduces how often: always

System Information (please complete the following information):

41zu commented 2 years ago

Addition:

The reason, why my javafx-base package was downgraded down to version 17, was because I didn't specify the javafx-base dependency explicitly in the pom and you can actually exclude dependencies if you don't want them like this, but it is not a nice solution.

                <dependency>
            <groupId>io.github.typhon0</groupId>
            <artifactId>AnimateFX</artifactId>
            <version>1.2.2</version>
            <exclusions>
                <exclusion>
                    <groupId>org.openjfx</groupId>
                    <artifactId>javafx-web</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

I still hope this problem gets resolved somehow.

Typhon0 commented 2 years ago

@41zu

Hi,

Can you test it with the latest snapshot version ? The javafx dependencies are now "compileOnly" and there is no more javafx as runtime dependencies.

Thanks

41zu commented 2 years ago

Yes, that fixes the problem. Thank you.

But I would suggest the following solution:

I also cloned this repository and checked what dependencies you need. You actually only need javafx.base, javafx.controls and javafx.graphics. But javafx.graphics is an dependency of javafx.controls and javafx.base is an dependency of javafx.graphics. So you actually only need "modules = ['javafx.controls']". And if somebody is overriding javafx.controls in its pom, it will not pull the wrong version of the javafx-modules.

41zu commented 2 years ago

Will you release a fixed version to maven central?