I've found and corrected the problem in the plugin and submitted a pull request.

Cf. https://github.com/openjfx/javafx-gradle-plugin/pull/15


Best regards,

/Lennart Börjeson

> 3 dec. 2018 kl. 11:12 skrev Lennart Börjeson <lenbo...@gmail.com>:
> 
> Is this the right place to ask questions on the gradle plugin 
> (org.openjfx.javafxplugin) ?
> 
> I'm trying to migrate to Java 11 and openjfx. I have a gradle setup with 
> multiple projects, which seems to be problematic.
> 
> Base: Mostly non-GUI, code but still some references to javafx
> GUI: The javafx GUI, depends on Base
> Release: Release artefact packaging, depends on both Base and GUI.
> 
> The basic problem seems to be I can't use the org.openjfx.javafxplugin in a 
> project which another projects depends on, since the plugin apparently 
> injects the javafx library artefacts *after" the configuration phase.
> 
> 
> The relevant section of my build.gradle in the Base project is:
> 
> 
> ---BEGIN----------
> 
> plugins {
>  id 'java'
>  id 'maven'
>  id 'application'
>  id 'wrapper'
>  id 'eclipse'
>  id "me.champeau.gradle.jmh" version '0.4.6'
>  id 'org.openjfx.javafxplugin' version '0.0.5'
> }
> 
> javafx {
>    modules = [ 'javafx.controls' ]
> }
> 
> --END-------------
> 
> 
> If I remove the javafx section, the gradle can execute, but my project won't 
> build. :-(
> 
> (I can't resolve this by moving all javafx usage to the GUI project, since 
> the Release project (release artefact packaging) would still depend on GUI.)
> 
> 
> Cf. error below:
> 
> 
> 
> 
> 
> $ ./gradlew build
> 
>> Configure project :
> allProjects: Base: project.version=1.6.10-SNAPSHOT
> allProjects: GUI: project.version=1.6.10-SNAPSHOT
> allProjects: Release: project.version=1.6.10-SNAPSHOT
> 
>> Configure project :Base
> test: configure
> 
> FAILURE: Build failed with an exception.
> 
> * What went wrong:
> A problem occurred configuring project ':Base'.
>> Cannot change dependencies of configuration ':Base:compile' after it has 
>> been included in dependency resolution.
> 
> * Try:
> Run with --stacktrace option to get the stack trace. Run with --info or 
> --debug option to get more log output. Run with --scan to get full insights.
> 
> * Get more help at https://help.gradle.org
> 
> BUILD FAILED in 1s
> 

Reply via email to