Creating a Free-Form Project


  1. Choose File | New Project.

  2. Select a project category (such as General, Web, or Enterprise) and then select the With Existing Ant Script template for that category.

  3. In the Name and Location page of the wizard, fill in the Location field with the folder that contains the various elements of your project, such as your source folder, test folder, and build script.

    If the build script is at the top level of the folder that you have specified, the rest of the fields are filled in automatically. If the build script is not found, fill in the Build Script field manually.

    Note that for NetBeans IDE 5.0, the folder for your compiled classes should also be in this folder. If it isn't, some editing features, such as refactoring, might not work correctly. This should be fixed in a later IDE release.

    If you wish, you can change the other fields, such as Project Folder (which determines where the IDE stores metadata for the project).

  4. In the Build and Run Actions page, specify targets for the listed IDE commands so that the IDE knows which target in your script to run when you choose the command in the IDE. You can click the combo box arrow next to each command to select from a list of all targets in the build script, or you can type a target in the combo box manually. If the IDE finds a likely target for the command, it is filled in automatically, although you can change it if you like. If you leave any of the commands blank, you can later fill them in manually outside of the wizard.

    If the build script imports targets from other build scripts, those targets are not shown in the combo box list, although you can type one of those targets manually.

    Not all available IDE commands are given here. You can provide mappings for other IDE commands (such as Compile File) directly in the project.xml file. See Mapping a Target to an IDE Command later in this chapter.

  5. (For Web projects only) In the Web Sources page, specify the folder that contains your web pages, fill in the context path for the application, and mark the J2EE Specification level.

  6. In the Source Package Folders page, specify all of the folders that contain your top-level packages. For example, if the package structure of one of your source roots begins with com, choose the folder that contains com (such as src).

    Similarly, if you have any test packages, you can specify them here in the Test Package Folders area.

    On this page, also be sure to set the Source Level to the appropriate JDK version. Even if this is already accounted for in your Ant script, you need to set the source level here so that IDE-specific features, such as proper Source Editor syntax highlighting and code completion, work correctly.

  7. In the Java Sources Classpath page (and, for Web projects, also in the Web Sources Classpath page), specify any libraries or sources that each source root is compiled against. Doing this hooks up IDE features such as code completion and refactoring to your project. You do not have to specify the JDK on this page.

Most of the fields in the template wizard are also editable in the Project Properties dialog box, so you do not have to fill in each value immediately. For example, if you still have to write a target for an IDE command, you can later map the target to the command in the Build and Run page of the Project Properties dialog box. To open the Project Properties dialog box, open the Projects window, right-click the project's main node, and choose Properties.




NetBeans IDE Field Guide(c) Developing Desktop, Web, Enterprise, and Mobile Applications
NetBeans IDE Field Guide(c) Developing Desktop, Web, Enterprise, and Mobile Applications
ISBN: N/A
EAN: N/A
Year: 2004
Pages: 279

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net