Closed arnobl closed 7 months 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.
Damn, I think that was an obvious mistake on my part. I will try and fix it going forward.
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.
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.
I wonder how this build passes (headless, Java 11, Linux) given this issue report.
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.
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!
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?
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.
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.
The latest released version 12.0.1+2 was just released and should be cross-platform.
Is that possible to push v12 on maven central to test that?
Will sync now.
Closing this issue since new builds were posted for JFX 11 and 17: https://central.sonatype.com/artifact/org.testfx/openjfx-monocle/versions
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 provideswin
,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.