See how maven works inside – remote debugging plugins
Who uses maven as I do for a long time, knows that sometimes things does not go as expected. So it’s necessary to look at the ultimate documentation: the source code! In this post I’ll show how to debug a maven plugin using Eclipse’s remote debugger. I’ve chosen for this example the maven-clean-plugin.
Ok, let’s start. First create a simple sample project:
mvn archetype:create -DgroupId=com.wordpress -DartifactId=maven-debug
In the folder maven-debug, edit the pom.xml and add the dependency of the plugin. This will serve as an “anchor” to bring all the sources needed to debug.
<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
<version>2.1.1</version>
<scope>provided</scope>
</dependency>
Note the scope “provided”, meaning that the dependency will be given to the project by someone and it should not make to the final package. It shouldn’t matter, anyway, since this is a dependency that will be removed later, it’s just for debug purposes.
It’s important to know what version of the plugin your project is using. When in doubt, run “mvn -X clean” and note lines like:
[DEBUG] Retrieving parent-POM: org.apache.maven.plugins:maven-plugins::3 for project:
null:maven-clean-plugin:maven-plugin:2.1.1 from the repository.
Now generate the project in eclipse:
mvn -Declipse.downloadSources=true eclipse:eclipse
Open eclipse, go to File -> Import -> Existing Projects into Workspace and select the root directory of the project. After that go to menu
“Run –> Open debug dialog” and under “Remote java application” create a new profile to debug our project:

