CS544
Exercises
CS544 Exercises
April 2016
READ ME FIRST
For the lab projects we will use:
Tool
Version
Java JDK 8u74 or
later
URL
[Link]
MySQL
Community [Link]
Server
Python
5.7.x
[Link]
STS
3.7.3
[Link]
JPA
2.1
Maven repository
GROUP ID: [Link]
hibernate-jpa-2.1-api [Link]
Hibernate [Link] Maven repository
GROUP ID: [Link]
hibernate-core
hibernate-entitymanager Use instead of core when using JPA
Spring
4.2.5
Maven repository
GROUP ID: [Link]
spring-context
spring-core
5.1.37
MySql
JDBC
Connector
Maven repository
GROUP ID: mysql
mysql-connector-java
Required artifacts will be listed on the projects.
Maven:
All of the projects for this class will be based on Maven ([Link]
Maven is a build automation tool (like Ant or Gradle) that helps organize a project and
its deployment.
Maven uses an XML file called [Link] (Project Object Model), that describes how your
source code is built, and what dependencies (jar files/libraries) your project depends on.
It even download the dependencies for you.
Maven relies on convention: requires a predefine file structure for the project.
Directory name
Purpose
project home
Contains the [Link] and all subdirectories.
src/main/java
Contains the deliverable Java sourcecode for the project.
src/main/resources
Contains the deliverable resources for the project, such
as property files.
src/main/filters
Resource filter files
src/main/config
Configuration files
src/main/scripts
Application/Library scripts
src/main/webapp
Web application sources
src/test/java
Contains the testing Java sourcecode (for example JUnit
or TestNG test cases)
src/test/resources
Contains resources necessary for testing
src/test/filters
Test resource filter files
src/assembly
Assembly descriptors
src/site
Site
Most IDEs come with Maven integration, you do not need to download it.
[Link] Example
<project xmlns="[Link] xmlns:xsi="[Link]
xsi:schemaLocation="[Link] [Link]
<modelVersion>4.0.0</modelVersion>
<groupId>[Link].cs544</groupId>
<artifactId>exercise02_1</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
Basic project naming
<name>exercise02_1</name>
<url>[Link]
<properties>
<[Link]>UTF-8</[Link]>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>[Link]</groupId>
<artifactId>hibernate-core</artifactId>
<version>[Link]</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.37</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
</dependencies>
</project>
Jar files that we
need for this project