views:

297

answers:

3

I want to create a web app that will use wicket, hibernate and spring frameworks. My IDE of choice is Eclipse, I am using maven for the .war generation and I am running Mac OS. What steps should I follow to correctly install and configure all the tools so as to have a project running that relies on these 3 frameworks. I was able to successfully set up wicket but I am having trouble for setting up hibernate and spring. I went through multiple tutorials but I still couldn't find the solution.

Thanks!

I will now try to explain a bit what is the problem I can't solve. I first began with a clean project:

  1. mvn archetype:create -DgroupId=test.framework -DartifactId=microForum
  2. Moved on to the project folder and mvn eclipse:eclipse
  3. Imported the project from eclipse
  4. Looked into the apache wicket homepage where there are multiple examples, so I read through the page and that was enough to learn what to add to the pom and had wicket and everything up and running nicely

My next step was trying to use hibernate and/or spring. I thought that "adding" hibernate and spring in the same way I added the wicket necessary configurations and dependencies to the pom (by hand) might not be that easy. So I tried using the maven archetype: appfuse-basic-spring. So:

  1. mvn archetype:generate -> launchs the wizard that lets you choose among different archetypes

After choosing the archetype number 2 ( Hibernate + Spring + Spring MVC) it fails

After googling a bit I found out why it fails (something like I should add a -archetype after appfuse-basic-spring. So, instead of using the wizard, I put:

  1. mvn archetype:generate -B -DarchetypeGroupId=org.appfuse.archetypes -DarchetypeArtifactId=appfuse-basic-spring*-archetype* -DarchetypeVersion=2.1.0-M1 -DgroupId=test.framework -DartifactId=microForum2

This created my project (after multiple warnings). I paste a screenshot (Image 1) because some of the information might have some important meaning :

http://img97.imageshack.us/img97/6687/screenshot20100323at112.png - Image 1

  1. I then did mvn eclipse:eclipse and it started downloading millions of things, which seemed very odd so I Control+C it.

Following schmimd04 answer I tried to use the eclipse maven plugin but I couldn't create a maven project:

Unable to create project from archetype [org.appfuse.archetypes:appfuse-basic-spring:RELEASE] The defined artifact is not an archetype

Thanks!

p.d: My Mac OS already had maven installed (version 2.2.0), I tried downloading the last one and repeating the same steps but I still had the same trouble.

A: 

As Pascal is saying, your question is to broad to answer. A few pointers that might help you:

  • use 'mvn eclipse:eclipse' to generate an Eclipse project out of your pom.xml. There might even be a working eclipse project that allows to open a pom.xml as eclipse project. I can't say, i left eclipse behind for good.

  • spring is 'just' a library that need to be in your classpath. the above command will ensure it is there (if it is defind as dependency in the pom.xml) You need to define a applicationContext.xml for Spring that resides in your classpath. See the Spring documentation for that.

  • hiberate is similar, it is just a library that needs to be in the classpath and that needs to find a config file. in there, the connection to the database is described. See the hibarnate docu (or one of the many blogs out there) for more info.

If you are stuck with a particular problem, please describe it so people can help here.

Bert

bert
+1  A: 

Install the Maven plugin for Eclipse from the update site (http://m2eclipse.sonatype.org/update).

This will allow you to create Maven projects (I would start with the quickstart archetype) and easily add dependencies, such as Hibernate, Spring, and Wicket.

schmimd04
A: 

Bert's recommendation LegUp, jweekend.com/dev/LegUp, have worked just fine for me. I used the wicket + Spring + JPA archetype. I will still look for the reason why maven's Hibernate+Spring+Spring MVC archetype didn't work for me. I'll edit this once I have the answer. For the time being, legup did the job!

Thanks

spderosso
I don't see the need for Spring MVC if you're using Wicket.
ireddick