IDE integration

Your [fleXive] project comes with basic project files for the Eclipse and IntelliJ IDEA Java IDEs.

If this is your first Eclipse project with [fleXive], first you have to define a new user library that includes the JAR files of your [fleXive] distribution. We also could include these files in the individual project classpath, but this way is much cleaner and easier to work with especially for multiple projects.

  1. Please go to WindowPreferencesJavaBuild PathUser Libraries.

  2. Click New... and enter flexive for the library name. Press OK.

  3. Select the created library entry, and press the Add JARs... button.

  4. Go to your [fleXive] distribution directory, and select all JAR files in the lib/ folder (you can use shift-select here).

  5. Repeat the last two steps and add all JAR files of the extlib/ folder and the flexive-plugin-jsf-core.jar from the applications/ folder to the user library.

  6. In the User Libraries page, click OK. You have now defined a global flexive library that includes all required JAR files for a [fleXive] application. Note that this is only available within the IDE, the actual build files do not use the IDE-specific library definitions.

Assuming that both your flexive-dist directory and the newly created project reside in your current Eclipse workspace directory, you can add the project following these steps:

  1. Open FileImport...+GeneralExisting Projects into Workspace

  2. Select the project root directory.

  3. Press Finish. Eclipse should now open the project in the workspace. To build the project EAR file using Ant, execute ProjectBuild all.

    To check if the project and library has been loaded correctly, try to open the EJBExampleBean class using NavigationOpen Type... ( Shift+Ctrl+T ) Eclipse should display the source code without errors.

We start with creating a new project for the flexive-test application directory.

  1. Open FileNew Project...

  2. Select Create project from scratch and press Next.

  3. Choose your [fleXive] project directory in Project file location.

  4. Click Next.

  5. Uncheck Create module and click Finish.

Let IDEA open the project. Next we add the template module file in the IDEA project settings dialog:

  1. Add a new module by clicking on the "+" button at the top of the screen.

  2. Choose Import existing module and select the IDEA module file (flexive-test.iml) in your project directory.

  3. Press Finish.

If this is your first IntelliJ IDEA project with [fleXive], please perform the following setup steps. Similar to Eclipse, we use a shared library definition to include [fleXive] in the project classpath.

  1. Open FileSettings

  2. Click on Project settings.

  3. On the left-hand-side, click on Platform settingsGlobal Libraries

  4. Add a new library by clicking on the "+" button at the top of the screen. Enter flexive-dist as the library name.

  5. Select your project module in the next screen and press OK.

  6. In the library overview screen, select the flexive-dist library and add the flexive-dist/applications, flexive-dist/lib and flexive-dist/extlib directories using the Attach JAR directories button.

Now you should have all [fleXive] classes available in your project. You can test this by opening the example EJB ( EJBExampleBean) using Go ToClass... ( Ctrl+N ) IDEA should not display any errors like missing classes.