Learning Maven Pre-Step) Download the MavenPlayCode.zip file to your JavaImmersions/Downloads folder and unzip it there. 1) In Eclipse create a new Maven Project with the following attributes: create a "simple" project by skipping the archetype selection groupId = org.example artifactId = mavenplay leave the rest of the fields as default 2) Examine the new project, note the following files/folders: src/main/java <- the root of my Java code src/main/resource <- non-Java files, like properties files, and images the above folders will be deployed src/test/java <- my unit test code src/test/resources <- files for testing only, and these will not go to production target <- this is where Maven will put it's reports src <- where compiled code will go, I do not work in this folder pom.xml <- the Maven config file 3) Copy the files from the CodeSample1 folder you unzipped in the Pre-Step into the Eclipse project These go into src/main/java You will need to create packages (in this order) to hold the following code: Package Class ------------------------------------------- org.example.maven MavenPlay org.example.maven.entities HumorRecord org.example.maven.actions KeyedFileHandler org.example.maven.actions NumberedFileHandler copy the FortuneCookie.txt and Music.txt files into the src/main/resources replace the existing pom.xml, with the new copy right click on the project name and paste it, it will ask you to overwrite the existing file Right click the mavenplay project, and select Maven -> Update Project this will force a rebuild of the project classpath Run the application, by right clicking on the MavenPlay class and selecting Run as -> Java Application Right click the project and select run as Maven install this will rebuild the project, running any tests you have Right click the target folder and select refresh, and you will find the new jar file mavenplay-0.0.1-SNAPSHOT.jar there. 4) Copy the files from the CodeSample2 folder you unzipped in the Pre-Step into the Eclipse project These go into src/test/java You will need to create packages to hold the following code: Package Class ------------------------------------------- org.example.maven.entities HumorRecordTest replace the existing pom.xml, with the new copy Right click the mavenplay project, and select Maven -> Update Project this will force a rebuild of the project classpath Right click the project and select Run as -> Maven test This will run your Unit tests, look at the Console to see the test results 5) Copy the files from the CodeSample3 folder you unzipped in the Pre-Step into the Eclipse project You will replace the following files: in src/main/java Package Class ------------------------------------------- org.example.maven.entities HumorRecord in src/test/java Package Class ------------------------------------------- org.example.maven.entities HumorRecordTest you will need to create a package in src/test/java for Package Class ------------------------------------------- org.example.maven.test.util ImageViewer org.example.maven.actions NumberedFileHandlerTest copy the Fortunes.jpg and music.jpg files into the src/test/resources replace the existing pom.xml, with the new copy Right click the mavenplay project, and select Maven -> Update Project this will force a rebuild of the project classpath Right click the project and select run as Maven test This will run your Unit tests, look at the Console to see the test results 6) Copy the files from the CodeSample4 folder you unzipped in the Pre-Step into the Eclipse project replace the existing pom.xml, with the new copy Right click the mavenplay project, and select Maven -> Update Project Copy the IRSstyle.xml file into the root of the mavenplay project Right click the project and select Run as -> Maven Build ... When the build wizard comes up, enter site as the Goal to run Right click the target folder and select refresh, you will find a new set of folder, including a folder named site in this folder you will find an index.html file. Right click this index.html file and select Open With -> Web Browser Look at the Project Reports