0

I'm working on webservices for WebSphere and I wish to not depend anymore from the Rational Software Delipvery Platform (aka RAD) IDE.

I'm asking if someone knows if it is possible to generate the following files:

  • ibm-webservices-ext.xmi
  • ibm-webservices-bnd.xmi
  • webservices.xml

without having to use RAD (eg some ant script or WebSphere batch).

This is a really annoying lock-in.

I'm trying to port these webservices projects to a more controllable development process, using maven, automatic builds, and so on, but i found it quite difficult.

Has someone solved similar issues?

pnuts
  • 58,317
  • 11
  • 87
  • 139
Andrea Colleoni
  • 5,919
  • 3
  • 30
  • 49
  • You might want to specify which version of WebSphere you're using, but I never found a way to do all this configuration for our v6.1 without using RAD. Some of the content of those files could later be modified through the WebSphere console, and you can always hand-create the files yourself if you know what you were doing, but I never found an easy way to get everything correctly configured in the first place without the RAD tooling. – dbreaux Jul 05 '12 at 17:19

1 Answers1

1

If anyone is still looking for help with this, we took a slightly different approach by creating the RAD and WAS 8.5 specific files at project creation time.

For my current project, we have a fairly standard project structure and naming convention so we use a Maven archetype to create our projects and include those IBM specific files, ibm-webservices-bnd.xmi in particular, in the Maven archetype.

Easiest way to do this is to take an existing project that has those necessary files, and use the create-from-project archetype from your project folder:

mvn clean archetype:create-from-project -Dinteractive=true

Use interactive mode to give the archetype a sensible archetype.artifactId (but do not change the GAV of the project):

Define value for archetype.groupId:  com.name.archgroup: : com.name.common.archetype
Define value for archetype.artifactId:  MyService-archetype: : service-archetype-0.8
Define value for archetype.version:  1.0-SNAPSHOT: :
Define value for groupId:  com.name.archgroup: :
Define value for artifactId:  MyService: :
Define value for version:  1.0-SNAPSHOT: :
Define value for package:  com.name: : com.name.common.archetype

This gets you most of the way, but the IBM files do not get processed by default. The trick then is to modify the generated target files in /MyService/target/generated-sources/archetype/target/classes/archetype-resources to also modify the IBM files. Replace instances of the old project name and package name with ${rootArtifactId} and ${groupId} keeping track of which files had the incorrect values.

Then modify the /MyService/target/generated-sources/archetype/target/classes/META-INF/maven/archetype-metadata.xml to include the files you had to manually change in the filtering. For instance, under my EJB module section, *.xmi was included but not filtered. Move the include to the filtered fileset:

    <fileSet filtered="true" encoding="UTF-8">
      <directory>src/main/resources</directory>
      <includes>
        <include>**/*.xml</include>
        <include>**/*.properties</include>
        <include>**/*.xmi</include>
      </includes>
    </fileSet>

You'll need to do this for everything that you modified to include a ${rootArtifactId} or ${groupId} so that velocity processes it in the next step:

cd target\generated-sources\archetype
mvn install

This packages up your changes and places the jar into your local repository so that you can test it out before publishing to your Maven repository server.

Once your are satisfied, add your maven repositories to target/generated-sources/archetype/pom.xml and run

mvn deploy

And instruct developers to begin using the archetype to create your mavenized projects.

Note: our ibm-webservices-bnd.xmi files appear to include something like xmi:id="RouterModule_112345678901234" We remove this value before the mvn install as it appears to be project specific.

peater
  • 1,233
  • 15
  • 20