Wednesday, February 28, 2007

Maven ftp:sitedeploy (HOWTO)

I published this article in June 2006 on internal company blog. I decided to re-publish it on my public blog because this way it could help wider audience.

Maven site:ftpdeploy goal does not work as expected?

Maven site plugin is used to generate and deploy a complete web site for project. There is a goal site:deploy (or site:ftpdeploy if you like) for this purpose but you can be disgusted by the fact that it may not work correctly when using maven 1.0.2.

Recently, I have been facing to this trouble and here is the workaround which works for me.

The root cause of this issue is quite well described in maven JIRA. In short Maven 1.0.2 is using ANT 1.5.3-1, which depends on NetComponents.jar. NetComponents.jar does not come with regular Maven distribution so you have to download it and pack into Maven configuration manually. The following mail thread discusses how to do it in detail.

In basic all you have to do is just copy NetComponents.jar into ${maven.home}/lib/ folder and modify ${maven.home}/bin/forehead.conf (add NetComponents.jar reference into [root] portion). This should make the site:ftpdeploy goal work as expected.

Interestingly, this issue should be fixed in Maven 1.1, unfortunately, as of writing it hasen't been officially released yet (RC1 is available). Developers are now more focused on M2 (Maven 2) which will probably introduce a lot of other headaches... :-)

If you are using site:ftpdeploy goal in you code then every member of your group should be familiar with this workaround and make modification of maven configuration on his/her local computer.

No comments: