Joine Music

  • Subscribe to our RSS feed.
  • Twitter
  • StumbleUpon
  • Reddit
  • Facebook
  • Digg

Thursday, 4 October 2012

Writing Unit Tests to Ensure Your "@Transactional ... rollbackFor" Annotations are Honoured

Posted on 04:50 by Unknown
Thanks to Russ Hart for providing the info on how to get this to work.  I just cut and paste, and then blogged it.

It's nice to write unit tests.  I wanted to write a set of tests for a method that I'd marked with the Spring @Transactional annotation:


          @Transactional(propagation = Propagation.MANDATORY, rollbackFor = {MessagingException.class})
    @Transformer
    public IncomingEmailDTO receiveMessage(Message message) throws MessagingException {

        IncomingEmailDTO emailDTO = null;
        ...

The tests for the method were simple. But then I realised I wanted to also test that rollbacks were happening or not as required as specified by the "rollbackFor = {MessagingException.class}" part of the annotation.

A quick aside (because I was asked this by the person who gave me the solution to this, and it's entirely valid).  Why did I want to test this?  Aren't I just testing that this Spring annotation works?  In part, yes, this will be the effect of any tests for this.  But there was something else I wanted.  Unit tests, over time, build into a massive, executable spec. for your system.  It would be very easy for someone in the future to change this small part of the annotation (or remove it altogether) and have a very significant effect on the running of the whole system.  Consequently, by adding tests which check that this test is a) transactional, and b) set to rollback for specific exceptions only; I can protect myself against this unfortunate outcome.

But back to the example.  

We had the following Spring XML config:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns="http://www.springframework.org/schema/beans"
       xmlns:context="http://www.springframework.org/schema/context"
       xmlns:tx="http://www.springframework.org/schema/tx"
       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
                           http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd
                           http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.1.xsd">
  
    <context:annotation-config />
    <tx:annotation-driven transaction-manager="transactionManager" />
    <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
        <property name="dataSource" ref="dataSource"/>
    </bean>
    <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
        <property name="driverClassName" value="oracle.jdbc.OracleDriver"/>
        <property name="url" value="jdbc:oracle:thin:@localhost:1521:MYSID"/>
        <property name="username" value="ME"/>
        <property name="password" value="ME"/>
    </bean>
</beans>
And then in our unit test we had to have the following:

@ContextConfiguration(locations = {"classpath:spring/appContext-incomingEmailReceiverTest.xml"})
@RunWith(SpringJUnit4ClassRunner.class)
public class IncomingEmailTransformerTest {

    @Autowired
    private PlatformTransactionManager transactionManager;

    @Transactional
    @Test
    public void test_transform_valid_incoming_email_with_no_attachment_works_and_no_rollback()
            throws MessagingException {
    
        IncomingEmailDTO result = emailTransformer.receiveMessage(validInputMessage);

        assertFalse(transactionManager.getTransaction(null).isRollbackOnly());
    }

    @Transactional
    @Test
    public void test_MessagingException_when_extracting_originator_gets_thrown_and_tx_rolls_back()
            throws MessagingException {

        stub(mockEmailDataExtractor.extractOriginator(incomingEmailMessage)).toThrow(new MessagingException());
    
        IncomingEmailDTO result = emailTransformer.receiveMessage(validInputMessage);

        assertTrue(transactionManager.getTransaction(null).isRollbackOnly());
    }


And there we have it.
Read More
Posted in | No comments

Tuesday, 2 November 2010

Track Technical Debt with @Debt - v0.0.1 Available

Posted on 02:20 by Unknown

The @Debt annotation can be used in Java 6 or above to measure in code instances of technical debt. If a configurable threshold is exceeded then the build will fail.

It is intended to be used by both developers and dev leads. The number one use case is the situation when expediency has driven you to make a design or implementation decision which you are not 100% happy with. Normally you will moan to yourself quietly, write the less-than-pretty code, and move on. If you are lucky you will remember the exact position where this trade-off was cast in stone; but probably you will not. Then in the future, you hit the problem again, and again there is no time to put in a "nicer" implementation. You grumble again, and move on. If only there was a way to mark all the occurrences of this technical debt, and to indicate every time it later causes you real development pain.

The @Debt annotation lets you do this. Now, when you make the concession, you quickly add the "@Debt" to the member in question (adding a quick description string and set the counter to "1") and move on. Later on, when you hit it again, you just increment the counter. Meanwhile, behind the scenes, at every build you are automatically trawling through your codebase and crunching all this debt and keeping a track of it. How debt-ridden is a given part of your code? Now more than relying on smells alone, you can have a look at the @Debt output and have a real idea.

But beware! You need to be disciplined in your marking and updates of your @Debt trackers. Otherwise it's as useless as thoise unit tests which now fail so you switched off. You have been warned!


Get it here: http://kenai.com/projects/csdutilities/downloads

Read More
Posted in debt technical java annotation | No comments

Thursday, 28 October 2010

Reuse (ii): Definition of Done

Posted on 09:11 by Unknown
As I said in my previous post, our project has suddenly taken a new path. There are two bits of collateral which I'd recently produced which will now no longer be required. Here are the notes for myself, and anyone else who might be intetested.

Part (ii) - Definition of Done

INTEGRATION READY
  • Code Committed (associated with Task and commented meaningfully)
  • Code Review (if required / requested) Completed
  • Unit Tested
  • Static Analysis Checks (Findbugs, PMD, Checkstyle, Cobertura) passed based on thresholds
  • Acceptance Tested against Acceptance Criteria
  • Story / Defect, Design Decisions, and Test Plan, Conditions and Results documented on Wiki
  • Acceptance tests automated and added to Regression Suite
  • Story / Defect added to Release Note (including installation and admin instructions)
  • Story and all Tasks updated and set to "Ready for Review"
INTEGRATED AND RELEASED
  • System Integration Testing completed
  • Test Plan, Conditions and Results documented on Wiki
  • Release tagged in SCM
  • Maven version numbers updated
  • Artifacts published to Artifactory
Read More
Posted in | No comments

Reuse (i): Way of Working

Posted on 08:48 by Unknown
Our project has suddenly taken a new path. There are two bits of collateral which I'd recently produced which will now no longer be required. Here are the notes for myself, and anyone else who might be intetested.

Part (i) - Way of Working for an Agile Distributed Team
  • 3 week iterations (all teams starting and ending on the same days)
  • Sprint Planning with the teams (Planning Poker for Stories, hours for tasks)
  • Daily Scrums (3 questions plus "What have your learned?")
  • Prioritised Backlog (Stories for the next-up phases, Use Cases for further out, Epics beyond that)
  • Product Owners own Product Backlog
  • Release Plan (always visible with named internal releases each iteration)
  • Defects, Technical Stories (NFR's) and Technical Risks on the Product Backlog too
  • Cross Functional Teams (UI Designers, Product Owners, Designer / Developers, Testers)
  • Core Services Team (Environments, CM, CI, DBA)
  • Crozz Timezone Teams (no primary location - Scrum Masters could be anywhere)
  • Scrum of Scrums (meeting 2-3 times a week)
  • Demos each iteration with client Acceptance / Signoff
  • Empowered Onsite Clients (but not full time)
  • Retrospectives every Iteration
  • Definition of Done (see part (ii))
  • Automated Integration Tests (captured with Selenium from Wireframes before development)
  • Automated Acceptance Tests / Regression Tests (ensuring "Accepted Functionality never gets lost)
  • IBM RTC for Stories, Tasks, Defects
  • IBM RTC for SCM
  • Hudson for CI
  • Virtual Taskboards (IBM RTC)
  • Each teams Velocity tracked and displayed
  • Product Burnup displayed as Lean Cumulative Flow Diagrams
  • Sprint Burndowns tracked and displayed
  • Teams (Re)Plan and (Re)Estimate every Iteration
  • System Testing within an Iteration
  • Hudson and RTC Radiators (builds and graphs displayed on Screens plus audible feedback from HudsonTracker)
  • Collaborative workspaces (whiteboards, pens, post-its, breakout areas)
  • Regular High Bandwidth COmmunications (Eyecatcher VC Units, MSCommunicator VoIP, desktop sharing)
  • No changes during an Iteration
Read More
Posted in | No comments

Hudson and RTC - Cowley 1.0.1 Released

Posted on 07:00 by Unknown
I've had some time recently and managed to get back to looking at my Hudson RTC plugin. I found a lot of things making the 1.0.0 version really unstable and have made some updates and come up with 1.0.1.

To get it and start getting the Hudson build love in your RTC projects visit the project site.

Please let me know too how it works for you - the site has an issue tracker so please log all bugs and RFE's there.

There are some extra features I'm working on for 2.0.0 which hopefully will be along soon including change set parsing (let Hudson know just who's changes sparked a build), personal builds, and automated releases. Watch this space...
Read More
Posted in build, CI, cowley, hudson | No comments

Sunday, 20 June 2010

Achieving Agility with IBM Rational Team Concert SCM - Powerpoint Slides

Posted on 13:58 by Unknown
As promised, here is a link to the slides I presented at the recent IBM Innovate 2010 - "Achieving Agility with Rational Team Concert SCM". Hopefully they're useful to you.
Read More
Posted in | No comments

Friday, 28 May 2010

Notes from a Reluctant CM/CI/Release Manager

Posted on 01:20 by Unknown
I'm in the midst of transitioning out of my role as a CM/CI/Release Manager. I've learned a lot while doing it (some things the easy way, some the hard way), and thought I'd blog my conclusions and lessons learned so I don't make the same mistakes then next time.

Grow; Gradually
There is immense value in even a small bit of SCM, build automation, or CI feedback. As long as your approach is flexible (and if your tools don't support this then seriously consider changing your tools).

What does this mean in practice?
  • For SCM, choose a tool, (a free one preferably as this is quicker), get it installed, and get everyone checking in their code and other artefacts early. In my experience a distributed SCM (i.e.Git or Mercurial, or even Jazz SCM) is best as it's structure can easily be changed as the project changes over time.
  • For build automation, choose anything (Ant, Maven, Rake, hell even shell scripts) but get it set up at the start and have all your bits use it. Also seperate the build from the environment right from the start. This makes it very flexible.
  • For CI choose Hudson (IMHO it's the best engine at the moment by a country mile). Get it set up on a dedicated server right away (this will take 30 minutes) and get it polling your SCM, running builds, and going all red/yellow/green right from the outset.
Start with a Small, Simple, Core Build as Early as Possible
Continuing on from the last tip, you want to depend upon Hudson from the outset. Get the team aware of the benefit of the feedback it provides. Make it the team's friend, rather than their enemy.

To do this resist the urge to get clever to begin with. A single build will do at the begnning. You can grow it later. You'll read all about upstream and downstream builds and promotion and everything else. These are all great concepts, and you will use them, but nt yet. Implement them when the time investment warrants it. At the outset, your code base will be tiny, and you will have few Unit Tests. Don't worry about your build speed. It's not slow yet. Just get the code compiling, and the unit tests running.

Ensure the Whole Dev Team Understands how their SCM Tool Works

Your SCM is a powerful tool. If you understand it beyond the basic "checkin/checkout" dynamics it will allow you to have maximum confidence in the code you are working on both individually and as a team.

On our project we were soon taking advantage of the facilities for personal revision history, suspension and revision of change sets, creation of patches, reversals, and more. To get to this we created a training session which was run for each new joiner which took them slowly through the basics of the Jazz SCM "Change Set" system, and then build upon this so they all had a workable meta model of their changes in the context of their team, and the wider project.

Beyond this (and as a result of having to evolve the SCM model from the simple one we started with to the one we ended up with when everything went offshore) the CM/CI team had a deep understanding of how the entire system worked, which allowed us to do some really clever tricks, digging people out of messes when they did (infrequently) get into them, and making sure we could have just the right amount of seperation between bugfix, next release, and PoC / Investigation development.

Have a Sandpit
After the basic setup for both your SCM and your CI build is done you'll want to get cleverer and cleverer. This isn't a bad thing, but you will make mistakes. Especially if you want to get really clever.

We made the mistake of doing this experimentation on our "production" systems (i.e. the SCM and CI servers that the Dev Teams were using. Aside from the danger of catastrophic problems which you may cause, there is also the confusion you generate. CI is best when it is simple, clear and reliable. Red is bad. Green is good. You don't want to have to tell people to "ignore this for the minute while we get it working" or "don't worry about that, it'll work soon." This errodes trust in your tools, and gives others a source of excuses. As the CM/CI team, you need to lead by example. Hide your mistakes. Have a sandpit.

Make Sure the Architecture is "Developable"
What do I mean by "Developable"? It's my first real neologism and one I'm more and more confident of the more I work in Software Development. In reality it needs a whole post to itself (perhaps even a book), but in essence I mean that the chosen architecture and component technologies which it comprises should be easy to develop against. Perhaps a few examples are required.
  • Compilable: Is it straightforward to compile your code? Do I just need the compiler, the dependencies, and the build scripts? No? I need the vendors too installed, and their server, and I need to deploy a dependency to compile downstream projects? Think again...
  • Unit Testable: Is the code you write easy to unit test? Can you automate the running of these tests with your IDE and CI server and collect and view the results effectively? Is it easy to mock? No? I need to deploy in order to unit test? Perhaps you should re-consider...
  • Tool Independent: Can you run your builds headlessly, without the need to install an IDE? No? Is this the 1980's? Come on...
  • Version Controlable: Can we easily manage the code and configuration files in an SCM? You don't know SCM is? Let me explain...
  • Manageable Dependencies: Can we automate the management of dependencies? You want me to check-in the compiled results? Are you serious? Alarm bells...
  • Quick to Build: Can I poke my build scripts (on my machine, or via Hudson) and within a relatively sensible period of time get a red/green feedback? It takes 30 minutes just to compile, and its going to get longer as you add more code? Hmmmm
  • Quick-Turnaround, Lightweight Dev Environment - Can I deploy my latest edits to my local server and see the results in a few minutes max? Can I develop on the same platform as production without having to take up hundereds of gig's of disk and have a 64-bit OS to address all the memory required to run all the servers and databases just to compile and run the unit tests? No? Have you heard of Tomcat?...
I'd recommend you think about (and investgate if needed) all these things and more when you get told what your architecture is and what you're going to build it in. Pushing back at the start is a lot easier than pushing back later on. Trust me...

Publicise the CI Build
Despite the fact the Hudson is a superb resource which all developers should embrace because it makes their lives easier, most of them hate it because it goes red when they screw up. In an ideal world they would love to know that the change they just made caused a problem, but the majority seem to want to forget about it until later, when the detail has been swapped out of their mental L1 cachee and it's far more of a challenge to resolve.

You can remedy this by making Hudson and the status of Jobs ubiquitous. Get Hudson to send emails; use the Hudson Tracked and Growl to pop up toast on their screens (and play a sound too); but best of all set up a build radiator. At worst, this should be a screen, widely visible to all (especially the Project Managers / clients) and displaying the colours of all key jobs. (All jobs preferably). At best, it should be a singing-dancing, attention grabbing machine which rewards good behavious and punishes the bad. Come on, get creative!

Automate the Release Process as Much as Possible - And Keep it as Simple as Possible
My final lesson learned is around making releases. You want to be able to make releases as quickly as possible, with as little manual intervention as you can get away with. I'm including the packaging, documentation, and deployment of these releases in this.

The aim is to make it easy to release super-frequently. Hudson isn't your last line of quality feedback. There are the testers too remember. The more you can give releases to them, and the quicker you can give them an update with all the fixes the more time they'll be able to sit about testing and increasing the quality of your product even more. It is all about feedback and quality after all...
Read More
Posted in | No comments

Sunday, 7 February 2010

Cowley - A Hudson plugin for RTC (v.1.0.0) - Part 2 - IBM, meet Maven

Posted on 03:09 by Unknown
Introduction
In my previous post, I introduced version 1.0.0 of Cowley, a Hudson plugin for IBM's Rational Team Concert (RTC) SCM system. I'd love for the plugin to be a simple one-click install like many others in the ecosystem, but unfortunately it currently relies on the RTC Build System Toolkit which is freely available, but isn't in any public Maven repositories. This means, in order to simply use the plugin, or to build it from source, you need to do a little Maven / Ant / Jar magic. This post in the series will tell you how.

Note: This post is specifically geared towards getting the required pieces of the Build Toolkit into a Maven-usable state. However, there is nothing here which couldn't be taken and reused in many other circumstances.

Pre-Requisites
I'm assuming for the rest of the instructions that you have Java 1.6 and Maven 2.x installed. If not, why not? Get to it!

Obtaining the RTC Build System Toolkit
Job 1 is to get the Jazz RTC Build System Toolkit. You can download it from jazz.net (Windows) (Linux) (registration required).

NOTE: The rest of the instructions are based on the Windows version of the toolkit. I guess, as its all Java based, it's really similar. Post comments on this blog if there is additional info I need to add here.

Once you have the Build System Toolkit downloaded, unzip it somewhere temporary.

The Maven / Ant / Jar Magic
Next you need to get all the jars which come with the IBM Toolkit, wrap them up as a single jar, and add it to Maven for quick access and reuse. To do this, you'll need the following maven pom.xml. Cut and paste it into a file for use.

Now if you create a directory, put this new pom.xml file into it, edit the property "rtc.build.toolkit.plugins.dir" property and run the "mvn install" command. This will get the maven plugins and dependencies required, create your uber-jar, and "install" (i.e. copy) it into your local maven repository.

Congratulations!
You now have the required elements of the RTC Build Toolkit installed in maven, ready to either be added direct to your Hudson install to enable your Cowley plugin, or so you can compile my RTC Proxy API from source.

Either way, look out for the later posts in this series to find out how to obtain and use the Cowley Plugin without looking at any more code, as well as the gory details of the plugin development (if you're feeling sadistic).
Read More
Posted in | No comments

Saturday, 23 January 2010

OpenOffice 3.1.1 in a Java 6 Applet

Posted on 05:34 by Unknown
There is a tantalising set of documents on the OpenOffice.org wiki about how you can use the officebean.jar which comes with all OpenOffice installations to display documents in an applet. The problem is, its out of date, and the link to the source is dead. But don't let that stop you...

Note
These are instructions for Windows XP / Java 6 / OpenOffice 3.1.1. I'm sure they can be adapted for other operating systems / platforms.

Pre-Requisites
  • Java SDK (I used 1.6.0_15 - get it here)
  • OpenOffice (I used 3.1.1 - get it here)
  • Open Office SDK (I used 3.0.0 - get it here)
  • Netbeans (I used 6.8 - get it here. You could use another IDE if you like)
The Code
Firstly I created a new Java Class Library project in Netbeans called OOoApplet. To this I added a single class which I called "OOoBeanViewer.java". I then (lazily) went looking for the example code. I found it on Koders.com here. I cut and pasted this into my OOoBeanViewer.java stub in Netbeans.

The Dependencies
In order for this to compile and run I had to add the following dependencies:
  • C:\Program Files\OpenOffice.org 3\Basis\program\classes\officebean.jar
  • C:\Program Files\OpenOffice.org 3\Basis\program\classes\unoil.jar
  • C:\Program Files\OpenOffice.org 3\URE\java\ridl.jar
  • C:\Program Files\OpenOffice.org 3\URE\java\jurt.jar
  • C:\Program Files\OpenOffice.org 3\URE\java\juh.jar
The Environment
Because Open Office doesn't really run in the applet (rather we start it, and then redirect its display to the applet) we need so set things up so that the OOoBean knows where to look. This wa the hardest part as the assumption in the docs I could find was that this demo should just work. It didn't for me.

To get it to work I needed to add a Windows environment variable called UNO_PATH and set its value to be the path to the program directory of your OpenOffice install. I set mine to: "C:\Program Files\OpenOffice.org 3\program"

To get this to stick I then had to reboot. A check "echo %UNO_PATH%" at the command line showed that this had worked.

Running It
All that was left was to compile and run. This was done simply using Netbeans. The result is a mostly empty Applet window with some buttons down the side. Fear not! You need to create a new document to see what you desire. This is what you get if you select "New Document ... > Text Document":

Read More
Posted in | No comments

Wednesday, 23 December 2009

Cowley - A Hudson plugin for Rational Team Concert (v.1.0.0) - Part 1 - It's Alive!

Posted on 08:18 by Unknown
Version 1.0.0...
Over the past 9 months I've been working on my first Hudson plugin - a plugin to allow me to build my code stored in my Rational Team Concert (RTC) Source Code Management (SCM) system, all the while keeping the RTC server up to date with the builds which were running. Because RTC likes to keep up to date with CI builds, this latter piece is where the complications lie, especially because once a build is "done" I wanted some nice integration such as pushing the results back (artefacts, logs, links to the Hudson build result etc.)

Well, finally I've reached version 1.0.0. I've only put it through testing in my dev and project's CI environment but this has been enough to get it stable for us. I therefore thought this would be a good stage to let others see what I'd produced, and perhaps even get some free testing and input to boot.

Unfortunately, It's Not That Simple...
Ideally I want to be able to have the plugin available with the Hudson distro, and I've been having discussions on the Hudson newsgroups concerning this.

However, due to the fact that Cowley depends entirely on libraries in the RTC Build System Toolkit provided by IBM, the contents of which are not currently not available in any public Maven 2.0 repository, building and packaging are not so simple, and because they're not available under an open source licence. (They are however free to download from the jazz.net site.)

Bundling them as a binary plug is also currently not an option (though I'm pursuing this with IBM at the moment) as to obtain the libraries a prospective user needs to accept the IBM RTC EULA before downloading them.

So where does this leave us? Sadly, you need to get all the Cowley plugin itself and the IBM Build System Toolkit bits and package them up yourself. The hope is that this will change (especially as the REST API for RTC begins to come online from version RTC v.3.0 onwards) but until then, please accept my apologies.

So how do you do this? Well, jump to "part 2" of this series to find out.
Read More
Posted in | No comments

Tuesday, 24 November 2009

Hacking Oracle SOA Suite (11.1.1) builds to work with Ivy and Artifactory

Posted on 08:25 by Unknown

As discussed in a few previous posts, I’m on a mission to get my project’s SOA Suite builds to work without having to rely on a local installation of JDeveloper 11g with the added SOA Extension.

I’ve continued to make progress (with the help of Mayur – thanks) and we’ve now got compilation, packaging, deployment, and Unit Testing to work. We’ve still to tidy up our scripts so that they’re ready for publishing for public consumption, but in the meantime, I thought I’d put out some snippets which will help the enthusiastic to get to where we have.

Getting your Jar dependencies into Artifactory

My aim was to depend on Maven (and JFrog Artifactory) for our dependencies as much as possible. Where we could use publicly available Jars from the standard repositories we did. Sadly this turned out to be very infrequent. It did mean however that there was another reason to download and install Artifactory. This was very simple. We downloaded the Standalone version and ran it using the embedded Jetty. The only thing I needed to change from the default settings was to set a proxy (we’re behind a firewall.)

I then had to manually add all the Oracle dependencies which I had identified to ext-releases-local (Artifactory’s default Local repository for third party libraries). I had logged in as an Admin, and using the “Deploy” tab added them one at a time.

When I’d finished, it looked like this (apologies for the crappy screen grabs):

artifactory-structure-1 

artifactory-structure-2

artifactory-structure-6 artifactory-structure-3

artifactory-structure-4

 artifactory-structure-5

NOTE: It might be nice to bundle all these up as an artifacts bundle. I’ve not had the time to do this yet.

This meant we were now ready to link Ivy up to all of this.

Connecting Ivy and Artifactory

Next we had to tell Ivy to use either its local cache, or Artifactory, for all its dependency lookups. To do this, I created a new ivysettings.xml file with the following content:

<ivysettings>
    <settings defaultResolver="chain" />
    <resolvers>
        <chain name="chain" returnFirst="true">
            <filesystem name="local">
                <ivy pattern="C:/Documents and Settings/aharmel/.m2/repository/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]" />
            </filesystem>
            <url name="shared">
                <artifact pattern="
http://build-xp-10:8081/artifactory/repo/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]" />
            </url>
            <url name="public">
                <artifact pattern="
http://build-xp-10:8081/artifactory/repo/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]" />
            </url>
        </chain>
    </resolvers>
</ivysettings>

This meant that when an ivy:resolve target was called, the local Ivy cache would be looked up first, and if that was not successful, then artifactory would be checked for both shared and public lookups. This meant that we would cache those dependencies which were available publicly in Maven, speeding up the second, and all subsequent lookups.

Using Ivy to get the dependencies in the Ant files

Penultimately (is that a word? I doubt it), we created an ivy.xml file containing all our dependencies and different configurations:

<ivy-module version="2.0">
    <info organisation="example" module="example-dummy" />

    <configurations>
        <conf name="base" description="Jars required at both compile and runtime" />
        <conf name="taskdefs" description="Jars required for Ant Taskdefs" />
        <conf name="compile" description="Jars required at compile / package time" />
        <conf name="deploy" description="Jars required at deploy time" />
        <conf name="test" description="Jars required at test time" />
    </configurations>

    <dependencies>
        <dependency org="oracle/soa/bpel" name="orabpel" rev="11.1.1" conf="compile->default" />
        <dependency org="oracle/soa/bpel" name="orabpel-validator" rev="11.1.1" conf="compile->default" />
        <dependency org="oracle/soa/bpel" name="orabpel-common" rev="11.1.1" conf="compile->default" />
        <dependency org="oracle/soa/bpel" name="orabpel-thirdparty" rev="11.1.1" conf="compile->default" />
        <dependency org="oracle/soa/fabric" name="fabric-runtime" rev="11.1.1" conf="compile,taskdefs->default" />
        <dependency org="oracle/soa/mgmt" name="soa-infra-mgmt" rev="11.1.1" conf="compile,taskdefs->default" />
        <dependency org="oracle/soa/fabric" name="soa-infra-tools" rev="11.1.1" conf="compile,taskdefs->default" />
        <dependency org="oracle/soa/fabric" name="testfwk-xbeans" rev="11.1.1" conf="compile->default" />
        <dependency org="oracle/fabriccommon" name="fabric-common" rev="11.1.1" conf="compile->default" />
        <dependency org="oracle/xdk" name="xmlparserv2" rev="11.1.0" conf="compile->default" />
        <dependency org="commons-logging" name="commons-logging" rev="1.0.4" conf="compile->default" />
        <dependency org="commons-digester" name="commons-digester" rev="1.7" conf="compile->default" />
        <dependency org="commons-beanutils" name="commons-beanutils" rev="1.6" conf="compile->default" />
        <dependency org="commons-collections" name="commons-collections" rev="3.2.1" conf="compile->default" />
        <!--dependency org="commons-cli" name="commons-cli" rev="1.1" conf="compile,deploy->default" /-->
        <dependency org="oracle/commonj-sdo" name="commonj-sdo" rev="2.1.0" conf="compile->default" /> <!-- This is a hack as the Oracle JDeveloper one is different from the one in M2 repositories -->
        <dependency org="oracle/logging-utils" name="oracle.logging-utils" rev="11.1.1" conf="compile->default" />
        <dependency org="oracle/dms" name="dms" rev="11.1.1" conf="compile->default" />
        <dependency org="oracle/webservices" name="orawsdl" rev="11.1.1" conf="compile->default" />
        <dependency org="oracle/mds" name="mdsrt" rev="11.1.1" conf="compile->default" />
        <dependency org="oracle/jmx" name="jmxframework" rev="11.1.1" conf="compile->default" />
        <dependency org="oracle/adf/share" name="adf-share-base" rev="11.1.1" conf="compile->default" />
        <dependency org="oracle/adf/share" name="adf-logging-handler" rev="11.1.1" conf="compile->default" />
        <dependency org="oracle/odl" name="ojdl" rev="11.1.1" conf="compile->default" />
        <dependency org="oracle/http-client" name="oracle-httpclient" rev="11.1.1" conf="compile,deploy->default" />
        <dependency org="oracle/wsm/common" name="wsm-policy-core" rev="11.1.1" conf="compile->default" />
        <dependency org="oracle/classloader" name="oracle-classloader" rev="11.1.1" conf="compile->default" />
        <dependency org="com/bea/core" name="com-bea-core-apache-commons-lang" rev="2.1.0" conf="compile->default" />
        <dependency org="com/bea/core" name="com-bea-core-xml-xmlbeans" rev="2.2.0.0" conf="compile->default" />
    </dependencies>
</ivy-module>

NOTE: I haven’t managed to get Ivy to load configurations for the taskdefs yet (see below). I’ll update this post when I get it to work

NOTE: Only the configurations for compile/package and deploy are included in this. It’s pretty easy to add the declarations for the other paths you need to set. I’ll repost this once it’s complete.

The final step was to add Ivy support to the out-of-the-box ant files.  To do this we;

  1. Added the ivy.jar to our ant/lib directory
  2. Added the Ivy namespace to the ant file: 
  3. <project xmlns:ivy="antlib:org.apache.ivy.ant"
             name="ant-scac"
             default="scac">

  4. Removed the elements setting all classpaths (e.g. scac.tasks.class.path in ant-scac-compile.xml)
  5. Added a new path declaration just for the taskdefs. E.g.: 
  6. <!-- Set the Path we need for the Ant Taskdefs -->
        <property name="oracle.ant.taskdef.path" refid="oracle.ant.taskdef.path"/>
        <path id="oracle.ant.taskdef.path">
            <fileset dir="${applications.home}/lib">
                <include name="fabric-runtime.jar"/>
                <include name="soa-infra-mgmt.jar"/>
                <include name="soa-infra-tools.jar"/>
            </fileset>
        </path>

  7. Updated the taskdef declaration elements to use this new path. E.g:  <taskdef name="scac" classname="oracle.soa.scac.scac" classpath="${oracle.ant.taskdef.path}" />
  8. Added a new “init” task which sets the path we removed earlier (e.g. scac.tasks.class.path in ant-scac-compile.xml):
  9. <target name="init" description="Sets up the compilation classpath">
            <ivy:resolve />
            <ivy:cachepath conf="compile" pathid="scac.tasks.class.path" />
            <property name="scac.tasks.class.path" refid="scac.tasks.class.path"/>
        </target>

  10. Updated the targets to have a dependency on “init”. E.g.:
  11. <target name="scac" description="Compile and validate a composite" depends="init">
            <scac input="${scac.input}"
                  outXml="${scac.output}"
                  error="${scac.error}"
                  appHome="${compositeDir}"
                  failonerror="true"
                  displayLevel="${scac.displayLevel}">
            </scac>
        </target>

And that’s it. Unfortunately there’s not a zip file you can download with a few bat/sh files to run, but maybe I’ll get there one day. In the meantime, this should help you to get where we have.

Read More
Posted in | No comments

Wednesday, 18 November 2009

The Goods Delivered – SOA Suite “ant-sca-compile.xml” File Simplified (Plus Ivy Dependency Management)

Posted on 08:34 by Unknown

As promised in my last post, I’ve been continuing to work on getting Oracle SOA Suite (11g) projects to build outside the JDeveloper IDE.  I’ve spent some time getting the ant-sca-compile.xml file to work first and thought I’d share the results.

I’ve rushed a little to publish this so there are still a few things you’ll have to do manually if you want this to work for you, but it does work. Trust me.  If I get a chance, I’ll keep blogging things as I progress and hopefully you’ll have to do less and less work if you want to do the same as us.

What I have now comes in three parts:

1. A simplified ant-sca-compile.xml file

<?xml version="1.0" encoding="iso-8859-1"?>
<project xmlns:ivy="antlib:org.apache.ivy.ant"
         name="ant-scac"
         default="scac">

    <!-- Set all the Properties we need -->
    <property file="build.properties"/>
    <!--propertycopy name="proj.revision" from="${project}.revision"/-->
    <property name="oracle.home" value="${applications.home}/lib"/> <!-- Monkey patch to remove need for full JDeveloper install -->
    <property name="config.dir" value="C:/oracle/Middleware/jdeveloper/integration/seed/soa/configuration/" />  
    <property name="compositeDir" value="${applications.home}/${compositeName}" />
    <property name="scac.input" value="${compositeDir}/composite.xml"/>
    <condition property="scac.displayLevel" value="3">
        <not>
            <isset property="scac.displayLevel"/>
        </not>
    </condition>
    <condition property="scac.overwrite" value="true">
        <not>
            <isset property="scac.overwrite"/>
        </not>
    </condition>
    <condition property="scac.error" value="${tmp.output.dir}/${compositeName}.error">
        <not>
            <isset property="scac.error"/>
        </not>
    </condition>
    <condition property="scac.output" value="${tmp.output.dir}/${compositeName}.xml" >
        <not>
            <isset property="scac.output"/>
        </not>
    </condition>
    <condition property="scac.sar" value="${tmp.output.dir}/${compositeName}.sar" > 
        <not>
            <isset property="scac.sar"/>
        </not>
    </condition>
    <condition property="scac.plan" value="${tmp.output.dir}/${compositeName}.plan" >
        <not>
            <isset property="scac.plan"/>
        </not>
    </condition>

    <!-- Set the Path we need for the Ant Taskdefs -->
    <property name="oracle.ant.taskdef.path" refid="oracle.ant.taskdef.path"/>
    <path id="oracle.ant.taskdef.path">
        <fileset dir="${applications.home}/lib">
            <include name="fabric-runtime.jar"/>
            <include name="soa-infra-mgmt.jar"/>
            <include name="soa-infra-tools.jar"/>
        </fileset>
    </path>

    <!-- Oracle SOA Suite Project Compilation Targets -->
    <target name="generateplanfromsar" description="Generate soa config plan from a soa archive">
        <ivy:resolve />
        <generateplan sar="${scac.sar}"
                      planfile="${scac.plan}"
                      verbose="true"
                      overwrite="${scac.overwrite}"/>
    </target>

    <target name="generateplan" description="Generate soa config plan from a composite">
        <ivy:resolve />
        <generateplan composite="${scac.input}"
                      planfile="${scac.plan}"
                      verbose="true"
                      overwrite="${scac.overwrite}"/>
    </target>
    <target name="attachplan" description="Attach a soa config plan to a soa archive">
        <ivy:resolve />
        <attachplan planfile="${scac.plan}"
                    sar="${scac.sar}"
                    verbose="true"
                    overwrite="${scac.overwrite}"/>
    </target>

    <target name="extractplan" description="Extract a soa config plan from a soa archive">
        <ivy:resolve />
        <extractplan planfile="${scac.plan}"
                     sar="${scac.sar}"
                     verbose="true"
                     overwrite="${scac.overwrite}"/>
    </target>

    <target name="validateplanfromsar" description="Validate a soa config plan for a soa archive">
        <ivy:resolve />
        <validateplan sar="${scac.sar}"
                      planfile="${scac.plan}"
                      reportfile="${scac.output}"
                      verbose="true"
                      overwrite="${scac.overwrite}"/>
    </target>

    <target name="validateplan" description="Validate a soa config plan for a composite">
        <ivy:resolve />
        <validateplan composite="${scac.input}"
                      planfile="${scac.plan}"
                      reportfile="${scac.output}"
                      verbose="true"
                      overwrite="${scac.overwrite}"/>
    </target>
    <target name="scac" description="Compile and validate a composite" depends="init">
        <property name="scac.tasks.class.path" refid="scac.tasks.class.path"/>
        <scac input="${scac.input}"
              outXml="${scac.output}"
              error="${scac.error}"
              appHome="${compositeDir}"
              failonerror="true"
              displayLevel="${scac.displayLevel}">
        </scac>
    </target>

    <target name="init" description="Sets up the compilation classpath">
        <property name="ivy.local.default.root" value="C:/Documents and Settings/aharmel/.m2/repository" />
        <property name="ivy.local.default.artifact.pattern" value="[organisation]/[module]/[revision]/[artifact]-[revision].[ext]" />
        <ivy:resolve />
        <ivy:cachepath conf="compile" pathid="scac.tasks.class.path" />
    </target>

    <!-- taskdefs mapping script Ant targets to Oracle Ant implementataion classes -->
    <taskdef name="scac" classname="oracle.soa.scac.scac" classpath="${oracle.ant.taskdef.path}" />
    <taskdef name="attachplan" classname="oracle.soa.deployplan.task.attachPlan" classpath="${oracle.ant.taskdef.path}" />
    <taskdef name="extractplan" classname="oracle.soa.deployplan.task.extractPlan" classpath="${oracle.ant.taskdef.path}" />
    <taskdef name="generateplan" classname="oracle.soa.deployplan.task.generatePlan" classpath="${oracle.ant.taskdef.path}" />
    <taskdef name="validateplan" classname="oracle.soa.deployplan.task.reportPlan" classpath="${oracle.ant.taskdef.path}" />
</project>

NOTE: I haven’t yet figured out how to get Ivy to manage the three dependencies for the  Oracle Ant Tasks themselves. I’ll update later once I have time to fix this.  Until then you also need to copy the three required jars into a new “lib” directory in your Composite Project

NOTE: The Monkey patch requires that you create a new “lib” directory in your Composite Project and add “./soa/modules/oracle.soa.bpel_11.1.1/orabpel.jar” to it. You’ll find this in your JDeveloper install

2. Dependencies managed in a new ivy.xml file

<ivy-module version="2.0">
    <info organisation="copfs" module="cmrs-dummy" />

    <configurations>
        <conf name="base" description="JARs required at both compile and runtime" />
        <conf name="taskdefs" description="JARs required for Ant Taskdefs" />
        <conf name="compile" description="JARs required at compile time" />
        <conf name="runtime" description="JARs required at runtime" />
    </configurations>

    <dependencies>
        <dependency org="oracle.soa.bpel" name="orabpel" rev="11.1.1" conf="compile->default" />
        <dependency org="oracle.soa.bpel" name="orabpel-validator" rev="11.1.1" conf="compile->default" />
        <dependency org="oracle.soa.bpel" name="orabpel-common" rev="11.1.1" conf="compile->default" />
        <dependency org="oracle.soa.bpel" name="orabpel-thirdparty" rev="11.1.1" conf="compile->default" />
        <dependency org="oracle.soa.fabric" name="fabric-runtime" rev="11.1.1" conf="compile,taskdefs->default" />
        <dependency org="oracle.soa.mgmt" name="soa-infra-mgmt" rev="11.1.1" conf="compile,taskdefs->default" />
        <dependency org="oracle.soa.fabric" name="soa-infra-tools" rev="11.1.1" conf="compile,taskdefs->default" />
        <dependency org="oracle.soa.fabric" name="testfwk-xbeans" rev="11.1.1" conf="compile->default" />
        <dependency org="oracle.fabriccommon" name="fabric-common" rev="11.1.1" conf="compile->default" />
        <dependency org="oracle.fabriccommon" name="fabric-common" rev="11.1.1" conf="compile->default" />
        <dependency org="oracle.xdk" name="xmlparserv2" rev="11.1.0" conf="compile->default" />
        <dependency org="commons-logging" name="commons-logging" rev="1.0.4" conf="compile->default" />
        <dependency org="commons-digester" name="commons-digester" rev="1.7" conf="compile->default" />
        <dependency org="oracle.commonj-sdo" name="commonj-sdo" rev="2.1.0" conf="compile->default" /> <!-- This is a hack as the Oracle JDeveloper one is different from the one in M2 repositories -->
        <dependency org="oracle.logging-utils" name="oracle.logging-utils" rev="11.1.1" conf="compile->default" />
        <dependency org="oracle.dms" name="dms" rev="11.1.1" conf="compile->default" />
        <dependency org="oracle.webservices" name="orawsdl" rev="11.1.1" conf="compile->default" />
        <dependency org="oracle.mds" name="mdsrt" rev="11.1.1" conf="compile->default" />
        <dependency org="oracle.jmx" name="jmxframework" rev="11.1.1" conf="compile->default" />
        <dependency org="oracle.adf.share" name="adf-share-base" rev="11.1.1" conf="compile->default" />
        <dependency org="oracle.adf.share" name="adf-logging-handler" rev="11.1.1" conf="compile->default" />
        <dependency org="oracle.odl" name="ojdl" rev="11.1.1" conf="compile->default" />
        <dependency org="oracle.http-client" name="oracle-httpclient" rev="11.1.1" conf="compile->default" />
        <dependency org="oracle.wsm.common" name="wsm-policy-core" rev="11.1.1" conf="compile->default" />
        <dependency org="oracle.classloader" name="oracle-classloader" rev="11.1.1" conf="compile->default" />
        <dependency org="com.bea.core" name="com-bea-core-apache-commons-lang" rev="2.1.0" conf="compile->default" />
        <dependency org="com.bea.core" name="com-bea-core-xml-xmlbeans" rev="2.2.0.0" conf="compile->default" />
    </dependencies>
</ivy-module>

NOTE: These are only the dependencies for the “scac” target. More may be required for the other targets.

NOTE: I used a local maven 2 repository as my Ivy repository. I had to import the JARs which came with JDeveloper into this in the structure indicated by the “dependency” entries.  The aim was to keep things structured nicely, add version info to JARs which lacked this.

NOTE: I tried to reuse standard external JARs from the various M2 repositories where possible. In the case of the com-bea-core libraries and oracle.commonj-sdo library this was not possible.  It seems for example that the latter has an additional package added to it (“helper”) even though the version number and name of this JAR is the same as you find on the web.

3. A Pared-down build-properties file

# temp
tmp.output.dir=c:/

# Project
applications.home=C:/Jazz/MyWorkspace-16-09-2009/WpfAutoDeployTestApp/TestApplication/
compositeName=GetEmployeeName
revision=1.0

deployment.plan.environment=dev

# dev deployment server weblogic
bea.home=C:/oracle/Middleware
dev.serverURL=
http://10.23.7.66:8001
dev.overwrite=true
dev.user=weblogic
dev.password=welcome1
dev.forceDefault=true

# acceptance deployment server weblogic
# acc.serverURL=
http://10.23.7.66:8001
# acc.overwrite=true
# acc.user=weblogic
# acc.password=welcome1
# acc.forceDefault=true

NOTE: See, the #global properties are gone. Nice eh?

NOTE: You’ll need to set the applications.home yourself as applicable. Not the nicest I know, but I’m moving fast here…

NOTE: I’ve hacked things so I need to provide the compositeName. This is not how it worked out of the box, and you could fix it to get this from your [App Name].properties file

Read More
Posted in | No comments

Tuesday, 17 November 2009

Monkey-Patching Oracle SOA Suite 11g Ant Files to Build Without JDeveloper

Posted on 03:19 by Unknown

I hate having to have more than the bare minimum installed on my build boxes. We’re using SOA Suite 11g and JDeveloper on our current project and much to my annoyance it seemed as if I’d have to install the Oracle IDE on all my build boxes in order to run the Ant scripts which it can generate. I didn’t like the idea of that, so I did some hacking and monkey patched them.

The Problem

I started at the beginning - with ant-sca-compile.xml and build.xml from JDeveloper.  Using these I could run Ant targets such as “scac” which meant my composite was compiled and verified.  The problem was, I needed to tell Ant where JDeveloper was installed. This in turn hid a mass of dependencies. 

I don’t like unmanaged dependencies. I like to know what goes into the various steps of my build.

The Solution

The first task was to move all the dependencies out of the JDeveloper install and into a project-local location. I created a “lib” directory in my Composite project for this purpose.  I then worked my way down through all the dependencies listed in “FileSet” elements in path “scac.tasks.class.path” in ant-sca-compile.xml  and copied them to ./lib.

Now I had to surgically extract all the references from ant-sca-compile.xml to the JDeveloper install.  I tackled all references to “oracle.home” first as I found this particularly galling. I created a new property called “applications.home” and set it to be the directory where ant-sca-compile.xml lived. I then worked down the definition of “scac.tasks.class.path” and changed all references from “${oracle.home}/…” to “${applications.home}/lib”, removing the additional directories as I went. (i.e. I ended up with “include name=”orabpel.jar””, etc.)

Every time I moved a large chunk of references I ran my built with Ant to check I’d not broken anything.  (Slowly, slowly, catchee monkee…)

Once I’d done this, I did the same for all the other elements in this path declaration. With this done, I then simplified things by removing all the checking of properties from the top of the file.

Now I was able to focus on the actual taskdef I was interested in: “scac”.  Firstly, I again simplified by removing the property checking. this left me with a single line; a call to the Oracle Ant task “scac”.

One by one, I took each of the parameters, and set them manually to extricate them from the mass of JDeveloper Ant complexity.  This involved:

  • creating my own version of scac.input – myscac.input which I set to point at the location of my composite.xml file
  • setting compositeName to the name of my SOA Suite Composite project (“GetEmployeeName” in my case)
  • setting compositeDir to the path to my SOA Suite Composite project
  • replacing scac.output with tmp.output.dir (pointing at “./”) combined with ${compositeName}.xml
  • replacing scac.error with tmp.output.dir combined with ${compositeName}.error
  • replacing scac.application.home with ${compositeDir}
  • setting displayLevel manually to be “3” (the maximum)

I was almost there. It all worked. All I needed to do was remove the now redundant properties.

The Real Problem

This is where the monkey patching came in. I realised as I removed the now redundant properties that something, somewhere still needed to be told what oracle.home was.  I guess this is buried deep in the Oracle Ant tasks themselves. I tried to take a look but a decompiler was no help. (I guess they’re obfuscated.)

The Real Solution

But I didn’t want to give up (and here comes the monkey patch.)  To find out what actually was in oracle.home (effectively the JDeveloper install which was needed for a successful build and validation I took a copy of all the files, pointed oracle.home at this copy, and then piece by piece removed bits until I had the barest minimum needed for the target to run. The end result?  All you needed was orabpel.jar. The thing was, it needed to be in a directory like this: ${oracle.home}/soa/modules/oracle.soa.bpel_11.1.1

Problem solved! All then had to do was create this directory structure in my project’s ./lib directory, copy orabpel.jar into it, and then set ${oracle.home} to point to ${applications.home}/lib and we were up and running.

Where Now?

Next step is to get all the other SOA Suite Ant scripts (ant-scac-package.xml, ant-scac-upgrade.xml, ant-scac-dploy.xml and ant-scac-test.xml) to work without being umbillically attached to a JDeveloper install.

After that I’m going to use some Ivy and put all these dependencies (with some meaningful jar names including version numbers) into a Maven repository.

Finally I hope to wrap up the Ant targets themselves as Maven 2.x plugins.  It’d be really nice if Oracle put all these dependencies in the Maven repositories already, but knowing how long it’s taken/taking Sun, and how non-open to the idea IBM are I’m not holding my breath.  I guess this means there will need to be a little setup script which you’ll need to run against JDeveloper to get all the bits you need in a Local Maven repo.

Expect more blog posts as I progress.  There will also (hopefully) be some Ant source once I tidy things up.

Read More
Posted in | No comments

Wednesday, 11 November 2009

RSA 7.5.4 and RTC 2.0.0.1 – Getting them to play nice too

Posted on 04:20 by Unknown

Following on from my last post, we’re unfortunately unable to have everyone on a single tools. Our architects and BA’s, who are going to use Rational Software Architect for UML modelling also need access to Rational Team Concert. I had a genius plan that I could install RSA on top of SpringSource Tool Suite or vice versa. No joy I’m afraid. I did however manage to install RTC 2.0.0.1 on top of RSA 7.5.4.  I managed it as follows:

Firstly I obtained RSA 7.5.4 (all 100 gigs of it…).  Then I copied all the zips to my desktop and unzipped them all. NOTE: if you have them unzipped but running from a CD they won’t work. (That’s a free tip for you).

Then I started the IBM Installer. The first thing it did was want to update itself from 1.3.1 to 1.3.2 (i.e. the IBM Installer, not RSA.) I let it go off and do its thing. (You might need to go to the “Help” menu item and set your proxy info if you’re behind a firewall at this point).

Once the Installer had updated it let me install RSA 7.5.4 itself. I made sure the RTC 1.0 client was installed. (I don’t know if this made a difference to the later upgrade to 2.0.0.1, but it’s worth having if you want to follow these steps exactly.)

After the RSA install was finished I was ready to lay my RTC 2.0.0.1 install over it. For this I needed to download the RTC Client Installer (NOT the zip). E.g.:

https://jazz.net/downloads/rational-team-concert/releases/2.0.0.1/RTC-Eclipse-Client-2.0.0.1-Win32-Local.zip

Once this was downloaded, I unzipped it and started the Installation Manager it contained. I ran through the installation steps, accepting all the defaults until it gave me the chance to either install a new Eclipse Platform (default but wrong) or on top of an existing one (non-default but right). We selected this option and added the path to the RSA eclipse.exe as requested (C:\Program Files\IBM\SDP\eclipse.exe is the default).

I then let the rest of the install proceed as normal.

Once it was completed I started up RSA and switched to the newly added “Work Items” perspective and connected to our RTC 2.0.0.1 server.

It worked!

Read More
Posted in | No comments

STS and RTC – Getting them to Play Nice

Posted on 03:02 by Unknown

We’re developing our new app using Spring 3.0 RC1 and we want the best tools available. We’ve picked the following:

  • SpringSource Tools Suite 2.2.1 (includes Maven 2.x)
  • IBM Rational Team Concert Client 2.0.0.1
  • Oracle Enterprise Pack for Eclipse 1.3.0
  • Emma Plugin 1.4.3
  • Findbugs Plugin 1.3.9
  • PMD Plugin 3.2.6
  • Checkstyle Plugin 5.0.3
  • JDepend Plugin 1.2.1

We want everything to work as seamlessly as possible. This involved getting everything to run on STS.

First we downloaded STS from SpringSource.  Once this was installed (all the defaults selected) we ran the updater to get it up to version 2.2.1 (Help > Check for Updates). We installed all the bits on offer.

Next we installed our code quality tools. In each case we added the Eclipse Update Site for the plugins in question:

Help > Install New Software > Add…

  • Emma – http://update.eclemma.org
  • Findbugs – http://findbugs.cs.umd.edu/eclipse
  • PMD – http://pmd.sourceforge.net/eclipse
  • Checkstyle – http://eclipse-cs.sf.net/update
  • JDepend – http://andrei.gmxhome.de/eclipse

And in each case, we added the plugins (versions at the top of this post.)  I restarted after each plugin install, just to be on the safe side.

Next we added the Oracle Enterprise Pack so we’d have support for Weblogic which is our deployment platform.  Just as before we added the Eclipse Update Site:

Help > Install New Software > Add…

  • Oracle Enterprise Pack – http://download.oracle.com/otn_software/oepe/galileo

Now for the fiddly bit.  We needed to frig things a little to get the RTC 2.0.0.1 elements working on an Eclipse 3.5 (galileo) platform.  Please note, this is utterly and shamefully based on the fine set of info on Jazz.net:

https://jazz.net/wiki/bin/view/Main/InstallRTC20IntoEclipse35

Firstly we needed to download the RTC 2.0.0.1 Client zip (NOT the Installer) from Jazz.net:

https://jazz.net/downloads/rational-team-concert/releases/2.0.0.1/RTC-Client-2.0.0.1-Win.zip

Once this was downloaded, we unzipped it to a location of our choice. (Desktop is good.)

Next we installed the necessary pre-reqs into STS so the RTC plugins would work.  We again went to Help > Install New Software …

First we installed EMF and DTP. We selected the Galileo site in the  “work with:” drop down

  • To install EMF, we expanded the Modeling category and selected EMF - Eclipse Modeling Framework SDK and the _ XSD - XML Schema Definition SDK_ entries
  • To install DTP, we selected the Database Development category
  • We then followed the wizard through to install these features and then restart

Next up was GEF. We selected the Galileo site again:

  • This time we unchecked the “Group items by category” option at the bottom of the wizard
  • And then typed “GEF” in the filter text area.
  • Then we selected the Graphical Editing Framework GEF SDK entry
  • And finally followed the wizard through to install GEF and then restart

Now we were finally ready to install RTC.

  • Firstly we closed STS
  • Then we simply copied the folders contained in our  downloaded and unzipped jazz/client/eclipse/jazz folder (e.g. build, scm, reports, etc.) to the our eclipse/dropins folder of our STS installation
  • Then we restarted STS. The “Wotrk Items” perspective was now available, and we could connect to our Jazz Project areas.

Easy.

Read More
Posted in | No comments

Saturday, 7 March 2009

Hitler's Broken Build

Posted on 06:11 by Unknown
I fear this may have been me in the past...

Read More
Posted in | No comments

Tuesday, 3 March 2009

Java Posse Roundup '09 - The Conference is Personal Again

Posted on 06:34 by Unknown
I've just attended day 0 of the Java Posse Roundup '09. I'd been told Open Spaces conferences felt like no other, but you need to experience it to really understand why. Here's a taster:
  • We all (or at least a lot of us) met up at Camp 4 Coffee. We filled the place to overflowing. The town know's something's up with all the geeks milling around
  • We got taken through a variety of Scala by Dick (Wall), Bill (Venners), Joel (Neely) and Diane (Marsh). When you got lost you could ask (this happened quite a lot with me). Then we worked on reverse engineering LINQ with Scala. We all contributed
  • We hacked on JavaFX to build a cool lightning talk app led by Joe (Nuxoll) as the designer and Tor as the lead developer
  • We had an introduction to Fan from Fred (Simon) who is a contributor
  • We had supper round at Bruce (Eckel)'s. He's laid up with a broken leg, so we cooked for him, grilling beside a massive snow bank, and chatting about cultural differences between the US and Europe. Then I chatted to James (Ward) and we have a mutual aquaintance (Steve Webster, the architect and originator of the Cairngorm framework for FLEX)
  • We finished up with a series of summary lightning talks from all the groups on what we'd done during the day
  • We adjourned to our house, and met another attendee on the way, chatted, and listened to the Coyotes out in the woods
All in all, it just feels different. I still had the tired, brain-full feeling you get from Java ONE, but that was combined with the feeling that you're participating and building relationships which will help you get even more out of events to come (and beyond). I still haven't got involved in any projects yet, but I aim to change that today. Bill (Venners) is looking for input on the tests for ScalaTest and it looks as good a time as any to try and get to grips with that. Fred (Simon) is also making noises about a Netbeans plugin for Fan. That might be interesting too. We'll see how much I manage to pack in...

Anyway, off to Camp 4 and day 1...
Read More
Posted in | No comments

Friday, 27 February 2009

Managing Parallel Development Streams With Shared Codebases in Jazz SCM

Posted on 06:49 by Unknown

We're in the situation where we have a common codebase (i.e. a shared set of Jazz components) which is being worked on by more than one development team, each of whom have different release dates. It is possible to set up Jazz to work for this situation, but it confused me at first. Here's how we managed it.



Create a "Next Release" Stream (for Integration and Releasing)
Firstly you need to create a "Next Release" Stream. No development happens on this stream, but it does contain all the components which all the other developments will be working on. It is purely for other streams to deliver into, and acceot changes from, and where releases are made. When a release is made, a new stream is created, named after the release, and any bug fixes made in that stream are flowed back into "Next Release".

Create the "Project Xxxxx" Streams as Required
For each development team (tasked with a certain package of work - called "Change Requests" in out project) create a new Stream containing the Components from the "Next Release" Stream as required. Name them after the Project and make the flow target the "Next Release" stream. Add build engines for each new Stream, each with their own workspace. We have two - one which compiles the code and runs just the unit tests and another which also deploys and runs the integration tests. The former is automatic on each check in. The other is scheduled to run at intervals.

Usage
Set up Jazz with seperate teams for each project. These in turn should have seperate dev lines and Iterations and Iteration Plans. Developers then create workspaces as required.

Development proceeds as normal, with developers delivering changes to their project's stream no a regular basis (twice a day is good) and accepting changes which are incoming. In addition, the team which is scheduled to release first periodically deliver their changes into the "Next Release" Stream (once a week? the volatility of the codebase and amount of shared components with other projects will dictate the frequency). The other teams then flow these changes into their workspaces, merging as required. They do not yet flow their changes into the "Next Release" Stream.

When the time comes, the release is made from the "Next Release" Stream. As mentioned before, a new Stream is created and populated with the new release's Components. Bugs subsequently found in this release are fixed in this Stream and flowed back into the "Next Release" Stream also.

What if Both Projects Release Simultaneously?
If both projects deliver simultaneously, then both teams should merge into the "Next Release" Stream as the periodic merge intervals, and accept the resulting changes which come from other projects. This should be done one project at a time to ensure that there is always a working set of functionality for the Next Release.
Read More
Posted in jazz, scm, tips | No comments
Newer Posts Older Posts Home
Subscribe to: Posts (Atom)

Popular Posts

  • Project Wonderland BOF (BOF-1306) @ JavaOne 2007
    These are my notes which I took during the Project Wonderland BOF at JavaOne 2007. Enjoy. Paul Byrne - Lead of Wonderland What is project w...
  • Maven 1.0.2: Adding a resource to a jar
    Want to add a resource such as an xml config file to your generated jar in Maven 1.0.2? Create a directory called ./resources in the base di...
  • Booting Apache Derby ("JavaDB") with your Java App's Startup
    If you're embedding the Derby RDBMS with your java desktop application and want it to start when you start your app, you need to make th...
  • EJB 3.0: One Model Inside and Out (Pt. 2) - The POJO Model Itself – Annotations and Relationships
    Please note, this blog entry is based heavily on many other things out there on the web at the moment, most particularly this tutorial on ne...
  • The Goods Delivered – SOA Suite “ant-sca-compile.xml” File Simplified (Plus Ivy Dependency Management)
    As promised in my last post , I’ve been continuing to work on getting Oracle SOA Suite (11g) projects to build outside the JDeveloper IDE.  ...
  • EJB3: Listing the Complete Contents of a Table
    It took me a while to work this out. Here is is for posterity: String queryString = "SELECT r FROM Recipe r WHERE r.id > 0"; Q...
  • Project Acta Diurna - Harnessing RSS Goodness for Project Glory
    Last week I was bitten three times in quick succession by a lack of knowledge about what was going on around me in the rest of the team. On ...
  • Project Acta Diurna - Investigation Pt. 1
    In my last post where I introduced my plan to produce a simple RSS based project dashboard I mentioned a few things which I thought would w...
  • (no title)
    Can Your Own Demo I found something great on t'internet the other day. I had been asked to do a demo of our new ystem to some users but...
  • EJB 3.0 - One Model Inside and Outside the Container (Pt. 1)
    I'm writing a suite of (i.e. two) applications which share an object model. I'm a trained J2EE architect and consequently I love th...

Categories

  • 0
  • 2008
  • ant maven pimp build javaone 2008
  • apple ipod touch
  • asm
  • blog new ruby
  • blogtag list
  • bond casinoroyale mashup mi6 film movie
  • build
  • bytecode
  • CI
  • cobertura
  • communityone 2008 nutter jvm scala jruby groovy davinci
  • communityone 2008 opensocial socialsite
  • communityone javaone keynote oreilly
  • configuration
  • cowley
  • css div layout column ie firefox safari example
  • custom
  • darkstar mpk20 wonderland java3d commaboration SL
  • dashboard rss communication news development
  • db2 database SQL max min howto tip
  • db2 database ibm lessons tips
  • db2 database load batch howto example
  • db2 import upload data howto command
  • debt technical java annotation
  • debugging tips javaone 2008
  • development web2.0
  • findbugs JavaOne 2008 pugh
  • findbugs JavaOne BOF notes
  • gafter closures java javaone notes
  • google trouble patriarchal patriarchy
  • groovy metaprogramming javaone 2008
  • grubby oss data generation project announce
  • guice javaone 2008
  • gwt maven howto example simple
  • howto
  • hudson
  • hudson CI javaone 2008
  • ibm
  • invokeDynamic jvm dynamic ruby javaone
  • itinerant web2.0 portable desktop
  • jacl was websphere wsadmin trace logging
  • james gosling sun java open source tech days second life SL
  • jar java manifest properties config howto tip
  • java
  • java applet javaone 2008 reloaded jnlp
  • java javafxscript javaone 2008 fxscript
  • java javaone 2007 07
  • java javaone 2008 bytecode cobertura asm singleton testability
  • javaone
  • javaone keynote gage schwarz javafx
  • javaone semantic web bof notes web3
  • jazz
  • jruby rails javaone charlesnutter thomasenebo
  • jruby ruby netbeans development
  • kill dead laptop computer rebuild restore
  • lessonslearned
  • mac osx java gui shellscript classpath problem solution
  • maven plugin unittest test packager
  • mylin mylar javaone eclipse 2008
  • netbeans development ide
  • netbeans development ide RC
  • netbeans maven2 profiling
  • netbeans ruby sun tech days visual web pack roman strobl
  • ola bini java javaone 2008 thoughtworks ruby jruby
  • openjdk java javaone javafx wonderland
  • overheard
  • pojo ejb3.0 jpa orm java example howto
  • rant
  • rest restful jsr311 java web2.0 javaone ts-6411
  • rome rss feed blog rss atom propono java javaone
  • rsa uml profile plugin howto
  • ruby inheritance example
  • ruby jruby rss xml hpricot
  • ruby unless example
  • scm
  • setup
  • subversion svn xp windows cleanup
  • sun java soa web2.0 netbeans opensource javacaps
  • sun tech days java derby database rdbms london
  • sun tech days london impressions
  • terracotta java javaone 2008 android gwt
  • tip
  • tips
  • vwp netbeans JPA howto
  • was jython scripting nfr ibm pmi jvm
  • was tpv jython scripting nfr ibm pmi
  • webrick ruby jruby actadiurna investigation code howto
  • workitem

Blog Archive

  • ▼  2012 (1)
    • ▼  October (1)
      • Writing Unit Tests to Ensure Your "@Transactional ...
  • ►  2010 (8)
    • ►  November (1)
    • ►  October (3)
    • ►  June (1)
    • ►  May (1)
    • ►  February (1)
    • ►  January (1)
  • ►  2009 (9)
    • ►  December (1)
    • ►  November (5)
    • ►  March (2)
    • ►  February (1)
  • ►  2008 (22)
    • ►  December (1)
    • ►  November (3)
    • ►  May (15)
    • ►  March (1)
    • ►  January (2)
  • ►  2007 (53)
    • ►  December (1)
    • ►  November (3)
    • ►  September (3)
    • ►  August (2)
    • ►  July (3)
    • ►  June (1)
    • ►  May (12)
    • ►  April (5)
    • ►  March (13)
    • ►  February (7)
    • ►  January (3)
  • ►  2006 (35)
    • ►  December (8)
    • ►  October (1)
    • ►  August (1)
    • ►  July (5)
    • ►  June (8)
    • ►  May (3)
    • ►  April (7)
    • ►  March (2)
Powered by Blogger.

About Me

Unknown
View my complete profile