Base Exercises-00 Intro
Base Exercises-00 Intro
Exercises
CS544 Exercises
April 2016
READ ME FIRST
For the lab projects we will use:
Tool
Version
URL
http://www.oracle.com/technetwork/java/javase/downloads/index.html
MySQL
Community http://dev.mysql.com/downloads/mysql/
Server
Python
5.7.x
https://www.python.org/downloads/
STS
3.7.3
https://spring.io/tools
JPA
2.1
Maven repository
GROUP ID: org.hibernate
hibernate-jpa-2.1-api 1.00.Final
4.2.5
Maven repository
GROUP ID: org.springframework
spring-context
spring-core
5.1.37
MySql
JDBC
Connector
Maven repository
GROUP ID: mysql
mysql-connector-java
Maven:
All of the projects for this class will be based on Maven (http://maven.apache.org/).
Maven is a build automation tool (like Ant or Gradle) that helps organize a project and
its deployment.
Maven uses an XML file called pom.xml (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
src/main/java
src/main/resources
src/main/filters
src/main/config
Configuration files
src/main/scripts
Application/Library scripts
src/main/webapp
src/test/java
src/test/resources
src/test/filters
src/assembly
Assembly descriptors
src/site
Site
Most IDEs come with Maven integration, you do not need to download it.
POM.XML Example
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchemainstance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>edu.mum.cs544</groupId>
<artifactId>exercise02_1</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>exercise02_1</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>5.1.0.Final</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>