jueves, 31 de marzo de 2011

MySQL Portable

In my work we have very strict security policies regarding software installation on our desktops. That's a real PITA when you really need to do some experimentation with configuration.
I found over there a way to get a MySQL server running in your system without having to use an installator.
You'll need to get a noinstall version of MySQL. You can find it here: http://dev.mysql.com/downloads/mysql/5.1.html

Then, you have to unpack it. You can do it into a directory like c:\MySQLServer. To start it up, you could use a script like this one:
@echo off

echo Launching mysqld listening on port 3306
bin\mysqld --user=root --datadir=data --port=3306 --basedir=.
This script must be in the same directory in which MySQL is.
Now, you just have to run the script.
I'd really prefer to use some other scripting language like bash, but this is windows...

miércoles, 30 de marzo de 2011

Maven 2 and 3 coexisting on Windows (again)

As I said yesterday, we can make a script (er... batch file) for Windows to be able to use Maven2 into a Maven3 system without messing everything up.
For lazy ones, here it is:
@echo off
echo Setting environment for Maven2
set M2=C:\apache-maven-2.2.1\bin
set M2_HOME=C:\apache-maven-2.2.1
set PATH=%M2_HOME%\boot;%M2%;%PATH%
I hope you find this useful.

martes, 29 de marzo de 2011

Maven 2 and 3 coexisting on Windows

Recentely, I needed to deploy a workspace for a project which is using maven 2, and I'm using Maven 3 for my other projects.
I had to install maven 2, and I had to re set the variables M2 and M2_HOME to make them point to apache-maven-2.2.1\bin and apache-maven.2.2.1 respectively.

I did that, and I got this exception when i ran maven2:

Exception in thread "main" java.lang.NoClassDefFoundError: org/codehaus/classworlds/Launcher

To solve this I had to add to the PATH the following directory: apache-maven-2.2.1\boot.
With this change, maven 2 worked. You can put this environ set commands into a bat file, and run it always you need to use maven 2.