Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove OpenJFX dependencies while publishing to mvncentral #116

Closed
wants to merge 1 commit into from

Conversation

rnayabed
Copy link

@rnayabed rnayabed commented Nov 2, 2021

Currently when you add the project as a dependency to any maven project, you get the following IDE error:

image

This is happening because the dependency MaterialFX is providing javafx dependencies, that should not be happening. Hence a workaround I am using is to add the following exclusions in my pom.xml:

<dependency>
  <groupId>io.github.palexdev</groupId>
  <artifactId>materialfx</artifactId>
  <version>${materialfx.version}</version>
  <exclusions>
    <exclusion>
       <groupId>org.openjfx</groupId>
       <artifactId>javafx-graphics</artifactId>
    </exclusion>
    <exclusion>
      <groupId>org.openjfx</groupId>
      <artifactId>javafx-controls</artifactId>
    </exclusion>
    <exclusion>
       <groupId>org.openjfx</groupId>
       <artifactId>javafx-base</artifactId>
    </exclusion>
    <exclusion>
      <groupId>org.openjfx</groupId>
      <artifactId>javafx-swing</artifactId>
    </exclusion>
  </exclusions>
</dependency>

This PR removes the OpenJFX dependencies before publishing, hence solving the issue.

@palexdev
Copy link
Owner

palexdev commented Nov 2, 2021

Wow this is awesome I didn't know you could do that
Thank you very much for this contribution, I'll merge it before releasing the next version 👍🏻

@rnayabed
Copy link
Author

rnayabed commented Nov 2, 2021

No issues. Although i really recommend testing it once yourself if you dont mind. ^^

Thank you for your awesome project. I am currently using your controls in Stream-Pi project.

@palexdev
Copy link
Owner

palexdev commented Nov 2, 2021

No issues. Although i really recommend testing it once yourself if you dont mind. ^^

Thank you for your awesome project. I am currently using your controls in Stream-Pi project.

Yep, I'll test it, don't worry

Great! Awesome project, I really like the modular and flexible architecture too, nice job.
Let me know if you need any particular features or control for your project

Also, I was wandering, I'd like to add a "Projects using MaterialFX" section in the README.md, would it be ok for you if I added Stream-PI to the list?

@rnayabed
Copy link
Author

rnayabed commented Nov 2, 2021 via email

@rnayabed
Copy link
Author

Any updates? @palexdev

@palexdev
Copy link
Owner

@rnayabed sorry I forgot to also reply to your last comment

Any updates? @palexdev

Yes and no.
Yes because I may have found another solution to the issue, see here StackOverflow, but I need to test it of course

No because I don't think the fix will be implemented any time soon, I'm planning to release it with version 11.13.0 of the library but while the development is proceeding really well it still needs a lot of work (see the projects tab)
Also, check the staging branch for all the news of version 11.13.0

The combo box has been remade too and I can assure you it has nothing to envy to the original one

@rnayabed
Copy link
Author

Yeah i checked it. Looks like a far better option. This looks very "hacky-ish".

I will close this PR then.

combo box
Great. Nice to see it being updated!

@rnayabed rnayabed closed this Nov 28, 2021
palexdev added a commit that referenced this pull request Dec 1, 2021
Project
:arrow_up: Upgraded JavaFX to 17.0.1
:arrow_up: Upgraded VirtualizedFX to 11.2.3
:recycle: Make JavaFX dependencies transitive as a consequence/request of PR #116

Controls Package
:boom: AbstractMFXToggleNode, MFXCircleToggleNode, MFXRectangleToggleNode have been reworked
:recycle: MFXTextField whoops
:recycle: MFXPopup, adapt to new changes of MFXCSSBridge

CSS Package
:truck: Renamed and moved CSSBridge to separate class

Skins Package
:boom: MFXCircleToggleNodeSkin and MFXRectangleToggleNodeSkin have been slightly changed too

Resources
:boom: MFXCircleToggleNode.css, MFXRectangleToggleNode.css have been reviewed too

:fire: Completed the removal of MFXLabel

Signed-off-by: palexdev <alessandro.parisi406@gmail.com>
@palexdev
Copy link
Owner

palexdev commented Jan 29, 2022

@rnayabed MaterialFX reached v11.13.0 and I implemented the requested fix
Can you test it please if you are still interested?

@Glavo
Copy link
Contributor

Glavo commented Mar 29, 2022

@palexdev I started trying MaterialFX 11.13.3 today, but I noticed that it still brings a transitive dependency on OpenJFX.

image

Here's its POM, which obviously still depends on OpenJFX:

