0

pom.xml

<project>
    <modelVersion>4.0.0</modelVersion>
    <groupId>mygroup</groupId>
    <artifactId>configtest</artifactId>
    <version>1</version>
    <profiles>
        <profile>
            <id>win</id>
            <dependencies>
                <dependency>
                    <groupId>org.openjfx</groupId>
                    <artifactId>javafx-controls</artifactId>
                    <version>19</version>
                    <classifier>win</classifier>
                </dependency>
            </dependencies>
        </profile>
        <profile>
            <id>mac</id>
            <dependencies>
                <dependency>
                    <groupId>org.openjfx</groupId>
                    <artifactId>javafx-controls</artifactId>
                    <version>19</version>
                    <classifier>mac</classifier>
                </dependency>
            </dependencies>
        </profile>
    </profiles>
</project>

Jars received:

enter image description here

THE PROBLEM:

Even though I used platform classifiers for both of my profiles, some transitive dependencies can't can't properly resolved. For example, I got win version of javafx-base and empty version instead of mac one, same with javafx-graphics. Any idea how to solve this?

Iks Ski
  • 370
  • 1
  • 5
  • 19
  • Why use classifiers? If you don't supply them, then the appropriate classified version for your build environment will be used. If you are using them because you want to create an unrecommended [shaded jar with JavaFX](https://stackoverflow.com/questions/52653836/maven-shade-javafx-runtime-components-are-missing), then you probably need to include explicit dependencies in your project for the classified versions of the transitive JavaFX dependencies. – jewelsea Oct 16 '22 at 20:24
  • Additional off-topic comment: the mac classifier is only for intel macs, for m series mac you need another classifier, (see comments on linked answer). – jewelsea Oct 16 '22 at 20:24
  • @jewelsea I'm developing an application that supports Windows, Mac and Linux. Isn't the classifier approach appropriate if I want to build 3 separated OS-specific application jars? Is there easier way I'm missing? – Iks Ski Oct 16 '22 at 20:45
  • I guess what was missing was the context of what you are trying to accomplish, *“I want to build 3 separated OS-specific application jars”* which you have now added as a comment. [jdeploy](https://www.jdeploy.com/) might be an alternative, or you can run unclassified builds on the different platforms if you have the machines (probably also with jlink or jpackage). Some packaging info is in the [JavaFX tag](https://stackoverflow.com/tags/javafx/info). These kinds of questions are tricky to answer fully in the context of StackOverflow. – jewelsea Oct 16 '22 at 21:03

0 Answers0