Page Edited :
WICKET :
Windows Guide to Installing Wicket on Eclipse with Maven
Windows Guide to Installing Wicket on Eclipse with Maven has been edited by Dane Laverty (Mar 04, 2009). Content:Windows Guide to Installing Wicket on Eclipse with MavenDownload & Install MavenMaven is a project management tool. It does a million things, but I only know three of those things. We'll use Maven to get the Wicket Quickstart, convert it to an Eclipse project, and package our WARs. But first we need to get Maven. 1. Go to http://maven.apache.org/download.html. 2. Click the "apache-maven-2.0.10-bin.zip" link.
3. Click the link at the top of the page. 4. That will prompt you to download a file called apache-maven-2.0.10-bin.zip . Save it to your desktop. 5. Inside the zip file is a folder called apache-maven-2.0.10. Drag that folder and put it directly onto your C: drive-- 6. Add an environment variable called MAVEN_HOME with a value of C:\apache-maven-2.0.10 . You can learn how to set environment variables here: http://www.chem.gla.ac.uk/~louis/software/faq/q1.html#winXP 7. Add Maven's "bin" directory to your PATH environment variable. In this case, you can just paste 8. If you don't have a JAVA_HOME environment variable, then create one of those too, pointing at a JDK installation on your computer. 9. Now you have Maven ready to go. You can check that it's been installed correctly by opening a command prompt (Start -> Run... -> cmd) and typing in "mvn -version". That should display a couple lines of information about your Maven installation. Download EclipseEclipse is a great IDE for developing Java applications. 1. Go to http://www.eclipse.org/downloads/ . 2. Click the Eclipse IDE for Java Developers link. 3. Click the big green download arrow.
5. Inside the zip file is a folder called eclipse. Drag that folder and put it directly onto your C: drive---_C:\eclipse_ . 6. That's it. Now you can run Eclipse by going into the eclipse folder and running eclipse.exe. Download WTP (optional)WTP is an Eclipse plugin that provides nice web editing tools, including a good HTML editor. It's not necessary, it's nice to have. If you don't want WTP, skip this part. You can always come back and do it later. 1. Go to http://download.eclipse.org/webtools/downloads/ . 2. Click the 3.0.4 link. 5. That will prompt you to download a file called wtp-R-3.0.4-20090213193639.zip. Save it to your desktop. 6. Inside the zip file is a folder called eclipse. Drag that folder and put it directly onto your C: drive. A popup window will tell you that there's already a folder called eclipse there, and ask if you want to continue. Say yes. That will copy the contents of this eclipse folder into the eclipse folder that's already on your C: drive. 7. That's it. Now you will have access to the WTP tools when using Eclipse. M2Eclipse is an Eclipse plugin that allows you to run your Maven project from within Eclipse.
Build Wicket QuickstartWe're almost there. Everything you've done so far will never need to be done again. This section contains all the directions to start a new project. Whenever you want to start a new project, you can come back to these steps. The Wicket Quickstart contains all of the files and libraries necessary to make a Wicket project. It lives in the Maven repository, so we'll use Maven to download it and build it, and then we'll import it into Eclipse for you to play with.
Congratulations! You've installed the necessary software and built your first Wicket project. Now lets look at the project files and get it running.
That's just about everything. Now you're ready to go into your src/main/java and start building your application. However, there's one more change I suggest you make.
package edu.chemeketa; import java.lang.management.ManagementFactory; import javax.management.MBeanServer; import org.mortbay.jetty.Server; import org.mortbay.jetty.nio.SelectChannelConnector; import org.mortbay.jetty.webapp.WebAppContext; import org.mortbay.management.MBeanContainer; /** * Seperate startup class for people that want to run the examples * directly. */ public class Start { /** * Main function, starts the jetty server. * * @param args */ public static void main(String[] args) throws Exception { Server server = new Server(); SelectChannelConnector connector = new SelectChannelConnector(); connector.setPort(8080); server.addConnector(connector); WebAppContext web = new WebAppContext(); web.setContextPath("/"); web.setWar("src/main/webapp"); server.addHandler(web); MBeanServer mBeanServer = ManagementFactory .getPlatformMBeanServer(); MBeanContainer mBeanContainer = new MBeanContainer(mBeanServer); server.getContainer().addEventListener(mBeanContainer); mBeanContainer.start(); try { System.out.println(">>> STARTING EMBEDDED JETTY SERVER, PRESS ANY KEY TO STOP"); server.start(); while (System.in.available() == 0) { Thread.sleep(5000); } server.stop(); server.join(); } catch (Exception e) { e.printStackTrace(); System.exit(100); } } } |
Unsubscribe or edit your notifications preferences