Tuesday, November 2, 2010

maven deptools plugin 1.1 released

Version 1.1 of maven deptools plugin now supports maven 3 and the "maven enforcer plugin"


maven deptools plugin "...gives build error if maven resolves transient dependencies in such a way that the none-newest version is chosen."

This plugin has turned out to be very useful in the company I work for.

The plugin can be found here: http://github.com/mbknor/deptools

Thursday, March 18, 2010

maven deptools plugin - RC1 released

I've just released RC1 of a maven deptools plugin. (This is beta but I need real feedback)

"...Maven 2 plugin which gives build error if maven resolves transient dependencies in such a way that the none-newest version is chosen

At work we have all kinds of different dependencies problems related to transient dependencies...


More info here: http://wiki.github.com/mbknor/deptools/

Wednesday, February 3, 2010

Taking control over legacy code


The problem

Some years ago I faced a situation where a company's main public webapplication ran on a legacy mainframe (OS/390) webserver. It was written in REXX.

The developers had to do the actual coding in a terminal window (3270).

If a developer wanted to code in a regular Text Editor (TextPad), he had to first download the sourcefile via FTP, edit it, then FTP the new version back up to the mainframe to test it. To compile the uploaded sourcefile he had to use a terminal window and navigate to the file (dataset), then disable and enable it to force a recompile of the file.

One other major problem with the FTP-solution was that different developers did overwrite each others changes when they uploaded their new files.

Since the source was not managed by any source control system, it was basically impossible to figure out who had change the code and why.

As you can see this was not an ideal situation.

The ideal solution

The ideal solution is for sure to rewrite the application from scratch with modern technology, but this was not an option for the Company. They felt that they had invested too much in the existing code and that it would take too long time to rewrite it. Not to mention that they would have been unable to create new stuff while porting the old stuff.

Taking control over the legacy code

Since it was not an option to rewrite the application we needed to make it as convenient as possible to work with it.

This is what I ended up doing:

We downloaded all the code and added it to SubVersion. Then we "defined" that that the version stored in SubVersion was the "master (correct) version" of the code, not the version stored on the mainframe.

Then I wrote a deployment tool in Java that automated the deployment-process.

Since we could not prevent other developers (in other teams) to directly edit the code on the mainframe we had to have a mechanism to prevent us from silently overwrite their code changes. This was a critical feature when selling the "idea" to my leader.

To detect this the deployment tool automatically added some metadata to the sourcefile when uploading it to the mainframe. This metadata contained a hash-value (crc, fingerprint) representing the exact state of the sourcecode when uploaded. This made it possible to validate the existing mainframe version of the file before overwriting it with new versions.

The metadata was generated inside a comment (/* metadata */) since the altered source file still needed to compile.

The deployment tool could also be used to compile the source remote on the mainframe. This was done by using a linux component called s3270 which lets you script the terminal session. Since we needed to run the deployment tool on windows, the deployment tool ran s3270 using cygwin.

Since the upload- and compileprocess was slow, we wanted to prevent us from uploading and compiling unchanged files.

To fix this we also included subversion url- and revision-info in the metadata. This made it possible to resolve which files had changed and only upload- and compile those.

Conclution

By taking control over the source (adding it to SubVersion) and automating the deploy- and compile-process we ended up with an much better development environment.

This ended up only being the first step away from the mainframe. Today this old application still lives, only that it runs inside an Emulator running in Tomcat on a Windows Server.

I hope this blog post inspires someone.

Thursday, January 28, 2010

Replacing Weblogic with Glassfish

At work we're working on a rather big Java integration project. It consist of several applications, some exposing services over REST, others consuming REST services (JSF, Spring WebFlow).

In our development environment we run jetty and/or tomcat. Someone decided that we had to use Weblogic in Test- and Production-environment.

Here is a list of some of the problems Weblogic caused us:
  • It starts up/restarts extremely slow
  • The admin console is really slow
  • It takes forever to deploy to it
  • we had problems getting multiple datasources to different DB2-environments (OS390, AS400, Windows) to work at the same time.
  • Our applications ran slower than expected
  • We experienced strange problems related to ajax and richfaces which where impossible to trace down, since the problems where different on different Weblogic instances.
Today we managed to persuade our project leader that we should replace Weblogic with Glassfish v2.

Now everything is running much faster without problems on Glassfish in our Test environment. I really like what I have seen of Glassfish so far.

Thursday, November 6, 2008

opendns.com

Tenkte jeg skulle tipse om opendns.com. Det er en rask, sikker og gratis dns-service.

Hva er DNS?
DNS står for domain name system og er protokollen datamaskinene bruker for å oversette fra domenenavn til IP-adresser.

Alle PC'er må vite om sin DNS server for å fungere på internett.

Det vanlige er å bruke den DNS serveren som man automatisk får tildelt fra ISP'en sin.

Hva er fordelen med opendns.com?

Den er ofte veldig mye taskere en ISP'ene sin DNS server noe som fører til at du får en raskere internett opplevelse.

Den er sikrere: de er veldig flinke til å tenkte sikkerhet og oppdatere serverene sine hvis sikkerhetshull oppdages. Dette beskytter deg for eksempel mot DNS cache poisoning.

De vedlikeholder lister over farlige nettsteder slik at de stopper deg hvis du er på vei mot et slikt farlig sted.

Hvordan bruke opendns.com?

Man legger inn okonfigurerer routeren sin til å benytte opendns.com sine dns-servere istedenfor de som man automatisk har fått tildelt fra ISP'en. Da vil alle maskiner som kobbler seg på routere din automatisk benytte opendns.com sine DNS servere. Man endre konfigen i routeren en gang og trenger aldri mer å tenke på det...

Joel Spolskys mening om project managers

Jeg hørte på podcasten StackOverflow for første gang i dag. Jeg likte den godt og kommer helt sikkert til å fortsette å høre på den i fremtiden.

Jeg likte spessielt godt det Joel Spolsky sa om hans mening om project managers.
Hele episoden er på over en time, så jeg tok meg friheten til å klippe ut de aktelle 5m35s.

Hvis teknologien er på min side skal dere kunne høre på det her...

Monday, October 27, 2008

Google Calendar for mobil på Norsk

Jeg har begynt å bruke Google Calendar og liker det..

Jeg bruker hovedsaklig web-grensesnittet på pc'en, men da jeg skulle sjekke ut Google Calendar fra mobilen min (Sony Ericsson W910i) oppdaget jeg et problem: Det var umulig å legge inn nye hendelser.

Jeg kunne se eksisterende hendelser, men ikke legge inn nye. Dette var da merkelig.. I all dokumentasjon stod det at man skulle kunne legge til hendelser også.

Løsningen var å endre språket på Google Calendar fra Norsk til Engelsk. Dette må gjøres fra PC.

Når språket er endret til Engelsk, dukker "Add event"-knappen opp på mobilen.

PS: Husk å fikse datoformatet til "31/12-2008" når du endrer språk til Engelsk..

Det var imponerende lett å legge inn hendelser fra mobilen.

Skrev inn "Kaffe med venner 29/10 13:00" som tekst, klikket "Add event". Det var alt som skulle til for å få lagt inn hendelsen. Funket som F..