Groovy Netbeans Platform RCP Application

Artur S <[email protected]>
Newsgroups gmane.comp.java.netbeans.modules.openide.devel
Message-ID <CAGW64fYDoRPAaHQRY58TLyFEoJ7cnUtvUnUZVKM6Pis_8+OgPw@mail.gmail.com>
Hello,



Im trying to integrate Groovy into my netbeans platform application, i
tried to follow the tutorial from Gj from the link
https://blogs.oracle.com/geertjan/entry/running_groovy_on_the_netbeans but
this tutorial is very outdated and doesn´t work anymore.



Then i modified the build.xml from my specific module to this:



<import file="nbproject/build-impl.xml"/>



    <taskdef name="groovyc"

             classpath="ext/groovy-all-2.4.7.jar"

             classname="org.codehaus.groovy.ant.Groovyc"/>



    <target name="-javac-init"
depends="build-init,-javac-init-nbjdk,-javac-init-bootclasspath-prepend,-javac-init-no-bootclasspath-prepend">

        <path id="cp">

            <pathelement path="${module.classpath}"/>

            <pathelement path="${cp.extra}"/>

        </path>

        <path id="processor.cp">

            <pathelement path="${module.processor.classpath}"/>

            <pathelement path="${cp.extra}"/>

        </path>

        <!--         Unlike ${module.classpath}, this does not use
publicPackageJarDir, since processors need not be in public packages.

        Also needs to include transitive dependencies. -->

        <mkdir dir="build/classes"/>

        <groovyc srcdir="src" destdir="build/classes/" >

            <classpath refid="cp"/>

        </groovyc>

    </target>



Basically what i have done is overwrited the target “-javac-init” wich is
default from the platform, extending it with the groovy compilation.



My groovy classes now are compiling and running, but i think i have some
problems in my classpath, first i need to add every module that i need into
the dependencies even if the module is already imported by reference (this
doesn´t happen just with java), but the main problem is that im trying to
use JavaFX into this groovy classes and im having the following error
during compilation:



org.codehaus.groovy.control.MultipleCompilationErrorsException: startup
failed:

General error during class generation: java.lang.NoClassDefFoundError:
Unable to load class javafx.scene.control.TextField due to missing
dependency javafx.scene.control.Control

java.lang.RuntimeException: java.lang.NoClassDefFoundError: Unable to load
class javafx.scene.control.TextField due to missing dependency
javafx.scene.control.Control

                at
org.codehaus.groovy.control.CompilationUnit.convertUncaughtExceptionToCompilationError(CompilationUnit.java:1089)

                at
org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1067)

                at
org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:591)

                at
org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:569)



Other classes from JavaFX compile fine but this one isn´t compiling, im
really dont know what to do. I already tried to create a library wrapper
from javafxrt.jar but it doesn´t help at all.



When i create a new netbeans project (not using platform) and use Groovy
with JavaFX it works fine but the compilation process is different and the
build logic is very complex to understand quickly.



Is someone already using netbeans platform with Groovy and can help me to
configure my build.xml in the right way, i think the problem really is with
my classpath.



Thanks.



Artur Carlos Hertel Sonnenhohl

Desenvolvimento de Software

Fone: +55 (47) 3276-7549

WEG Drives & Controls Automação Ltda

*http://www.weg.net <http://www.weg.net/>*
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.