Wicket: Source to Eclipse Using Maven 2

by Tim O'Brien

Wicket graduated from the incubator, or so I've heard. I'm never 100% sure of what has or has not graduated. Anyway, unlike a number of widely used open source libraries, Wicket is easy to checkout from source, compile, install, and have running up in Eclipse because it happens to use Maven 2 as a build system. In other words, you don't have to fish around for instructions on running some byzantine Ant build, it's all summed up by the following commands:

(configure your M2_REPO classpath variable to point to your local repository)

Done - took you maybe 5 minutes start to finish...

And, that's the way it should be. No need to read some readme file to try to figure out what software needed to be installed, or what other projects need to be in what relative directories, etc...

maven 2 just works.

Update 9:09 PM: Thanks to Mr. Locke for correctly pointing out that I left out the import projects step in the comments.

20 Comments

Jonathan Locke
2007-07-21 18:44:48

You left out the final import projects step in Eclipse. One tiny hint for mac users there. Do not EVER check that box that says "copy projects into workspace"! Eclipse will set your file attributes wrong and everything will go haywire. Just import the projects in place without copying them and you'll be fine.

Eelco Hillenius
2007-07-21 19:18:09

Yep, Wicket graduated. We hope to make a little bit more noise when we actually get the top level domain working.

An alternative way to get your project started when you're using Maven 2 is to include this in your pom:

and then again use mvn eclipse:eclipse. It will also install the source jars.

Dean
2007-07-22 00:23:06

I've tried to checkout and compile many open source projects that use maven 2 as their build system. I can honestly say that not once have I been able to just build something after a clean checkout by doing mvn install. Normally getting a build involves pom-hacking or manually installing jars into your local repo. What's so hard about ant -projecthelp anyway?

bhaskar
2007-07-22 07:16:24

Or if you use netbeans with the maven plugin, just check out wicket source code from within netbeans, that's it you are done.
Seriously the maven support in netbeans so much better than eclipse. Any folder that has a pom.xml is automatically recognized as a maven project.
No need for mvn eclipse:eclipse , no need for .classpath and .project, and no need for M2_REPO..:-)

Nap Ramirez
2007-07-22 08:02:00

This new Maven2 plugin for eclipse would be useful:

http://code.google.com/p/q4e/wiki/Installation

With this, I think you'll never use the commandline again. ;)

Tim O'Brien
2007-07-22 11:47:08

@Dean, which projects. I've tried download and compiling both Hibernate and Spring lately. I ran into a few problems, but they had more to do with a proejct's half migration to Maven.

Take Spring for example, I can download the sources for Spring Batch and get up and running with the source in about 5 minutes. Spring Framework is another matter entirely, from what I see there's some sort of readme.txt file and a lib directory.

Anyway, Dean, I'd appreciate if you could call out those projects by name so I can go see what they are doing differently than Maven.

Eric
2007-07-23 06:23:30

If you have the most recent Eclipse Maven plugin (http://m2eclipse.codehaus.org/) and the most recent Maven Eclipse plugin (may still be in dev) but you can type: "mvn eclipse:m2eclipse" and it will configure your project for the Eclipse plugin... no more configuring Eclipse classpath - or re-running eclipse:eclipse when dependencies change.

Tim
2007-07-23 16:24:59

FWIW, if you want to build Wicket in NetBeans, it's very simple. NetBeans Maven support treats Maven projects as native NetBeans projects, just like the standard Ant-based ones:

@Paul, no I wouldn't recommend Maven: A Developer's Notebook. It is very outdated. Instead of that book, go take a look at the online book at Sonatype http://www.sonatype.com

Dan
2007-07-26 17:12:11

One of the problems I have with Maven is that the repositories aren't up to date. The current version of Spring is 2.0.6, but the version in the repository is 2.0.2, with a datestamp from six months ago!

Dan
2007-07-26 17:44:57

Can anyone provide any hints on how you're supposed to keep dependencies up to date?

The latest Hibernate in the ibiblio repository is six months old.

If I do a svn checkout of the current Hibernate source and run mvn install on it, it won't even build because it craps out when it tries to connect to ibiblio to resolve the dependencies declared by Hibernate, because they don't exist there in the versions its expecting.

I feel like I'm trying to install RPMs again. http://www.sonatype.com/book/ has been no help.

Help?

Tim O'Brien
2007-07-27 07:06:58

@Dan, the Sonatype book is great..

spring: http://repo1.maven.org/maven2/org/springframework/spring/

hibernate: http://repo1.maven.org/maven2/org/hibernate/hibernate/

If you want a search function on the repository: http://www.mvnrepository.com

Martijn Dashorst
2007-08-05 16:45:44

The graduation was the actual establishing the project as part of the Apache Software Foundation. After that, the project needed to move all resources to the new location, and was depending on the help of the (excellent!) infrastructure team of ASF. This has been completed, and we are finally established as a TLP: http://wicket.apache.org

As such, you'll need to update the SVN repo url in your article:

svn co http://svn.apache.org/repos/asf/wicket/trunk wicket

If you already have a version checked out, you can switch it with the following command: