Archive for the ‘methodology’ Category

Continuous Integration

Wednesday, April 25th, 2007

Today we started choosing Continuous Integration server. I become a leader of this project, so we’ll see.

From brainstorming we choose for a month evaluation :

Which one wins, who knows. Personally I’m responsible for the Bamboo evaluation and what can i say today is that it’s made good impression for me. Nice interface (same as in JIRA), easy installation and configuration. Evaluation in progress….

Mavenization Idea

Friday, February 9th, 2007

Finally, we did it. Our project was gained maven nature. The process of conversation is NOT so simple, as I thought when I started. I share my experiences during this migration.

Mavenize your project structure

It is possible to make maven work with your actual project structure, but as I know now, the first maven rule is “Don’t fight with maven”.

When structure is mavenized your entire project looks the same way, and of course you find resources there where you suppose too.

Move your webapp part to src/main/webapp. In this directory you should have all the stuff going to web archive.

The hardest is how to separate java files which should be in src/main/java and java resources such properties, validations, and other stuff which should be in src/main/resources. In our company we have a tool which makes this for us. You can write yours, or use shell utils such as find, awk, and grep.

Next move all your ant stuff (properties, libraries) exclude build.xml to src/test/deprecated. Finally you should have clear maven Standard Directory Layout. For further information visit maven SDL site.

Useful tools

Without tools you are naked ;) . When you want make maven SDL you must use tools. Of course when you don’t want keep your versions control history you can do it just by deleting all files, moving them to SDL structure.

find – your first friend with -exec parameter.
sed & awk – sometimes we must rename path (for example sed ‘s/main/test/’ in.file >out.file)
grep - it’s always useful

When you work on windows, my suggestion is : if you don’t have cygwin, install it. Build generate.sh file with UNIX tools, which generate for you bat files. Run it in windows command shell and go for coffee brake.

Keep your build.xml alive

The most important task is modifying build.xml file to work with new file structure. When you do this, you can switch to maven structure when all your team is on the lunch. Second maybe more important, if you want have time to make another step, prepare good how to switch work from previous structure to maven way. IT’S THE MOST IMPORTANT. And remember it must be easy and complete. Test it, and at least one another person should test it.

Write your pom

Its easy part, write task from beginning to end, and don’t forget to tell someone to test it, because you may have special setting, which won’t work in another environment. Once you finish and check that pom.xml makes everything as build.xml. You should once again write proper documentation how to replace old task the new one. Makes profiles with filters.

Watch out, maven doesn’t recognize that you filtering filter. In this case he hangs on resource:resource phase depends on configuration.
And it is not obvious to catch this. So be careful.

Finally kill deprecated

At least after all this steps, you can kill deprecated directory. First libs I think, next the rest. Ok one thing if you run in trouble I suggest use -X option. Than you should live long and peacefully.

Pedro

about me

My name is Sebastian Pietrowski. I've finished Warsaw University as Master degree. I started my journey with Java 1.1 with Thread and JDBC programing in 1998 as I worked for merlin.pl. In 1999 I've passed Java Programer Certificate for Java 1.2, and was solution architect of merlin.pl infrastructure when we was moving from pl/sql to J2EE. It was great performance optimization with 10 times more req/sec than in requirements and 85 times faster as original solution.

Currently I work as Expert Software Development Java at F.Hoffmann-La Roche. The company was founded in 1896 and today, Roche employs over 80.000 people. After work I'm involved in activities related to Scala/Lift, Ruby/Rails/Merb, Python/Django. This is because I try to be pragmatic also I'm focused on application performance and tuning with success in my daily work.

My Yoda's motto: Do, or do not. There is no try.