Showing posts with label build tool. Show all posts
Showing posts with label build tool. Show all posts

Monday, March 23, 2009

Get 'This project needs to migrate WTP metadata' error on Eclipse/Maven 2

Today I took a look of old source code base which I had not maintain for such a long time. It is a mock object of a web service. I wrote an XML-RPC client for a vendor specific API, and I need a mock servlet to test the code.
Today I decided to mavenize the project, as now I believe that's the best way to maintain my source code base. Because the servlet is a web application, I create the maven source try.

Oh ya, by the way I'm using these:
Eclipse 3.4 (Ganymede)
Apache Maven 2.0.9
Eclipse IAM == Maven Integration for Eclipse plugin == Q4E plugin (still prefer to call it Q4E)

After creating the source tree base I created the Eclipse configuration file using the Maven's Eclipse plugin.
I just need to invoke this maven task:

[sourcecode lang="shell"]
mvn eclipse:eclipse
[/sourcecode]

Then I opened the project in Eclipse. I found my project caught a chicken pox (a part of the project got the red rashes - errors). I tried to rebuild, and got this message:

 This project needs to migrate WTP metadata


I knew I missed something, but it's been 2 months since last time I configured Maven 2 web application, and I have totally forgotten the exact steps to do it.

Later I realised that I need to specify the WTP version, so here's the solution:

1) Clean up the project file, run the Maven 2 Eclipse plugin clean task

[sourcecode lang="shell"]
mvn eclipse:clean
[/sourcecode]

2) Create the Eclipse configuration, now specifying the WTP version

[sourcecode lang="shell"]
mvn eclipse:eclipse -Dwtpversion=2.0
[/sourcecode]

3) Open the Maven 2 project in Eclipse IDE, refresh the project so that changes made on the file system is reflected in the Eclipse project as well

4) Remove the library references that contains M2_REPO

Because I'm using Q4E plugin and seemed that the Maven 2 Eclipse plugin was configured for use with other plugin (Mevenide or m2clipse), they specified the M2_REPO variable and repository which you don't need when using Q4E.

Just right click on the project, select Properties - Build Path, remove the libraries that contains M2_REPO.

4) Right click on the Project, select - Maven 2 - Use Maven Dependency Management

If it's already checked, then what you need to do is to uncheck it. After that refresh the project, and then check it again.

Wednesday, March 18, 2009

Hudson Build Stuck on the Build Queue

These few days we have had problem with our Hudson server. The build seems to be stuck in the build queue, there are some executors (I setup 2 executors) available though. I suspected that there are some thread starvation going on or lacking of worker thread in the application server?
We used Apache Tomcat 6.0 to run the Hudson server. We also run artifactory for local maven2 repository on the same application server.
These few days the problem could be temporarily fixed by restarting the application server. I did it several times, but seems this problem is a chronic problem that keeps recurring every 10-20 builds.

This morning I figured out something new, Hudson seems to complain that the executor was frozen (showing that both executors status is "Offline"). Then I take a look, I discovered that there is a configuration for the executor when you click on the [Build executor status] positioned on the bottom of the left menu.
From here I can see the problem clearly:
Hudson displays the name of the executor nodes (as it supports build on multiple nodes), the response time for each node, free swap space and free disk space and some other stuff.
On my machine Hudson showed a warning that the disk space is low (less than 1GB). So this is the reason why Hudson froze the executors. It prevents itself to bring down the machine buy hogging the disk space.

Then I try to find a solution for this problem. I know that on our Windows server Hudson is running as Default User on the user's home. So, there is high probability to fix this problem by moving Hudson to other user of moving this user's space to location other than C: drive.

The simplest working solution to this problem turned to be:

  • specifying Hudson home (other than the default $USER_HOME/.hudson) on the Apache Tomcat service configuration

  • specifying Artifactory home (other than the default $USER_HOME/.artifactory) on the Apache Tomcat service configuration

  • copy the content of $USER_HOME/.hudson to a new hudson home

  • copy the content of $USER_HOME/.artifactory to a new artifactory home

  • restart Apache Tomcat service

Tuesday, October 23, 2007

Apache Hudson Continuous Build

This week I have had intensive touch with Hudson. I need to setup a new environment for development. It is a continuous build application, from the open source free software (OSFS) stack.

Hudson could run on any JEE application servers, such as Tomcat or Jetty. The project is now under Apache Software Foundation. The license is Apache License v 2.0.  
In our enviroment we use Subversion, and Hudson integrate well with Subversion. It polls for changes in Subversion, and  build on changes so that we could know which commit breaks the build. Hudson could run Ant build project but support Maven 2 build as well. To configure Hudson to use Maven 2 build, you only need to specify the pom.xml file.