Version 7

    NOTE

    In the next major release (3.2) there will be a feature to add rule "natures" to an existing project, so the following advice is only needed for 3.0 versions.

     

    Author Andy Gerweck

    This is useful if you have exising projects, and want to add rule building/validation stuff so that your rules are built and validated in the background (just like if you created a new "rules" project).

     

    It's pretty easy to modify your Eclipse projects. I'm constantly finding

    plug-ins that add builders and natures to my project without offering a

    way to remove them.

     

    You just need to go edit the

    .project (and possibly|.classpath

    files) in the root of your project. They're both in a simple XML format.

     

    To add the JBoss Rules IDE into a project, you need to add this build

    command to

    projectDescription/buildSpec

    just after the existing commands.

            <buildCommand>
                <name>org.drools.ide.droolsbuilder</name>
                <arguments>
                </arguments>
            </buildCommand>
    

    To replicate the JBoss Rules IDE's behavior, you also need to add this

    line to your .classpath file to pull in the binary dependencies. If

    you add the JBoss Rules jars yourself you should skip this step. This

    isn't necessary for verifying your rules in the editor and generating

    Rete trees, but I'm not using any other features.

        <classpathentry kind="con" path="DROOLS/JBoss Rules"></classpathentry>
    

    Editing

    .classpath

    like this is often a better way to deal with a

    large CLASSPATH: the XML can be more efficient and useful than the GUI.

     

    Refreshing your project is adequate to pull in your changes.