Eclipse plus Maven

From wiki.searchtechnologies.com
Jump to: navigation, search

For Information on Aspire 3.1 Click Here

This section covers some of the details of using Maven with Eclipse.

For trouble-shooting, see Eclipse/Maven problems.

Creating Install and Deploy Commands

Two very useful commands to create within Eclipse are the Maven Deploy and Maven Install commands.

Maven Install

Maven Install will install your Maven Artifact (typically an Aspire Component Jar) into your local repository so that it is easily accessible to all of your Maven Distribution projects.

To create a Maven Install command, do the following:

  1. Execute the menu command: Run/Run Configurations...
  2. Click on the "Maven Build" type and click on the "New" button (blank box with a yellow plus-sign on it at the top left of the Run Configurations dialog box).
  3. Make sure your dialog contains the following parameters:
    • Name: Maven Install
    • Base Directory: ${project_loc}
    • Goals: clean install
    • Skip Tests: Can be either on or off as you wish.
      • Some developers turn this off since they run Unit tests as they're creating the component. Once the component is complete and working correctly, be aware you'll have to wait for the tests to complete (sometimes they take a while) before installing the project.

If you have a very large component, this typically means that it contains many large embedded JAR files, then you may wish to do the following:

  1. Click on the "JRE" tab.
  2. Add the following to the VM arguments: -Xmx1024m

Finally, click on "Apply" and "Close".

Now, you can select your Maven Project within Eclipse and then choose "Install" to install the jar on your local Maven repository.

Maven Deploy

The purpose of Maven Deploy is to allow for deploying new components to the Search Technologies central repository. Note: You must have read/write access to the Search Technologies Maven Repository before you can deploy artifacts to it.

Once deployed to the central repository, your component (or component update) will become available to all users of Aspire.

To set up a Maven Deploy command, follow the exact same instructions as above for Maven Install, just specify "deploy" instead of "install" for the Maven Goals (and the "Name:", of course).