Installing the server APIs into the Maven repository

About this task

Important: Applicable to WebSphere® Application Server traditional
WebSphere Application Server V8.0 and later provide a Maven module with the APIs that are required to compile your projects. If you install this module into your Maven repository, you do not need to manually add the module JAR file to your class path.
Note: This information assumes that you have WebSphere Application Server installed on a system that you have access to.

Procedure

  1. Locate the module JAR file, was_public.jar. This JAR file contains the APIs and is in the dev directory of your WebSphere Application Server installation. For example, if your application server is installed into C:\Program Files\IBM\WebSphere\AppServer, the JAR file is located at C:\Program Files\IBM\WebSphere\AppServer\dev\was_public.jar.
  2. Rename the JAR file to match the server version. If you are using version 8.0.0, rename the file to was_public-8.0.0.jar. If you are using version 8.5.0, rename the file to was_public-8.5.0.jar. If you are using version 9.0.0, rename the file to was_public-9.0.0.jar.
  3. Access the install artifact dialog. Click File > Import > Maven > Install or deploy an artifact to a Maven repository. Click Next.
    Access the install artifact dialog
  4. Install the file to your local repository. Click Browse next to the Artifact file field and browse to the JAR file that you renamed in the previous steps. When you populate the Artifact file field, the POM file field is automatically updated with the name of the POM file that is also in the server dev directory. The rest of the required fields are also updated.
    Browse to the JAR file
  5. Click Finish to install the file to your local repository.
    Note: The module needs to be installed to a local repository only once per machine. To find the location of the repository, click Window > Preferences > Maven > User Settings and note the value in the Local Repository field.
  6. So that a project can compile against the module, add a dependency to the module. If you have an existing Maven project, right-click the project and select Maven > Add Dependency. In the search filter field, enter was_public. The search results display the module. Select the module; the Group Id and Artifact Id fields are updated. Set Scope to compile. Click OK to complete the dialog. A project dependency to the was_public module is added and it is not necessary to add the module JAR file to your class path.
    Add dependency to the module
Icon that indicates the type of topic Task topic
Timestamp icon Last updated: July 17, 2017 21:58

File name: install_server_apis.html