All posts by Ralf Schäftlein

Using Cargo for Maven War Deployments to Tomcat 6.x

JEE based projects with maven build artifacts like war or ear files is the cargo plugin the right choice for automatic deployments during the build process.

First step is to define in the build section of your pom.xml the cargo plugin:


	org.codehaus.cargo
	cargo-maven2-plugin
	1.1.4
	
		
			tomcat6x
			remote
		
		
			runtime
			
				
				${cargo.manager.url}
				${cargo.username}
				${cargo.password}
			
		
		
			remote
			
				
					${project.groupId}
					${project.artifactId}
					war
					
						${project.artifactId}
					
				
			
		
	

Notice the variables with the url and the credentials. The will filled with the used profile section for the build:


	
		tomcat6x_remote
		
			true
		
		
			http://ubuntu-vm.localdomain:8080/manager
			tomcat
			tomcat
		
	
	
		tomcat6x_ide
		
			http://localhost:9999/manager
			tomcat
			tomcat
		
			

The activeByDefault settings marks the remote section as default profile if nothing is set by command line parameters.

With

mvn org.codehaus.cargo:cargo-maven2-plugin:redeploy

you first undeploy the current application and then deploy the new build application to the remote tomcat instance. The command line parameter-Ptomcat6x_ide force maven to use the local tomcat instance for deployments.

mvn -Ptomcat6x_ide org.codehaus.cargo:cargo-maven2-plugin:redeploy

Hudson or Jenkins as continuous integration server can then be setup to use a primary project with the goal “clean deploy” to have a full test and maven repo deployment on success. The seconday project have the goal “clean package org.codehaus.cargo:cargo-maven2-plugin:redeploy -Dmaven.test.skip=true”. Inside the configuration of the primary job is the section with post build actions. Define here the secondary project to be build only on success of the primary build. Deployments can go wrong and should not have any effect on the primary build. Build trigger for the primary project is source code changes checked every minute (“* * * * *” as time plan). Changes by each developer force a complete junit and integration test of the module and new deployed artifacts inside the maven repo like nexus for the rest of the team. A little bit later is then the new application ready to use. With different profiles is it possible to define DEV,QA and PROD target server inside one maven project pom.

Tomcat needs credentials of a user with explicit rights granted for successful remote deployments. See the following excerpt of the tomcat-user.xml inside the conf folder of your tomcat instance:

  
  
  
  
  
  

Centos 6.2 with Firefox 9 and Google Chrome 16

Centos recently published v6.2

 

Out of the box is Firefox 3.x and no Google Chrome installed.

Steps to install Google Chrome 16 (as root)

Steps to install Firefox 9 (as before as root).

To install the Virtual box Guest Additions:

  1. yum update
  2. yum install gcc
  3. yum install kernel-devel
  4. Mount Guest Additions iso image
  5. Run autostart on the cd
  6. Enter root password
  7. After install reboot vm

 

Samsung Galaxy S2 with vodafone firmware 2.3.5 and no gps…

I had recently updated my Samsung Galaxy S2 via Kies to Android 2.3.6 with vodafone branding. So far seems to be all working but GPS based Apps fails because of missing satellite fix. Looking around at twitter i found one tweet and with this several forums:

Vodafone UK

Android Hilfe (german)

Vodafone Germany (german): 1 / 2

The short term solution is to install the “GPS Test” app from the market and do the following steps:

  1. Hold the power button  (optional)
  2. Disable data transfer (optional)
  3. Enable GPS
  4. Start GPS Test
  5. Go to settings
  6. Push “Clear AGPS” button
  7. Push “Update AGPS” button
  8. Press home button
  9. Start GPS based app like Google Maps…
Vodafone UK had a seperate topic to notify customers with updates to the problem.
Other solution for vodafone customers is to root their phone, make an debranding and update to latest official firmware without any guarantee. SGS2 without branding seems to be not affected by that bug.
Update 03.12.2011:
Vodafone fixed the bug on server/provider side. Seems to be now working.

 

 

 

 

Control Hudson or Jenkins from Eclipse Indigo 3.7

For the latest eclipse release 3.7 called indigo is a plugin available to watch and control your build server based on hudson or jenkins. It is part of mylyn 3.5 as a view called “Builds”. See here for more information about the new features of mylyn 3.5. Their is as well a commercial plugin suite called tasktop available.

Howto install:

  1. Go to help -> install new software
  2. Click on “Available software sites”
  3. Click on add with name “mylyn” and url “http://download.eclipse.org/mylyn/releases/latest”
  4. Click ok to go back to site list
  5. Click ok to go back to available software
  6. Choose under “Work with” mylyn
  7. Choose under “Mylyn integrations” the point “Mylyn Builds Connector: Hudson/Jenkins (Incubation)”
  8. Choose under “Mylyn SDKs and Frameworks” the point  “Mylyn Builds (Incubation)”
  9. Click on next
  10. Go through install process and restart eclipse
  11. Choose from menu “Window” -> “show view”
  12. Choose “Mylyn” -> “Builds”
With the blue server icon on the left side of the title bar you can add a new build server. Choose “Hudson” inside the wizard and click next. Enter the url of your jenkins server and enter a label. Click on refresh at the right side under build plans. Choose your favorite builds and click on finish. After that you should have a view similar to the one above. You can start a new build and get updates as notification during the build process.

Canon LBP6650 under Ubuntu 11.04

Canon provide Debian Packages to install the driver under ubuntu for download. Offical supported is only the previous version 10.04 of ubuntu. Extracting the zip file you will find under

<language>/32-bit_Driver/Debian

the deb packages. First thing to install is cndrvcups-common_2.20-l_i386.deb with dpkg -i <deb file>. The problem is that ubuntu 11.04 doesn’t contain the required gs-esp package.

Workaround is to download and install it with

dpgk -i gs-esp_9.01~dfsg~svn12047-0ubuntu1_all.deb

After that you can install the common canon driver and afterwards the ufr driver:

dpgk -i cndrvcups-common_2.20-1_i386.deb dpgk -i cndrvcups-ufr2-uk_2.20-1_i386.deb

Now you can open the driver setup application and click on the add button. Choose network printer, enter the ip of your canon printer and click on examine. Select from the list below Canon and click on next. Select “LBP6650” and click on next. Confirm dialog with use button. Test your configuration with printing a test page.