bish bish - 25 days ago 22
Java Question

Maven dependencies for IBM Websphere packages

I'm trying to convert a "classic" JAVA EE project, using IBM websphere 8.0.0.5, into a maven multi module project and facing issues with the IBM dependecies.

We use IBM classes from the following packages:


  • com.ibm.websphere.asynchbeans

  • com.ibm.websphere.scheduler

  • com.ibm.websphere.ce.cm

  • com.ibm.ws.asynchbeans

  • com.ibm.ws.util.ThreadPool



To get my local project to be compiled I downloaded the was.installer-8.0.0.pm from IBM and installed it to my maven using

mvn install -f "was.installer-8.0.0.pom" -D serverInstallationFolder="C:\Program Files (x86)\IBM\WebSphere\AppServer"


This step was successfull according to command line output.

I then added the following dependencies to my project as described from IBM:

In parent:

<dependency>
<groupId>com.ibm.tools.target</groupId>
<artifactId>was</artifactId>
<version>8.0.0</version>
<type>pom</type>
<scope>provided</scope>
</dependency>


In module:

<dependency>
<groupId>com.ibm.tools.target</groupId>
<artifactId>was</artifactId>
</dependency>


But I still can't compile my project as the IBM packages are not found.

Can anyone help me to find and correct a mistake I made?

Edit

After following BevynQ tip from the comments I copied the "was_public.jar" to "was_public-8.0.0.jar" (described at IBM here) and added it to my repository:

mvn install:install-file -Dfile="C:\Program Files (x86)\IBM\WebSphere\AppServer\dev\was_public-8.0.0.jar" -DpomFile="C:\Program Files (x86)\IBM\WebSphere\AppServer\dev\was_public-8.0.0.pom"


I then changed the dependencies to:

<dependency>
<groupId>com.ibm.websphere.appserver</groupId>
<artifactId>was_public</artifactId>
<version>8.0.0</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>com.ibm.websphere.appserver</groupId>
<artifactId>was</artifactId>
</dependency>


This helped to get the compiling errors for the imports to
com.ibm.websphere
done.

What I now have still open is the packages
com.ibm.ws.*
package. Anyone have an idea?

Edit 2
I added the following dependency and then I was rid of the
com.ibm.ws.*
import errors.

<dependency>
<groupId>com.ibm.websphere.ws</groupId>
<artifactId>com.ibm.ws.runtime</artifactId>
<version>1.0.0</version>
</dependency>


But it still does not compile as now indirectly references can not be found (in my case
commonj.work.WorkManager
). It seems I need to add further .jars for every single thing. Isn't there an easier way to provide all websphere jars at once as descirbe in the above linked tutorial with the
com.ibm.tools
dependency (which do not work)?

Answer

Here's the solution so I solved my dependency problems:

  1. I configured the company repository manager (nexus) as a mirror. In this nexus all ibm packages are present. As you can think that solved the main problem.
  2. I then added the following dependencies according to common maven style:

Dependencies in pom.xml (version numbers extracted to properties):

<dependency>
  <groupId>com.ibm.websphere.ws</groupId>
  <artifactId>com.ibm.ws.runtime</artifactId>
  <version>${ibm.ws.runtime.version}</version>
</dependency>


<dependency>
  <groupId>com.ibm.ws.prereq</groupId>
  <artifactId>commonj-twm</artifactId>
  <version>${ibm.ws.prereq.commonj-twm.version}</version>
</dependency>

Sorry I can't provide a "nice" solution that's useable by all people but the answer from njr and the comment from BevynQ helped at lot to get clearer with the problem and helped to solve the problem in a "more manual" way by copying the needed jars by hand.