Topic
  • 3 replies
  • Latest Post - ‏2012-11-16T18:08:58Z by SystemAdmin
JirongHu
JirongHu
7 Posts

Pinned topic Shall we add EAR project into ClearCase?

‏2012-11-14T02:00:01Z |
Hi

I have a standard J2EE application with EJB, war and ear. Currently they develop in RAD 7.5 and manually export jar, war, ear from the RAD. Now I am helping them deploy an automated build, so they are creating ANT scripts, but using the following RAD Build Utility:
Rational Application Developer Build Utility
http://publib.boulder.ibm.com/infocenter/radhelp/v7r5/index.jsp?topic=%2Fcom.ibm.rad.install.doc%2Ftopics%2Fc_install_build_utility_readme.html

One of the problem they have is if they add the EAR project into version control in ClearCase, then the developers deploy ear to local test WAS fails, error says WAS can't manage these files. Maybe they are read-only due to under ClearCase control. If they don't add this EAR project into ClearCase, but their build script rely on this EAR project to export the ear file.

How do you do this?

Thanks
Jirong
Updated on 2012-11-16T18:08:58Z at 2012-11-16T18:08:58Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    14225 Posts

    Re: Shall we add EAR project into ClearCase?

    ‏2012-11-14T08:52:32Z  
    Hello,

    Generally users do not need to publish the packaged EAR to the local WAS, especially if there is only one EAR.
    Typically, users would publish directly from RAD to WAS using the option: "Publish with Resources in the Workspace" which does not create the EAR, does not copy it into the WAS profile, and is optimized for performance.

    The issue of using packaged ears comes into play when you have many modules/ears. In that case the use of Binary Projects (Shared EARs) benefits performance. The general approach is described here:

    http://www.ibm.com/developerworks/rational/library/07/0619_karasiuk_sholl/

    Typically, the Rational product used for storing the output of the build is Rational Asset Manager

    http://publib.boulder.ibm.com/infocenter/ramhelp/v7r5m1/index.jsp

    I have never tried to publish the EAR stored in ClearCase. I would suggest that if that is a requirement, you open a PMR to investigate further why it fails (permissions are, as you guessed, the most likely culprit).

    Thank you and regards, Lara
  • JirongHu
    JirongHu
    7 Posts

    Re: Shall we add EAR project into ClearCase?

    ‏2012-11-14T15:19:02Z  
    Hello,

    Generally users do not need to publish the packaged EAR to the local WAS, especially if there is only one EAR.
    Typically, users would publish directly from RAD to WAS using the option: "Publish with Resources in the Workspace" which does not create the EAR, does not copy it into the WAS profile, and is optimized for performance.

    The issue of using packaged ears comes into play when you have many modules/ears. In that case the use of Binary Projects (Shared EARs) benefits performance. The general approach is described here:

    http://www.ibm.com/developerworks/rational/library/07/0619_karasiuk_sholl/

    Typically, the Rational product used for storing the output of the build is Rational Asset Manager

    http://publib.boulder.ibm.com/infocenter/ramhelp/v7r5m1/index.jsp

    I have never tried to publish the EAR stored in ClearCase. I would suggest that if that is a requirement, you open a PMR to investigate further why it fails (permissions are, as you guessed, the most likely culprit).

    Thank you and regards, Lara
    Thanks for your reply. I will pass this information to the project team.

    They want to store the EAR project source in ClearCase, not the ear files though.

    Jirong
  • SystemAdmin
    SystemAdmin
    14225 Posts

    Re: Shall we add EAR project into ClearCase?

    ‏2012-11-16T18:08:58Z  
    • JirongHu
    • ‏2012-11-14T15:19:02Z
    Thanks for your reply. I will pass this information to the project team.

    They want to store the EAR project source in ClearCase, not the ear files though.

    Jirong
    I've been successful at storing the EAR source in source control and having a build engine check it out, run ANT, and deploy the packaged EAR into WAS. We use Team Concert (RTC) for source control and build automation (which can also synchronize with a ClearCase stream). The EAR source should be stored in source control. The packaged EAR should not. Here is an example ANT target to create the EAR from source (note that it has a couple of ANT tasks that are specific to RTC).
    <!-- Compile the base application, war it and ear it -->
    <target name="ear">
    <startBuildActivity label="Packaging application for deployment" autocomplete="true" buildResultUUID="${buildResultUUID}" repositoryAddress="${repositoryAddress}" userId="${rtc.userid}" password="${rtc.password}" />
    <mkdir dir="${path.temp}" />
    <mkdir dir="${dir.ws}/WebContent/WEB-INF/classes" />
    <javac source="1.6" target="1.6" srcdir="${dir.ws}/src" destdir="${dir.ws}/WebContent/WEB-INF/classes" classpath="${path.lib.destination}" debug="on">
    <classpath>
    <fileset dir="${path.lib.destination}" includes="*.jar" />
    </classpath>
    <compilerarg line="-1.6 -log ${compileLog}" />
    </javac>
    <war destfile="${path.temp}/WebServices.war" webxml="${dir.ws}/WebContent/WEB-INF/web.xml" update="true">
    <fileset dir="${dir.ws}/WebContent" />
    </war>
    <ear destfile="${path.ear.file}" appxml="${path.ear.project}/META-INF/application.xml" >
    <fileset dir="${path.temp}" includes=".war" excludes=".settings, logs/.txt, .project, META-INF/application.xml"/>
    </ear>
    <artifactFilePublisher label="Web services EAR file" filepath="${path.ear.file}" buildResultUUID="${buildResultUUID}" repositoryAddress="${repositoryAddress}" userId="${rtc.userid}" password="${rtc.password}"/>
    </target>

    Likewise I have a similar ANT target that uses Jython scripting to deploy to WAS. All of this is automated with RTC. We just run either a build (to compile and package), or a deploy (compile, package, deploy to WAS) build definition. One click excellence.