Maven dependencies for IBM Websphere packages

I am trying to convert a “classic” JAVA EE project using IBM websphere 8.0.0.5 into a maven multi-module module project and run into problems related to IBM requirements.

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 compile my local project, I downloaded was.installer-8.0.0.pm from IBM and installed it for my maven using

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

This step was successful according to the output of the command line.

Then I added the following dependencies to my project, as described by 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 the module:

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

But I still can’t compile my project because no IBM packages were found.

Can someone help me find and fix the mistake I made?

Edit

After I read BevynQ's comment, I copied "was_public.jar" to "was_public-8.0.0.jar" (described here by 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" 

Then I 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 compilation errors for import into com.ibm.websphere done.

Now I am still opening the com.ibm.ws.* package. Does anyone have an idea?

Edit 2 I added the following dependency, and then I got rid of 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, since now indirectly links cannot be found (in my case commonj.work.WorkManager ). It seems I need to add more .jars for each thing. Is there an easier way to provide all websphere banks at once as descirbe in the above related tutorial with com.ibm.tools dependency (which do not work)?

+6
source share
3 answers

In this solution, I solved the dependency problems:

  • I configured the company repository manager (nexus) as a mirror. In this regard, all ibm packages are present. Do you think this solved the main problem.
  • Then I added the following dependencies according to the general maven style:

Dependencies in pom.xml (version numbers extracted for 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 “pleasant” solution that can be used by all people, but the answer from njr and the comment from BevynQ helped solve the problem, helped solve the problem in a “more manual” way by manually copying the necessary jars.

0
source

In general, com.ibm.websphere is a public API for use by applications (this applies to the packages listed above), which is consistent with the fact that they are in was_public.jar

However, the com.ibm.ws package is usually an internal component of the product. May I ask what interface methods are you using from the com.ibm.ws.asynchbeans package? There may be a public alternative to the API.

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

+3
source

I ran into this problem when I tried to create a project using Maven version 3.3.9, running on Java version 1.8.0_101, as shown in the screenshot:

enter image description here

Here's how I solved it: Step 1. Download commonj.jar from here . Step 2. Determine which JDK your Maven is using by typing mvn -version at the command line. enter image description here

Step 3. Go to this directory and place the commonj.jar file in the jre/lib/ext directory, as shown below. Your project should now build on maven without any problems.

enter image description here

0
source

All Articles