Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

...

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

...

.

Image Added

 
3. Then click the wtp link under *Web App Developers

...

.*Image Added
4. Then click the big green arrow

...

.

Image Added
 

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. 

Install M2Eclipse

M2Eclipse is an Eclipse plugin that allows you to run your Maven project from within Eclipse.

1. Open Eclipse.
2. Go to the Help menu and select Software Updates...
3. A pop-up window will open. Make sure the Available Software tab is selected at the top of the pop-up window.
4. Click the "Add Site..." button on the right. That will pop up another window.
5. Paste

...

http://m2eclipse.sonatype.org/

...

sites/

...

m2e into the Location bar. Then click OK.
Image Added
6. This will add a line to the Available Software list titled Maven Integration for Eclipse Update Site
Image Added

7. Check the checkbox next to Maven Integration for Eclipse Update Site and click "Install...".
8. A window will pop-up saying that the items you selected may not be valid yadda yadda yadda. Click "Yes".
Image Added

9. Uncheck the boxes next to Maven Integration for AJDT and Maven SCM handler for Subclipse.
Image Added

10. Click "Finish". That's it. Now you've got everything ready to build your first Wicket application.

Build Wicket Quickstart

We'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.

1. Create a folder called on wicket on your C: drive to contain your Wicket projects---C:\wicket.
2. Now open a browser and go to http://wicket.apache.org/quickstart.html .

...

3. Under the "Creating the project" section of the page, enter a GroupId and an ArtifactId. The GroupId can be any string that reasonably identifies your organization. The ArtifactId will be the name of your project. Leave Version at 1.3.5. (You're welcome to try 1.4, but I haven't had much luck with that.)

Image Added
4. Now open a command prompt (Start -> Run... -> cmd) and navigate to _C:\wicket_.
5. Copy the text inside the "Command Line" textbox from step 3 above and paste it into your command prompt. Hit enter. Then wait as Maven downloads a bunch of stuff.Image Added
6. When that finishes, you will see that a new folder called firstWicketProject has been created in your C:\wicket_ folder. From your command prompt, navigate into _firstWicketProject.
7. Your command prompt should now be in C:\wicket\firstWicketProject. From here, type
mvn eclipse:eclipse
and hit Enter. Wait while Maven download more stuff.
8. Now open Eclipse, if you don't already have it open. Go to the File menue and select Import... A window will pop up with several folders.
9. Expand the top folder, named "General". Select the "Existing Projects into Workspace" option and click "Next".

Image Added
10. Click the "Browse..." button to the right of the "Select root directory" prompt.

Image Added
11. Navigate to C:\wicket\firstWicketProject and click "OK".
12. The Projects area of the window will now show "firstWicketProject" with a checkbox checked next to it. Click Finish. 

Running the Application

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 are two more changes I suggest you make.

  1. Open the pom.xml file in the project root directory and scroll toward the bottom, where you'll find:
    Code Block
    
    <plugin>
    	<groupId>org.apache.maven.plugins</groupId>
    	<artifactId>maven-eclipse-plugin</artifactId>
    	<configuration>
    		<downloadSources>true</downloadSources>
    	</configuration>
    </plugin>		
    
    and add the line
    Code Block
    
    <version>2.5.1</version>
    
    right after
    Code Block
    
    <artifactId>maven-eclipse-plugin</artifactId>
    
  2. Go back to src/test/java and open the Start.java file into the Eclipse editor.
  3. Delete the entire contents of the file and paste in the following instead. I find this change helps the embedded server to pick up your code changes without needing to be restarted.

...