Importing Artifact into Repository

The Import Artifact into Repository feature installs any artifact into the specified local or remote repository.

To import an artifact:

  1. In the Import wizard from File > Import, expand Maven 2 options.
  2. Select Artifact into repository.
  3. Click Next.

    This window displays:

  4. Supply the necessary values for the Group ID, Artifact ID, Version, Packaging, Classifier, and the location of the File.
  5. Click Next, to configure to which repository to put the artifact. Or, click Finish to put the artifact to the default local repository.

Setting Preferences and Properties

The Eclipse Integration plugin uses the Eclipse Preferences page to let you set both global and archetype (per-project) preferences that remain in place for all (and future) Eclipse executions until you change them again. Global preferences you can set include whether you want to download source and JavaDocs or work offline, while the archetype preference lets you specify a new archetype source list URL for a project. The following sections contain instructions for setting the global preferences, as well as setting, editing, and deleting new archetype source list URLs.

Setting Global Preferences

  1. From the Eclipse main menu, select Window > Preferences to display the Eclipse Preferences window.
  2. In the left part of the window, click to highlight Maven, which causes the Maven preference options to appear in the right side of the window.

    Note: If you double-click to expand Maven, Archetype Preference, Artifact Search, and Maven Profiles appears below it as shown in Figure 23. Archetype Preference option lets you set Archetype preferences, as explained in the section entitled, Setting, Editing, and Deleting Archetype List URL Preferences.

    The following table describes each of the available Maven Preference options:

    Maven Preference Options

    Maven Preference Option Description
    Archetype Page Connection Timeout (milliseconds) Sets the span of time allowed to establish a connection to the archetype page.
    Global settings XML Uses the setting configurations for all the users. Settings explicitly set are picked up and used.
    User settings XML Uses the setting configurations for a specific user.
    Execute Recursively Executes the Maven goals of the parent and child projects recursively.
    Work offline Allows you to work offline on a project.
    Download sources Automatically downloads the sources for the project.

    Note: If you want to edit the settings.xml, click Edit found beside the Browse... button of the specific settings.xml (Global settings XML or User settings XML).

  3. To select a preference, simply click the box in front of it.
  4. When you are finished selecting preferences, click Apply, then OK to save them.

    Note: If you want to restore to the default preferences at any time, follow these instructions to display the Maven preferences, then click on the Restore Defaults button. After that, click Apply and OK to put the restored preferences in place.

Setting, Editing, and Deleting Archetype List URL Preferences

Through the Eclipse Integration Preferences page, you can add, edit, or delete a new archetype list source URL for a project, overriding the existing archetype metadata source. You can also specify the type of archetype list source (for example, WIKI, or Archetype Catalog).

Setting Archetype List URL Preferences

To specify a new archetype list source:

  1. From the Eclipse main menu, select Window > Preferences to display the Eclipse Preferences window.
  2. In the left part of the window, double-click to expand Maven. This displays Archetype Preference in the list below Maven, along with the corresponding input page on the right side of the window.
  3. Select the Maven archetype plugin version to use.
  4. Click on the New button, which displays the input screen for the new archetype name and type.
  5. Type the name for the new archetype list provider into the Name field.
  6. Use the pull-down in the bottom field to specify the Type.
  7. Click Next.
  8. In the pop-up window, configure the new archetype by filling the necessary fields.
  9. Click on Finish, which adds the new archetype list source to the Archetype Preference page.
  10. Repeat the input process for any additional archetypes.
  11. Click on OK to apply the new preference and override the existing metadata source and exit the Preferences page.