TestFX / Monocle

Pre-packaged builds of Monocle (OpenJFX)
GNU General Public License v2.0
49 stars 24 forks source link

Monocle jdk-11 on maven central for win only #64

Closed arnobl closed 7 months ago

arnobl commented 5 years ago

The Maven artefacts provided on Maven central are for Windows only: http://central.maven.org/maven2/org/testfx/openjfx-monocle/jdk-11+26/openjfx-monocle-jdk-11+26.pom The reason seems to be that the classifier of the dependencies is win, while OpenJFX 11 provides win, linux, mac: http://central.maven.org/maven2/org/openjfx/javafx-base/11/

I guess that the OpenJFX-Monocle pom should not explicitly refer to a classifier.

arnobl commented 5 years ago

Maybe the problem is in the gradle script. The classifier is explicitly used to compile the lib (does not compile if the classifiers are removed): https://github.com/TestFX/Monocle/blob/master/build.gradle#L65

and then Gradle use these dependencies, with the classifier, to build the pom.

brcolow commented 5 years ago

Damn, I think that was an obvious mistake on my part. I will try and fix it going forward.

brcolow commented 5 years ago

I am not sure if I understand completely how to rectify this. Monocle won't build without specifying a classifier, but specifying one locks in users of the library to also be on that platform? See another library that uses OpenJFX as a dependency, for example:

https://github.com/controlsfx/controlsfx/blob/9.0.0/controlsfx/build.gradle#L68

They also use the platform classifier. Let me ping @johanvos and see if he can suggest the correct way forward.

johanvos commented 5 years ago

You can build it on any platform, but if you publish, you should not add a classifier. Pinging @jperedadnr as he wrote some docs about it.

brcolow commented 5 years ago

I wonder how this build passes (headless, Java 11, Linux) given this issue report.

jperedadnr commented 5 years ago

We've been publishing some artifacts with JavaFX dependencies, but the key is to remove the classifier from the pom, otherwise you will be adding an undesired platform dependency.

One easy way to remove this classifier in the publishing task is by inspecting the dependencies and for those of groupID org.openjfx, just remove the dependency classifier like:

        pom.withXml {
                Node pomNode = asNode()
                pomNode.dependencies.'*'.findAll() {
                    it.groupId.text() == 'org.openjfx'
                }.each {
                    it.remove(it.classifier)
                }
            }

See for instance this task or this one (see published pom).

By the way, it is advisable to use the javafx-gradle-plugin in your builds, like here.

brcolow commented 5 years ago

That seems to have almost worked completely..but getting these warnings...are they anything to worry about?


Maven publication 'mavenJava' contains dependencies that will produce a pom file that cannot be consumed by a Maven client.
  - org.openjfx:javafx-graphics:12-ea+14 declared with a Maven incompatible version notation
  - org.openjfx:javafx-controls:12-ea+14 declared with a Maven incompatible version notation
  - org.openjfx:javafx-base:12-ea+14 declared with a Maven incompatible version notation

> Task :bintrayUpload

Thanks for the assistance thus far!

jperedadnr commented 5 years ago

You don't need to use the ea version. You can simply set 12.0.1.

As an aside, do you really want to set level 12? Maybe 11 is enough?

brcolow commented 5 years ago

Do you mean sourceCompatibility and targetCompatibility level? I was thinking that since this won't actually work without Java 12 (because of changes to upstream OpenJFX) it makes sense but that may have been short sighted.

jperedadnr commented 5 years ago

Since Java and JavaFX are not coupled anymore, with level 11 (for Java) you can run JavaFX 11 or 12, so I guess is not really necessary to set level 12. Though if you are targeting JavaFX 12, it would probably make sense to keep same level for Java as well.

brcolow commented 5 years ago

The latest released version 12.0.1+2 was just released and should be cross-platform.

arnobl commented 5 years ago

Is that possible to push v12 on maven central to test that?

brcolow commented 5 years ago

Will sync now.

mvsoder commented 7 months ago

Closing this issue since new builds were posted for JFX 11 and 17: https://central.sonatype.com/artifact/org.testfx/openjfx-monocle/versions