Question

recently I was involved in maintenance of a project.
This project is very old and the build process is all demanded to IBM RAD.
We have to rebuild the entire project from scratch, but in the meanwhile we have to maintain this old one.
I want to move to a CI system and automatize the build process using such software like Maven or Gradle (preferred).
The problem is that this project is using some IBM libraries to work with EJB (a field in which I'm very poor of knowledge and experience), and I have an ejbModule which is full of classes that aren't in SVN and are autogenerated from RAD (all stub classes).
What is the purpose of the stub?
After see this, I'm not very sure if is possible to automatize the build process, does someone have some experience with this?

Sorry for the lack of details, I don't know what I can add to be more detailed, incase something more is needed ask.

Was it helpful?

Solution

We have a system developed in RAD using ejb 2.0, deployed on to websphere 6.1 server

If you have a similar set-up you might be able to replicate the structure we used.

We used maven as the build tool, using the following plugins;

  1. maven-ejb-plugin
  2. was6-maven-plugin
  3. xdoclet-maven-plugin

we used profiles to active the generation of the stubs when any of the interfaces changed, and xdoclet to annotate the bean class including websphere specific binding to generate the ejb-jar.xml and other ibm deployment files.

It took a few weeks to get it working and we have an automated build using hudson-ci, so might have to play around with the setup of the pom and plugins to adapt to your project.

sample of our pom.xml;

<groupId>your.group.id</groupId>
<artifactId>your.artifact.id</artifactId>
<packaging>ejb</packaging>

<build>
    <plugins>
        <plugin>
            <artifactId>maven-ejb-plugin</artifactId>
            <configuration>
                <ejbVersion>2.0</ejbVersion>
                <generateClient>true</generateClient>
                <clientIncludes>
                    <clientInclude>**/interface/**</clientInclude>
                </clientIncludes>
            </configuration>
        </plugin>
    </plugins>
</build>

<profiles>
    <profile>
        <id>xdoclet</id>
        <activation>
            <property>
                <name>xdoclet</name>
            </property>
        </activation>
        <build>
            <plugins>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>xdoclet-maven-plugin</artifactId>
                    <executions>
                        <execution>
                            <phase>generate-sources</phase>
                            <goals>
                                <goal>xdoclet</goal>
                            </goals>
                            <configuration>
                                <tasks>
                                    <ejbdoclet
                                        destDir="${project.build.sourceDirectory}"
                                        force="true" ejbSpec="2.0"
                                        verbose="true">
                                        <fileset
                                            dir="${project.build.sourceDirectory}">
                                            <include name="**/*Bean.java" />
                                        </fileset>
                                        <packageSubstitution
                                            packages="service" useFirst="true"
                                            substituteWith="interface" />
                                        <homeinterface />
                                        <remoteinterface />
                                        <deploymentdescriptor
                                            displayname="Service Name"
                                            description=""
                                            destDir="${basedir}/src/main/resources/META-INF"
                                            validateXML="true" useIds="true" />
                                        <websphere
                                            destDir="${basedir}/src/main/resources/META-INF"
                                            validateXML="true" />
                                    </ejbdoclet>
                                </tasks>
                           </configuration>
                            </execution>
                </executions>
                </plugin>
    </profile>

    <profile>
        <id>was-ejb</id>
        <activation>
            <property>
                <name>was-ejb</name>
            </property>
        </activation>
        <build>
            <plugins>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>was6-maven-plugin</artifactId>
                    <executions>
                        <execution>
                            <goals>
                                <goal>ejbdeploy</goal>
                            </goals>
                        </execution>
                    </executions>
                    <configuration>
                        <wasHome>C:/Program Files/IBM/WebSphere/AppServer</wasHome>
                    </configuration>
                </plugin>

            </plugins>
    </profile>

</profiles>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top