-
Notifications
You must be signed in to change notification settings - Fork 59
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
Overload javafx:run goal to work with JavaFX 17 #136
Conversation
@@ -44,7 +44,7 @@ | |||
import static org.openjfx.model.RuntimePathOption.CLASSPATH; | |||
import static org.openjfx.model.RuntimePathOption.MODULEPATH; | |||
|
|||
@Mojo(name = "run", requiresDependencyResolution = ResolutionScope.RUNTIME) | |||
@Mojo(name = "runx", requiresDependencyResolution = ResolutionScope.RUNTIME) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a TODO
to restore the name, once fix is not longer required?
@@ -55,6 +56,7 @@ | |||
import static org.mockito.Mockito.mock; | |||
import static org.mockito.Mockito.when; | |||
|
|||
@Ignore |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test works with fine, but needs runx
:
JavaFXRunMojo mojo = (JavaFXRunMojo) lookupMojo("runx", testPom);
Great work @abhinayagarwal! However I have found 2 issues that I comment below. 1. Custom
|
@betanzos I have pushed a fix for the settings file. For the IntelliJ IDEA issue, I cannot reproduce the issue. If I use the platform Maven in IntelliJ IDEA, everything seems to work fine. However, if I use the bundled Maven, I am hit by https://youtrack.jetbrains.com/issue/IDEA-139236. Once I provide executable permission to mvn, everything works fine. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
works for me
In case it turns out to be an issue, we can create a follow-up issue. For now, this PR is good to be merged. |
@abhinayagarwal this is fixed!
Using both an external and bundled Maven I get the same error. This only happens when I don't have defined the |
This reverts commit 88781ed.
This is a hack to make sure that Maven application don't fail with JavaFX 17.
Since there is no way to update the dependency list after its creation in MavenProject, we had to resort for the creation of a new Mojo:
JavaFXRunFixMojo
which will be called forjavafx:run
. This new Mojo will then create a new pom.xml which will add classifiers to the JavaFX dependencies and exclude all JavaFX transitive dependencies.For example, a dependency for
javafx-controls
onlinux
, will be available as the following in the new modified pom:We will then call the existing,
JavaFXRunMojo
with this new pom.Since 2 Mojo's cannot have the same name, the name for
JavaFXRunMojo
has been updated torunx
.This has been tested against the following Applications:
Modular
Non-Modular