jueves, 20 de febrero de 2014

Maven - Como saltear los test

Siempre que compilamos nuestro código con maven, se ejecutan previamente todos los test. Si alguno de ellos falla, se abortará la operación.



Lamentablemente, es muy común que necesitemos compilar pese a que los test no pasan.

Salteando los tests

Para saltear por completo los tests del proyecto se debe utilizar el siguiente argumento:

  

O definir el atributo skipTests en el maven-surefire-plugin.

pom.xml
Ahora, compila el proyecto nuevamente y todos los tests serán ignorados.

lunes, 26 de agosto de 2013

Cómo instalar informix en Ubuntu

Hola, esta es una nota extraída de otro blog (http://garysandi.blogspot.com.ar/2010/05/informix-ids-debian-o-deribados.html) a la cual le tuve que corregir algunas cosas mientras realizaba la instalación.

Dejo aquí la versión corregida.

Saludos



Informix IDS es una base de datos que se usa hasta el día de hoy para aplicaciones de tarea critica y en su mayoría para entidades financieras que requieren el máximo provecho de una BD poderosa, escalable, estable y por sobre todo, CONFIABLE.
A continuación un mini how-to que tengo para hacer la instalación de Informix IDS 11.5 Develper Edition.

1. Bajar Informix 11.5 IDS desde la web http://www.ibm.com/developerworks/downloads/im/ids/dev.html?S_TACT=105AGX28&S_CMP=TRIALS

2. Instalamos los requerimientos. 

apt-get install sun-java6-jdk libaio-dev libaio


Actualización: para versiones 11.50 o mayores ahora IBM incluye la JRE en el paquete de instalación instalar solamente lo siguiente:
apt-get install build-essential gcc g++ libstdc++6

3. Descomprimir el Tar bajado
tar xvf iif.11.50.UC3DE.Linux-RHEL4.tar


4. Ingresar al tar descomprimido
cd iif.11.50.UC3DE.Linux-RHEL4


5. Listar el contenido del directorio. iif.11.50.UC3DE.Linux-RHEL4#
ls
bundle.ini DBLD ids_install images README.html suite.jar
CSDK ICONNECT ids_install.command JDBC SERVER

6. Comenzar la instación. 

sh ids_install o tambien ./ids_install


7. Responder de la siguiente manera.
Do you want to run installer in GUI mode [y/n] :
n <=== luego pulsamos Enter

Initializing InstallShield Wizard........
Launching InstallShield Wizard........


Provide information to create the user informix. The password must contain at
least 8 characters.

User Informix home directory : [/home/informix]
<===pulsamos Enter


Password :<===pulsamos Enter
Please press Enter to Continue
Password:
<===Escribes tu Password

Confirm Password :<===pulsamos Enter
Please press Enter to Continue
Password:
<===Repites tu password


Press 1 for Next, 3 to Cancel or 4 to Redisplay [1]

1. Release Notes
2. Installation Guide
3. Launch Information Center
4. Begin Installation

Please select one of these options [4]
<===pulsamos Enter

Beginning installation...


Press 1 for Next, 3 to Cancel or 4 to Redisplay [1] <===pulsamos Enter

Welcome to the InstallShield Wizard for IBM Informix Dynamic Server Version
11.50 Bundle

The InstallShield Wizard will install IBM Informix Dynamic Server Version 11.50
Bundle on your computer.
To continue, choose Next.
Press 1 for Next, 2 for Previous, 3 to Cancel or 4 to Redisplay [1]

International License Agreement for Non-Warranted Programs

Part 1 - General Terms

BY DOWNLOADING, INSTALLING, COPYING, ACCESSING, OR USING THE PROGRAM
YOU AGREE TO THE TERMS OF THIS AGREEMENT. IF YOU ARE ACCEPTING THESE
TERMS ON BEHALF OF ANOTHER PERSON OR A COMPANY OR OTHER LEGAL
ENTITY, YOU REPRESENT AND WARRANT THAT YOU HAVE FULL AUTHORITY TO
BIND THAT PERSON, COMPANY, OR LEGAL ENTITY TO THESE TERMS. IF YOU DO
NOT AGREE TO THESE TERMS,



- DO NOT DOWNLOAD, INSTALL, COPY, ACCESS, OR USE THE PROGRAM; AND



- PROMPTLY RETURN THE PROGRAM AND PROOF OF ENTITLEMENT TO THE PARTY

Press Enter to continue viewing the license agreement, or, Enter "1" to accept
the agreement, "2" to decline it or "99" to go back to the previous screen, "3"
Print, "4" Read non-IBM terms.

1
<===pulsamos 1 y luego Enter

Press 1 for Next, 3 to Cancel or 4 to Redisplay [1] <===pulsamos Enter

IBM Informix Dynamic Server Version 11.50 Bundle Install Location

Please specify a directory or press Enter to accept the default directory.

Directory Name: [/opt/IBM/informix]
<===pulsamos Enter

Press 1 for Next, 3 to Cancel or 4 to Redisplay [1]
<===pulsamos Enter


Searching for products available for install: this may take a few minutes.

Select the products you would like to install:

To select/deselect a product or to change its setup type, type its number:

Product Setup Type
------------------------------------------------ ------------------------
1. [ ] IBM Informix IConnect Version 3.50
2. [x] IBM Informix Client-SDK Version 3.50 Typical
3. [x] IBM Informix Dynamic Server Version 11.50 Typical
4. [x] IBM Informix JDBC Driver Version 3.50

Other options:

0. Continue installing

Enter command [0]
<===pulsamos Enter


Press 1 for Next, 2 for Previous, 3 to Cancel or 4 to Redisplay [1]
<===pulsamos Enter


Checking for Server Prerequisites ...

Do you want to enable role separation for auditing procedures?

[ ] 1 - Yes
[X] 2 - No

To select an item enter its number, or 0 when you are finished: [0]
<===pulsamos Enter


If you enable role separation, you can assign existing groups of users to
specific roles.

If you do not enable role separation, the database server administrator
performs all administration tasks.

Press 1 for Next, 2 for Previous, 3 to Cancel or 4 to Redisplay [1]
<===pulsamos Enter

Do you want to create an IDS demonstration database server instance?

[ ] 1 - Yes
[X] 2 - No

To select an item enter its number, or 0 when you are finished: [0]
<===pulsamos Enter


You can use a demonstration database server instance to verify that IDS is
installed correctly and that the hardware is configured correctly. You can also
configure the demonstration database server instance to use it as a production
instance.

Press 1 for Next, 2 for Previous, 3 to Cancel or 4 to Redisplay [1]
<===pulsamos Enter

IBM Informix Dynamic Server Version 11.50 Bundle will be installed in the
following location:

/opt/IBM/informix

with the following features:

IBM Informix Client-SDK Version 3.50
IBM Informix Dynamic Server Version 11.50
IBM Informix JDBC Driver Version 3.50

for a total size:

417.9 MB

Press 1 for Next, 2 for Previous, 3 to Cancel or 4 to Redisplay [1]
<===pulsamos Enter

Installing IBM Informix Dynamic Server Version 11.50 Bundle. Please wait...

0 % complete
10 % complete
20 % complete
30 % complete
40 % complete
50 % complete
60 % complete
70 % complete
80 % complete
90 % complete
100 % complete


Installing IBM Informix Client-SDK Version 3.50. Please wait...

Installing IBM Informix JDBC Driver Version 3.50. Please wait...

Creating uninstaller...


Performing GSKit Installation ...
Performing GSKit installation for Linux ...
cp: cannot stat `/usr/local/ibm/gsk7/icc/icclib/libicclib.so': No such file or directory
cp: cannot stat `/usr/local/ibm/gsk7/icc/osslib/libcrypto*': No such file or directory
cp: cannot stat `/usr/local/ibm/gsk7/lib/libgsk7icc*.so': No such file or directory
cp: cannot stat `/usr/local/ibm/gsk7/icc/icclib/libicclib.so': No such file or directory
cp: cannot stat `/usr/local/ibm/gsk7/icc/osslib/libcrypto*': No such file or directory
cp: cannot stat `/usr/local/ibm/gsk7/lib/libgsk7icc*.so': No such file or directory


Branding Installed Files ...


Branding Files ...
Installing directory .
Installing directory etc
Installing directory bin
Installing directory lib
Installing directory lib/client
Installing directory lib/client/csm
Installing directory lib/esql
Installing directory lib/dmi
Installing directory lib/c++
Installing directory lib/cli
Installing directory release
Installing directory release/en_us
Installing directory release/en_us/0333
Installing directory incl
Installing directory incl/esql
Installing directory incl/dmi
Installing directory incl/c++
Installing directory incl/cli
Installing directory demo
Installing directory demo/esqlc
Installing directory demo/c++
Installing directory demo/cli
Installing directory doc
Installing directory doc/gls_api
Installing directory doc/gls_api/en_us
Installing directory doc/gls_api/en_us/0333
Installing directory tmp
Installing directory gsk
Installing directory gsk/client
Installing directory gskit
Installing directory gsk
Installing directory gsk/client

IBM Informix Product: IBM INFORMIX-Client SDK
Installation Directory: /opt/IBM/informix

Performing root portion of installation of IBM INFORMIX-Client SDK...


Installation of IBM INFORMIX-Client SDK complete.

Installing directory etc
Installing directory gls
Installing directory gls/cm3
Installing directory gls/cv9
Installing directory gls/dll
Installing directory gls/etc
Installing directory gls/lc11
Installing directory gls/lc11/cs_cz
Installing directory gls/lc11/da_dk
Installing directory gls/lc11/de_at
Installing directory gls/lc11/de_ch
Installing directory gls/lc11/de_de
Installing directory gls/lc11/en_au
Installing directory gls/lc11/en_gb
Installing directory gls/lc11/en_us
Installing directory gls/lc11/es_es
Installing directory gls/lc11/fi_fi
Installing directory gls/lc11/fr_be
Installing directory gls/lc11/fr_ca
Installing directory gls/lc11/fr_ch
Installing directory gls/lc11/fr_fr
Installing directory gls/lc11/is_is
Installing directory gls/lc11/it_it
Installing directory gls/lc11/ja_jp
Installing directory gls/lc11/ko_kr
Installing directory gls/lc11/nl_be
Installing directory gls/lc11/nl_nl
Installing directory gls/lc11/no_no
Installing directory gls/lc11/os
Installing directory gls/lc11/pl_pl
Installing directory gls/lc11/pt_br
Installing directory gls/lc11/pt_pt
Installing directory gls/lc11/ru_ru
Installing directory gls/lc11/sk_sk
Installing directory gls/lc11/sv_se
Installing directory gls/lc11/th_th
Installing directory gls/lc11/zh_cn
Installing directory gls/lc11/zh_tw

IBM Informix Product: Gls
Installation Directory: /opt/IBM/informix

Performing root portion of installation of Gls...


Installation of Gls complete.

Installing directory etc
Installing directory msg
Installing directory msg/en_us
Installing directory msg/en_us/0333

IBM Informix Product: messages
Installation Directory: /opt/IBM/informix

Performing root portion of installation of messages...


Installation of messages complete.

Please read the information below.

Set required environment variables
Set $INFORMIXDIR to the directory where the IDS server is installed.
Set $PATH to include $INFORMIXDIR/bin
Set $INFORMIXSERVER to the name of the database server
Set $ONCONFIG to the name of the active onconfig configuration file.
If using a sqlhosts file other than $INFORMIXDIR/etc/sqlhosts
Set $INFORMIXSQLHOSTS
If using a locale/language other than the default
Set $CLIENT_LOCALE
Set $DB_LOCALE
Set $SERVER_LOCALE
Set $DBLANG
Prepare connectivity files
sqlhosts
/etc/hosts
/etc/services
Prepare configuration file
Set DBSERVERNAME
Set SERVERNUM
Set ROOTNAME

Press ENTER to read the text [Type q to quit]

Set ROOTPATH
Set ROOTSIZE
Initialize database server
As informix or root, run oninit
If initializing a new server for the FIRST time, run oninit -i
This will overwrite any existing data, so use caution on an existing setup


For more information please refer to the IBM Informix Dynamic Server Getting
Started Guide

Press 1 for Next, 3 to Cancel or 4 to Redisplay [1]
<===pulsamos Enter

The InstallShield Wizard has successfully installed IBM Informix Dynamic Server
Version 11.50 Bundle. Choose Next to continue the wizard.

Press 1 for Next, 3 to Cancel or 4 to Redisplay [1]
<===pulsamos Enter

1. Release Notes
2. Installation Guide
3. Launch Information Center
4. Finish Installation

Please select one of these options [4]
<===pulsamos Enter

Finishing installation...


Press 3 to Finish or 4 to Redisplay [3]
<===pulsamos Enter

8. Editamos el archivo /etc/profile o el /home/usuario/.profile de cada usuario y ponemos lo siguiente luego de todo el contenido (luego de la ultima fila)

#############para levantar informix
export PATH=$PATH:$INFORMIXDIR/bin
unset USERNAME
export INFORMIXDIR=/opt/IBM/informix
export INFORMIXSERVER=informixserver #####Tomar en cuenta el nombre informixserver
export PATH=$INFORMIXDIR/bin:$PATH
export LD_LIBRARY_PATH=$INFORMIXDIR/lib:$INFORMIXDIR/lib/esql:$INFORMIXDIR/lib/tools
export SQLHOSTS=$INFORMIXDIR/etc/sqlhosts
export DBSCREENOUT=/u/tmp/${USER}.out


#########configuracion general
export ONCONFIG=onconfig
export DBDATE=DMY4/
export DBCENTURY=C
export DBEDIT=nano
export TERMCAP=/opt/IBM/informix/etc/termcap
export INFORMIXTERM=termcap
export TERM=vt100
export DBPATH=/u/bexe



9. Reiniciamos el equipo.

10. Probamos.
cd $INFORMIXDIR/etc

12. Editamos
nano sqlhosts

13. editamos y dejamos el final del archivo como se muestra: (El hostname de obtiene haciendo hostname -f en la consola.)

#=================================================
#DBSERVER PROTOCOL HOSTNAME SERVICE
#=================================================
informixserver onsoctcp localhost 9088 # el nombre del servidor y el puerto
informixserver_shm onipcshm
localhost dummy

#demo_on onipcshm on_hostname on_servername
#demo_se seipcpip se_hostname sqlexec


14. Copiamos onconfig
cp -p onconfig.std onconfig

15. Editamos onconfirg
nano onconfig

#editamos solo lo siguiente:
ROOTNAME rootdbs
ROOTPATH $INFORMIXDIR/data/chk01.chk01
ROOTOFFSET 0
ROOTSIZE 200000
MIRROR 0
MIRRORPATH $INFORMIXDIR/data/chk02.chk02
MIRROROFFSET 0

.....
TAPEDEV /dev/null
...
SERVERNUM 1
DBSERVERNAME gaya
DBSERVERALIASES gaya_shm


16. Preparamos los Chunks para el Servidor de Base de datos Informix de la siguiente manera.

cd
$INFORMIXDIR
mkdir data
touch data/chk01.chk01
touch data/chk02.chk02
chmod 660 data/
chmod 660 data/chk01.chk01
chmod 660 data/chk02.chk02
chown informix:informix data/chk01.chk01
chown informix:informix data/chk02.chk02


17. Editamos los Serv
ices de Debian
nano /etc/services

#añadimos al final lo siguiente
onsoctcp 1520/tcp
onipcshm 5121/tcp


19. Nos logeamos como informix.
su - informix

20. Inicializamos la BD Informix
oninit -ivy

Checking group membership to determine server run mode...succeeded
Reading configuration file '/opt/IBM/informix/etc/onconfig'...succeeded
Creating /INFORMIXTMP/.infxdirs...succeeded
Creating infos file "/opt/IBM/informix/etc/.infos.gaya"...succeeded
Linking conf file "/opt/IBM/informix/etc/.conf.gaya"...succeeded
Checking config parameters...succeeded
Writing to infos file...succeeded
Allocating and attaching to shared memory...succeeded
Creating resident pool 10570 kbytes...succeeded
Allocating 100016 kbytes for buffer pool of 2K page size...succeeded
Initializing rhead structure...succeeded
Initialization of Encryption...succeeded
Initializing ASF...succeeded
Initializing Dictionary Cache and SPL Routine Cache...succeeded
Bringing up ADM VP...succeeded
Creating VP classes...succeeded
Onlining 0 additional cpu vps...succeeded
Onlining 2 IO vps...succeeded
Forking main_loop thread...succeeded
Initializing DR structures...succeeded
Forking 1 'soctcp' listener threads...succeeded
Forking 1 'ipcshm' listener threads...succeeded
Starting tracing...succeeded
Initializing 8 flushers...succeeded
Initializing log/checkpoint information...succeeded
Initializing dbspaces...succeeded
Opening primary chunks...succeeded
Opening mirror chunks...succeeded
Validating chunks...succeeded
Creating database partition...succeeded
Initialize Async Log Flusher...succeeded
Starting B-tree Scanner...succeeded
Initializing DBSPACETEMP list...succeeded
Checking database partition index...succeeded
Initializing dataskip structure...succeeded
Checking for temporary tables to drop...succeeded
Forking onmode_mon thread...succeeded
Creating periodic thread...succeeded
Starting scheduling system...succeeded
Verbose output complete: mode = 5


Fin: si obtenemos Verbose output complete: mode = 5 ya podemos comenzar a usar la BD.
dbaccess
 
Si quieren configurar un datasource, la url sería:

jdbc:informix-sqli://localhost:9088/sysadmin:INFORMIXSERVER=informixserver

Saludos

jueves, 12 de enero de 2012

m2eclipse

m2eclipse... no nos une el amor sino el espanto

Dejo una nota sobre un problema que tuvimos tras la instalación del nuevo Artifactory (ver notas Artifactory I y Artifactory II). Despues de configurar los usuarios y los permisos, notamos con desagrado que no descargaba ninguna librería... (¿para qué quiero un repositorio de librerías si no puedo acceder a ellas?). Cada entrada a las librerías era completada en la estructura del .m2 de mi maquina con un archivo .lastUpdated

Al parecer hay diferencias entre las versiones de maven y la estructura que crea en el .m2... 

¿como resolvimos la cosa?
Entramos a .m2 y renombramos la carpeta repository creando una nueva completamente vacía... voila. 
El m2eclipse empezó a bajar todas las dependencias sin problemas...

lunes, 9 de enero de 2012

Instalación del Checkstyle

Incrementando la calidad del código

Introducción

Checkstyle es una herramienta de desarrollo que ayuda a los programadores a escribir código Java adecuándose a estándares de codificación establecidos, facilitando para ello la automatización del proceso de chequeo del código generado.
Checkstyle incorpora las recomendaciones de Sun sobre el estilo de código, pero estas reglas pueden ser redefinidas e incluso creadas completamente desde cero por el usuario, lo que convierte este plug-in en adaptable al estilo de codificación interno de nuestro entorno, sea cual sea.

Integración con IDEs

Checkstyle se integra a varios IDEs a través de distintos plugins de terceros.
Algunos de los más conocidos son:

Instalación del plug-in de Checkstyle para Eclipse

 
 
  1. En el Eclipse ir a Help->Software Updates...
  2. Agregar el sitio http://eclipse-cs.sf.net/update/
  3. Marcar la versión del plugin que se desea intalar
  4. Rever y confirmar los plugins a instalar.
  5. Reiniciar el Eclipse. 
 
 
 
 
 
 

Configuración

Entramos en Window->Preferences->Checkstyle para acceder a las opciones de configuración del Checkstyle. Checkstyle utiliza por omisión las convenciones de Sun (Sun Checks), pero podemos modificarlas  o crear un nuevo conjunto de reglas fácilmente. El plugin también incluye un conjunto de normas basadas en las convenciones de Sun, ligeramente modificadas para adaptarse mejor a la configuración por defecto del formateador de código de Eclipse: Sun Checks (Eclipse).

Para activar Checkstyle para un proyecto haremos clic con el botón derecho sobre él, seleccionaremos Properties y en la sección dedicada a Checkstyle marcaremos Checkstyle active for this project. En esta sección podemos seleccionar también el conjunto de normas que nuestro proyecto debe de seguir, asi como posibles excepciones.

Utilización
 
Una vez activado Checkstyle para el proyecto veremos los Warnings relativos a los estándares de código en la vista Problems, así como en el propio editor, donde las advertencias se muestran con fondo amarillo. También podemos recurrir a la vista Checkstyle violations (Window->Show view->Checkstyle->Checkstyle violations), que está más especializada y permite agrupar los problemas, generar informes en formato rtf, y lanzar la vista Checkstyle Violations Chart, con un gráfico de tarta con los distintos problemas encontrados en el código.