JUnit and Maven

Occasionally I will have a problem with a JUnit test running in Eclipse but not in Maven. Any relatively large project will have hundreds of unit tests and simply doing 'mvn test' runs all of the unit tests in the project. When you want to run a single test use the "-Dtest" parameter:

mvn -Dtest=MyTest test
In the above command "MyTest" is the name of the test class you want to run.

Skipping your unit tests is generally a bad idea but sometimes necessary. If you are running a mvn target that internally calls the test target but you want to skip the tests you can add the "-Dmaven.test.skip" parameter to your command.
mvn -Dmaven.test.skip install
For more information about Maven go here

source: Maven FAQ



Posted at at 11:23 AM on Wednesday, September 24, 2008 by Posted by Vince | 0 comments   | Filed under: , , ,

Interactive jQuery Selector Tester

jQuery is a very powerful JavaScript library. In particular, the jQuery selector mechanism allows developers to select DOM objects by a variety of criteria. For more complex selector strings it is often useful to have a way to test what exactly the jQuery selector will return and if it matches what you expect.

Recently I found this great tool online that does exactly that.

Posted at at 3:09 PM on Monday, September 22, 2008 by Posted by Vince | 0 comments   | Filed under: , ,

Installing Third-party Libraries into Maven2 Repo

To install a third-party jar into your local Maven repository perform the following command:

mvn install:install-file \
-Dfile=[path_to_jar] \
-DgroupId=[group_id] \
-DartifactId=[artifact_id] \
-Dversion=[version_number] \
-Dpackaging=jar

More information about the maven install-file plugin can be found here.

Posted at at 2:30 PM on by Posted by Vince | 0 comments   | Filed under: , ,