Using the eclipse search facilities, search for a class which name ends with “Mojo” (Maven Old Java Object) and place a breakpoint in the “execute” method. In the case of the clean plugin, this class is called CleanMojo
To debug, first enable debug on maven in the command line (linux shown here)
MAVEN_OPTS="-Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000"; export MAVEN_OPTS
and then do a “mvn clean”; the process will halt. Start the debugger in eclipse, it will hit the breakpoint.
Congratulations! Now you can know exactly what’s going on!
Watching live soccer in Gentoo – part 1 – SopCast
The portal myp2p.eu is a very interesting site where you can choose among several live sports and watching ‘em live, with very good quality. The matches can be seen with a myriad of softwares, among them: windows media, real audio, sopcast, tvants. In this post I’ll focus on SopCast.
Gentoo portage does not have an ebuild for sopcast (yet), but meanwhile there is a sopcast ebuild on gentoo bugzilla. To install it, download the file http://bugs.gentoo.org/attachment.cgi?id=137461 and save it to /usr/portage/media-tv/sopcast-1.1.1.ebuild.
Edit sopcast-1.1.1.ebuild and change the URL from
SRC_URI="http://download.sopcast.com/download/${MY_P}.tgz"
to
SRC_URI="http://download.sopcast.cn/download/${MY_P}.tgz"
As the packages are masked, first we have unmask them:
echo "=media-tv/sopcast-1.1.1" >> /etc/portage/package.keywords
Before emerging, go to the ebuild dir and generate the manifest:
ebuild sopcast-1.1.1.ebuild digest
and finally
emerge sopcast
Now the fun bergins!
Under myp2p.eu/competition.php?competitionid=∂=sports&discipline=football choose the match you want to see, copy the adress (that beggins with the “protocol” sop://) and run the command:
sp-sc sop://broker1.sopcast.com:3912/6001 1234 5678
that opens the stream from local port “1234″ to player port “5678″. Player port is where you will watch the video. So, to watch with Xine (my favorite), run:
xine http://localhost:5678
and that’s it! Nice game!
Gentoo and Sony Vaio VGN-FZ180E – part 4: Wireless
The latest kernel 2.6.24-r3 support the Intel Pro Wireless 4965, so it’s not needed to manually built 3rd part modules. Mark the following kernel opts:
Networking ---> Wireless ---> -*- Improved wireless configuration API [*] nl80211 new netlink interface support -*- Wireless extensions <*> Generic IEEE 802.11 Networking Stack (mac80211) [ ] Enable debugging output < > Generic IEEE 802.11 Networking Stack
and
Device Drivers ---> [*] Network device support ---> Wireless LAN ---> [*] Wireless LAN (IEEE 802.11) [*] Intel Wireless WiFi Link Drivers [*] Enable full debugging output in iwlwifi drivers [*] Enable Sensitivity Calibration in iwlwifi drivers [*] Enable Spectrum Measurement in iwlwifi drivers [*] Enable Wireless QoS in iwlwifi drivers <M> Intel Wireless WiFi 4965AGN
After reboot, “modprobe iwl4965″ and “modules-update”Emerge the packages “wpa_supplicant” and “wireless-tools”.
The wireless network can be discovery by using the command “iwlist wlan0 scan”. To connect to a network, declare it inside/etc/wpa_supplicant/wpa_supplicant.conf. Examples of networks declaration, with and without WEP:
network={
ssid="home_network"
key_mgmt=NONE
wep_key0=fffffffffffffffffffff01111
wep_tx_keyidx=0
} network={
ssid="Delle_Province Hotel"
key_mgmt=NONE
}
To activate wpa_supplicant as the “wireless connections manager”, the file /etc/conf.d/net must contain:
# Use dhcp for the wireless interface
config_wlan0=("dhcp")
# Declare wpa_supplicant module
modules=( "wpa_supplicant" )
# Wpa supplicant command line.
# wext referes to the wireless interface
# -dd enables verbose logging
# -c points to the configuration file
wpa_supplicant_wlan0="-Dwext -iwlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf -dd"
Ok, now we have support in the kernel, support in the net scripts. To start/stop wireless network, it’s enough to do a
/etc/init.d/net.wlan0 start
which is a symbolic link to net.lo.
Gentoo and Sony Vaio VGN-FZ180E – part 3: Connectivity with Bluetooth
Bluetooth is the only thing that is missing in this vaio model, but with a cheap bluetooth usb adapter, it’s possible to access the internet using a cell phone that supports GPRS/EDGE/UMTS/HSDPA (and bluetooth, obviously) from anywhere.
First, as always, a little kernel playing:
Networking ---> <*> Bluetooth subsystem support
--- Bluetooth subsystem support
<*> L2CAP protocol support
<*> SCO links support
<*> RFCOMM protocol support
[*] RFCOMM TTY support
<*> BNEP protocol support
[*] Multicast filter support
[*] Protocol filter support
<*> HIDP protocol support
Bluetooth device drivers --->
<*> HCI USB driver
[*] SCO (voice) support
<*> HCI SDIO driver
<*> HCI UART driver
[*] UART (H4) protocol support
[*] BCSP protocol support
[*] HCILL protocol support
Also enable PPP:
Device Drivers --->
[*] Network device support
<*> PPP (point-to-point protocol) support
[*] PPP filtering
<*> PPP support for async serial ports
<*> PPP support for sync tty ports
<*> PPP Deflate compression
<*> PPP BSD-Compress compression
Compile the kernel, reboot, and when pluging the USB Bluetooth dongle, something like this must appear in the log:
Mar 7 17:59:37 jupter usb 5-2: new full speed USB device using uhci_hcd and address 3
Mar 7 17:59:37 jupter usb 5-2: configuration #1 chosen from 1 choice
Mar 7 17:59:38 jupter hcid[10186]: Bluetooth HCI daemon
Mar 7 17:59:38 jupter hcid[10186]: HCI dev 0 up
Mar 7 17:59:38 jupter hcid[10186]: Starting security manager 0
Mar 7 17:59:38 jupter sdpd[10197]: Bluetooth SDP daemon
Emerge the package “bluez-utils”. Edit file /etc/bluetooth/pin and put a password that will be need to pair with the laptop via bluetooth.
The file /etc/bluetooth/rfcomm.conf must be changed to match the cell phone:
rfcomm0 {
# Automatically bind the device at startup
bind yes;
# Bluetooth address of the device
device 00:1C:9A:2D:36:58;
# RFCOMM channel for the connection
channel 4;
# Description of the connection
comment "My cell phone";
}
To find the device address, turn on the bluetooth on the cell phone and run the command “hcitool scan” on gentoo to print it.
Now it’s necessary to configure ppp.
For each connection there must be um sym link in /etc/init.d. Thus, to create a called “ppp1″ connection to Vodafone Italy, for example:
cd /etc/init.d
ln -s net.lo net.ppp1
The last thing is to configure the /etc/conf.d/net and declare the properties of the ppp session:
config_ppp1=("ppp")
link_ppp1="/dev/rfcomm0"
phone_number_ppp1=("*99***1#")
pppd_ppp1=(
"maxfail 10"
"noauth"
"lcp-echo-interval 5"
"lcp-echo-failure 12"
"debug"
"noipdefault"
"defaultroute"
"usepeerdns"
"ipcp-accept-remote"
"ipcp-accept-local"
"holdoff 3"
"noaccomp noccp nobsdcomp nodeflate nopcomp novj novjccomp"
"9600"
"lock"
"nocrtscts"
)
chat_ppp1=(
ABORT BUSY
ABORT 'NO CARRIER'
ABORT VOICE
ABORT 'NO DIALTONE'
ABORT 'NO DIAL TONE'
ABORT 'NO ANSWER'
'' ATZ
'OK' 'AT+CGDCONT=1,"IP","web.omnitel.it"'
OK "ATD*99***1#"
CONNECT ''
)
The IP address of the provider must be adapted depending of the country and company. The rest is pretty standard. The ones that I used so far:
TIM – BRAZIL: ‘OK’ ‘AT+CGDCONT=1,”IP”,”tim.br”‘
TIM – ITALY: ‘OK’ ‘AT+CGDCONT=1,”IP”,”ibox.tim.it”‘
VODAFONE-ITALY: ‘OK’ ‘AT+CGDCONT=1,”IP”,”web.omnitel.it”‘
Some providers requires username and password. In this case, they must be declared in pppd_ppp1 section with the keys
“username” and “password”.
Finally, to connect, start the service: /etc/init.d/net.ppp1 start
Gentoo and Sony Vaio VGN-FZ180E – part 2: Video
This vaio comes with a Nvidia GeForce 8400M GT and is listed this way under gentoo:
01:00.0 VGA compatible controller: nVidia Corporation Unknown device 0426 (rev a1)
It works nice with gentoo 2.6.24-r3 (latest stable kernel) by emerging nvidia-drivers. Since the most recent driver is still masked in portage, it’s need to add to file /etc/portage/package.keywords:
x11-drivers/nvidia-drivers
and then “emerge nvidia-drivers”. The version 169.2 will be installed.
WARNING: be sure that your kernel has the flags CONFIG_SYSVIPC=Y and CONFIG_UNIX=Y (Support for Unix domain socket. I don’t know why this two options are disable by default in the 2.6.24-r3 kernel)
To load the driver, “modprobe nvidia”
To instruct the X server to use nvidia libraries, use the command “eselect opengl set nvidia”. After that it’s needed to change Xorg.conf. Relevant parts is show below:
Section "Device"
Identifier "Device0"
Driver "nvidia"
VendorName "NVIDIA Corporation"
Option "AddARGBGLXVisuals" "true"
Option "UseEvents" "false"
Option "RenderAccel" "true"
Option "AllowGLXWithComposite" "true"
Option "TripleBuffer" "true"
EndSection
Section "Module"
Load "dbe"
Load "extmod"
Load "type1"
Load "freetype"
Load "glx"
EndSection
The emerge that installed the drivers also installed a nice utility under gnome, the Ndivia X Server Settings, that allow to change the brightness of the screen:
Gentoo and Sony Vaio VGN-FZ180E – part 1: Sound
This laptop comes with a sound card listed this way under Gentoo:
# lspci | grep -i audio
00:1b.0 Audio device: Intel Corporation 82801H (ICH8 Family) HD Audio Controller (rev 03)
Latest kernel 2.6.24.3 comes with Alsa 1.0.15, that works just fine to support this card.
So what is need is to enter kernel config and select the following choices:
Device Drivers ---> Sound ---> <M> Sound Card Support
Inside “Advanced Linux Sound Architecture” select the following modules:
<M> Advanced Linux Sound Architecture
<M>Sequencer Support
<M>OSS Mixer API
<M> OSS PCM
Inside “PCI Devices” select:
<M> Intel HD Audio
[ ] Build hwdep interface for HD-audio driver
[*] Build Realtek HD-audio codec support
[*] Build Analog Device HD-audio codec support
[*] Build IDT/Sigmatel HD-audio codec support
[*] Build VIA HD-audio codec support
[*] Build ATI HDMI HD-audio codec support
[*] Build Conexant HD-audio codec support
[*] Build C-Media HD-audio codec support
[*] Build Silicon Labs 3054 HD-modem codec support
[*] Enable generic HD-audio codec parser
That’s it for the kernel. After recompiling your kerner and reboot, edit file /etc/modprobe.d/alsa and add the following line:
options snd_hda_intel model=vaio
Load the module as “/etc/init.d/alsasound start”. Here are the modules loaded to me:
# lsmod
Module Size Used by
snd_hda_intel 269724 1
snd_pcm 61704 1 snd_hda_intel
snd_timer 19716 1 snd_pcm
snd 46948 5 snd_hda_intel,snd_pcm,snd_timer
soundcore 7264 1 snd
snd_page_alloc 10120 2 snd_hda_intel,snd_pcm
In order to change sound levels, one option is to use alsamixer, that comes with “emerge alsa-utils”. Here’s a screenshot:
After all that, the sound works nice from the main speaker, the earphone jack correctly mutes the main speaker when plugged, and the internal microphone that comes with this vaio also works well. You can test-it using Skype echo test.
Un altro rossonero nel camino di Zico?
E perché no il Milan? Vediamo…Come il Fenerbahçe il Milan è pieno di brasiliani. Zico ha già gocciato in Italia (nella Udinese), quindi conosce il calcio italiano e lui proprio ha già detto che fino ad oggi segue la Udinese nella seria A, e anche non bisognerebbe di un traduttore come ne bisogna oggi.
Il Milan, dopo aver perso la Champions, può finire la stagione in completo disastro, senza nemmeno qualificarsi per la prossima champions con una squadra cara, che sarebbe un disastro per le finanze, e in questo caso, non sono sicuro che Ancellotti rimarrebbe nel commando del rossonero italiano.
Patching WoW under Cedega
Patching World of Warcraft under Cedega has been annoyingly unreliable lately.
The irony is that it’s possible to patch it by simply using wine. After the usual error above comes up, simple google for the patch file (it ends with *patch.exe”), place it under WoW root folder and run:
gustavo@jupter ~/c_drive/World of Warcraft $ wine WoW-2.3.2.7741-to-2.3.3.7799-enUS-patch.exe
Sappia chi giocca adesso nel mondo
Lo ScoreCenter dell’ESPN é il sito più completo per chi vuole sapere il risultato delle partite che stanno accadendo in questo momento nel mondo del calcio. Il sito ha risultati di più di 150 paese.
Ad esempio, in questo momento sono le due di notte qua in Brasile, e tra ScoreCenter si può vedere che il Veracruz del Messico vince il Necaxa anche del Messico per 1 a 0 prossimo alla fine del partito
Va allo ScoreCenter
Non perdere mai l’ora col Gentoo
Per chi viaggia da un continente all’altro e porta con sé il computer, sa che non è difficile guardare l’orologio del Linux e rendere conto che l’ora è sbagliata. Per chi utilizza il Gentoo Linux, ecco come configurare l’orologio correttamente. La prima cosa è trovare in /usr/share/zoneinfo il file giusto. Per Roma, è “Europe/Rome”; per São Paulo à “America/Sao_Paulo”
Nel file /etc/profile, dove sono le configurazione del bash, bisogna dichiarare una variabile chiamata TZ:
TZ="Europe/Rome"
export TZ;
Le nuove configurazione saranno attivate dopo eseguire:
source /etc/profile
e d’ora in poi il commando “date” darà l’ora col timezone giusto:
Sun Mar 2 05:31:04 CET 2008













