Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.toolsdependency (which do not work)?

like image 682
bish Avatar asked Apr 12 '16 05:04

bish


1 Answers

In general, com.ibm.websphere are public API for use by applications (this is true of the packages you listed above) which is consistent with these being in was_public.jar

However, com.ibm.ws package is generally product internals. May I ask what interface methods you are using from the com.ibm.ws.asynchbeans package? Maybe there is a public API alternative.

Regarding commonj.work, the only place I can find this in the WebSphere Application Server product image is WAS/plugins/com.ibm.ws.prereq.commonj-twm.jar so it looks like you will need to use that to compile against.

like image 194
njr Avatar answered Nov 02 '22 07:11

njr