POM
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <!-- This module was also published with a richer model, Gradle metadata,  -->
  <!-- which should be used instead. Do not delete the following line which  -->
  <!-- is to indicate to Gradle or any Gradle module metadata file consumer  -->
  <!-- that they should prefer consuming it instead. -->
  <!-- do_not_remove: published-with-gradle-metadata -->
  <modelVersion>4.0.0</modelVersion>
  <groupId>io.github.palexdev</groupId>
  <artifactId>materialfx</artifactId>
  <version>11.13.3</version>
  <name>materialfx</name>
  <description>Material Desgin components for JavaFX</description>
  <url>https://github.com/palexdev/MaterialFX</url>
  <inceptionYear>2020</inceptionYear>
  <licenses>
    <license>
      <name>GNU LGPLv3</name>
      <url>https://www.gnu.org/licenses/gpl-3.0.html</url>
      <distribution>repo</distribution>
    </license>
  </licenses>
  <developers>
    <developer>
      <id>palexdev</id>
      <name>Alessandro Parisi</name>
      <url>https://github.com/palexdev</url>
    </developer>
  </developers>
  <scm>
    <url>https://github.com/palexdev/MaterialFX</url>
  </scm>
  <dependencies>
    <dependency>
      <groupId>org.openjfx</groupId>
      <artifactId>javafx-base</artifactId>
      <version>17.0.2</version>
      <classifier>linux</classifier>
      <scope>runtime</scope>
    </dependency>
    <dependency>
      <groupId>org.openjfx</groupId>
      <artifactId>javafx-media</artifactId>
      <version>17.0.2</version>
      <classifier>linux</classifier>
      <scope>runtime</scope>
    </dependency>
    <dependency>
      <groupId>org.openjfx</groupId>
      <artifactId>javafx-swing</artifactId>
      <version>17.0.2</version>
      <classifier>linux</classifier>
      <scope>runtime</scope>
    </dependency>
    <dependency>
      <groupId>org.openjfx</groupId>
      <artifactId>javafx-controls</artifactId>
      <version>17.0.2</version>
      <classifier>linux</classifier>
      <scope>runtime</scope>
    </dependency>
    <dependency>
      <groupId>org.openjfx</groupId>
      <artifactId>javafx-web</artifactId>
      <version>17.0.2</version>
      <classifier>linux</classifier>
      <scope>runtime</scope>
    </dependency>
    <dependency>
      <groupId>org.openjfx</groupId>
      <artifactId>javafx-fxml</artifactId>
      <version>17.0.2</version>
      <classifier>linux</classifier>
      <scope>runtime</scope>
    </dependency>
    <dependency>
      <groupId>org.openjfx</groupId>
      <artifactId>javafx-graphics</artifactId>
      <version>17.0.2</version>
      <classifier>linux</classifier>
      <scope>runtime</scope>
    </dependency>
    <dependency>
      <groupId>com.vanniktech</groupId>
      <artifactId>gradle-maven-publish-plugin</artifactId>
      <version>0.19.0</version>
      <scope>runtime</scope>
    </dependency>
    <dependency>
      <groupId>io.github.palexdev</groupId>
      <artifactId>virtualizedfx</artifactId>
      <version>11.2.5</version>
      <scope>runtime</scope>
    </dependency>
  </dependencies>
</project>

I am developing on Windows and these dependencies are obviously not supposed to be since they are OpenJFX for the Linux platform.

Of course, I'm using Gradle, so it's easy to exclude these dependencies, but I want to ask when will this be completely resolved.

@palexdev
Copy link
Owner

palexdev commented Mar 29, 2022

@Glavo
Don't use that POM, I sincerely don't know why Maven generates that POM

On the README and on Maven Central the correct snippet is:

<dependency>
    <groupId>io.github.palexdev</groupId>
    <artifactId>materialfx</artifactId>
    <version>11.13.3</version>
</dependency>

@Glavo
Copy link
Contributor

Glavo commented Mar 29, 2022

@Glavo Don't use that POM, I sincerely don't know why Maven generates that POM

On the README and on Maven Central the correct snippet is:

<dependency>
    <groupId>io.github.palexdev</groupId>
    <artifactId>materialfx</artifactId>
    <version>11.13.3</version>
</dependency>

I imported it like this in Gradle (Kotlin DSL):

implementation("io.github.palexdev:materialfx:11.13.3")

I believe this is functionally equivalent to what you said, but it uses this POM and brings in dependencies it shouldn't have.

However, this problem is very easy to solve because the JavaFX Gradle plugin provides an easy way to configure it.

@Glavo
Copy link
Contributor

Glavo commented Mar 29, 2022

@palexdev I opened a PR for this issue, can you take a look at #168?

@palexdev
Copy link
Owner

@palexdev I opened a PR for this issue, can you take a look at #168?

Yep 👍

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.

None yet

3 participants