Skip to content

Conversation

@Siedlerchr
Copy link
Member

@Siedlerchr Siedlerchr commented Nov 18, 2025

  • Prepare maven central
  • Re-Add tests
  • add changelog
  • Downgrade JavaFX version, probably to 21 for maxium compat.

@koppor
Copy link
Member

koppor commented Nov 19, 2025

We need to change the LICENSE (our file in the root repository) to Apache 2.0 (because of the code coming in - and we don't want to maintain multiple licenses) -

@Siedlerchr
Copy link
Member Author

Siedlerchr commented Nov 22, 2025

Resolution ambiguation, so the mapping is not applied..

 Could not resolve all dependencies for configuration ':mvvmfx-validation:compileClasspath'.
   > Could not resolve org.openjfx:javafx-base.
     Required by:
         project ':mvvmfx-validation'
      > The consumer was configured to find a library for use during compile-time, compatible with Java 24, packaged as a jar, preferably optimized for standard JVMs, and its dependencies declared externally, as well as attribute 'javaModule' with value 'true'. However we cannot choose between the following variants of org.openjfx:javafx-base:24:
          - compile
          - linux-aarch64Compile
          - linuxCompile
          - mac-aarch64Compile
          - macCompile
          - winCompile
        All of them match the consumer attributes:
          - Variant 'compile' capability 'org.openjfx:javafx-base:24' declares a library for use during compile-time, packaged as a jar:
              - Unmatched attributes:
                  - Doesn't say anything about how its dependencies are found (required its dependencies declared externally)
                  - Doesn't say anything about its target Java environment (preferred optimized for standard JVMs)
                  - Doesn't say anything about its target Java version (required compatibility with Java 24)
                  - Doesn't say anything about javaModule (required 'true')
                  - Provides attribute 'org.gradle.native.architecture' with value 'none' but the consumer didn't ask for it
                  - Provides attribute 'org.gradle.native.operatingSystem' with value 'none' but the consumer didn't ask for it
                  - Provides release status but the consumer didn't ask for it
          - Variant 'linux-aarch64Compile' capability 'org.openjfx:javafx-base:24' declares a library for use during compile-time, packaged as a jar:

@Siedlerchr
Copy link
Member Author

Skipping 'org.openjfx:javafx-base' - no mapping - run ':analyzeModulePath' for more details

@Siedlerchr
Copy link
Member Author

@jjohannes May I ask for some help here? I have troubles with the javafx configuration. I copied, adjusted and verified the gradle plugin files etc and compared them with JabRef's setup but somehow the mapping is not found and this results in ambigous resolution of javafx. It's probably some simple stupid thing I overlooked, but I am unable to spot it. Any help would be appreciated 🙏

Copy link

@jjohannes jjohannes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Siedlerchr I took a look. With the changes below, it builds for me.

The main issue were the missing target(...) declarations.

id("org.gradlex.extra-java-module-info")
id("org.gradlex.jvm-dependency-conflict-resolution")
id("org.gradlex.java-module-dependencies") // only for mappings at the moment
}
Copy link

@jjohannes jjohannes Nov 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The main problem why it was not working is that you are missing the declaration of the targets you want to select when building. Even if you only build a Jar from this repo, Gradle needs to select one of the (target specific) JavaFX Jars. This may also be important if you want to run tests at some point.

Add the plugin: id("org.gradlex.java-module-packaging")

And then:

javaModulePackaging {
    target("ubuntu-22.04") {
        operatingSystem = OperatingSystemFamily.LINUX
        architecture = MachineArchitecture.X86_64
    }
    target("ubuntu-22.04-arm") {
        operatingSystem = OperatingSystemFamily.LINUX
        architecture = MachineArchitecture.ARM64
    }
    target("macos-15-intel") {
        operatingSystem = OperatingSystemFamily.MACOS
        architecture = MachineArchitecture.X86_64
    }
    target("macos-15") {
        operatingSystem = OperatingSystemFamily.MACOS
        architecture = MachineArchitecture.ARM64
    }
    target("windows-latest") {
        operatingSystem = OperatingSystemFamily.WINDOWS
        architecture = MachineArchitecture.X86_64
    }
}

(In this file or a separate ...targets.gradle.kts)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah thanks so much! I thought this was only relevant for jpackage.. 🤯

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it would be better to split that part into a separate plugin at some point on our side, because the plugin and configuration name is not very helpful here. You could do it differently without that particular plugin, but I would suggest to use the same approach here as in the JabRef repo for consistency.

This topic of what should be "the standard way" to solve this better in the future is currently discussed here:
gradle/gradle#34845

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I strongly agree with you! Thanks for the pointer. I hope that we get one of these options in the future.
PS: Thanks for your help! This was the perfect birthday gift for me today :)

Siedlerchr and others added 9 commits November 25, 2025 20:46
…base.dependency-rules.gradle.kts

Co-authored-by: Jendrik Johannes <[email protected]>
…base.dependency-rules.gradle.kts

Co-authored-by: Jendrik Johannes <[email protected]>
Co-authored-by: Jendrik Johannes <[email protected]>
…base.dependency-rules.gradle.kts

Co-authored-by: Jendrik Johannes <[email protected]>
Co-authored-by: Jendrik Johannes <[email protected]>
Co-authored-by: Jendrik Johannes <[email protected]>
…base.dependency-rules.gradle.kts

Co-authored-by: Jendrik Johannes <[email protected]>
@Siedlerchr Siedlerchr changed the title WIP project setup with mvvwx validation Project setup with mvvwx validation Nov 25, 2025
@koppor
Copy link
Member

koppor commented Nov 26, 2025

Can't login to SonaType - don't know why. Need to check these days.

plugins {
id("org.jabref.javafx.controls.gradle.base.repositories")
id("org.jabref.javafx.controls.gradle.feature.compile")
id("com.vanniktech.maven.publish") version "0.35.0"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A copy of that plugin is in the subproject

url.set("https://github.com/JabRef/org.jabref.javafx.controls//")
licenses {
license {
name.set("MIT")
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apache2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants