Slide 1

Slide 1 text

Dr. Javier Gonzalez-Sanchez [email protected] www.javiergs.info o ffi ce: 14 -227 CSC 305 Individual Software Design and Development Lecture 09. Maven

Slide 2

Slide 2 text

✅ GUI + Multithreading ✅ Object-Oriented Programming Week 05 2 ✅ Clean Code ✅ Object-Oriented Design

Slide 3

Slide 3 text

Tools 3

Slide 4

Slide 4 text

Dependencies

Slide 5

Slide 5 text

Library • A collection of resources (cl a sses) • A J a v a Archive, or JAR f ile, cont a ins a ll of the v a rious components th a t m a ke up a self- cont a ined, execut a ble J a v a a pplic a tion or, most commonly, a J a v a libr a ry to which a J a v a Runtime Environment c a n link. 5

Slide 6

Slide 6 text

jar-download.com 6

Slide 7

Slide 7 text

• Build m a n a gement tool • M a ven a utom a tes dependency m a n a gement by a utom a tic a lly downlo a ding required libr a ries a nd their dependencies, ensuring consistent builds with speci f ied versions. • In contr a st, m a nu a lly downlo a ding JARs is l a bor-intensive a nd error-prone. 7

Slide 8

Slide 8 text

• The project object model (POM) f ile describes a project a nd its dependencies. • A st a nd a rdized directory form a t. • Repositories where third-p a rty softw a re is stored a nd discovered. 8

Slide 9

Slide 9 text

Maven File and Directories 9

Slide 10

Slide 10 text

Maven

Slide 11

Slide 11 text

Create a project with Maven support 11

Slide 12

Slide 12 text

Or Add Framework Support 12 Do one of these

Slide 13

Slide 13 text

Or Add Framework Support 13

Slide 14

Slide 14 text

Maven File and Directories 14

Slide 15

Slide 15 text

POM.xml 15

Slide 16

Slide 16 text

Maven Repository 16

Slide 17

Slide 17 text

Adding a New Dependency 17

Slide 18

Slide 18 text

Right-Click POM.xml 18

Slide 19

Slide 19 text

JFreeChart Display Charts

Slide 20

Slide 20 text

JFreeChart • https://www.jfree.org/jfreech a rt/ • JFreeCh a rt is a libr a ry to displ a y profession a l-qu a lity ch a rts. 20

Slide 21

Slide 21 text

MVN Repository 21

Slide 22

Slide 22 text

Load Maven Changes 22

Slide 23

Slide 23 text

JFreeChart Example 23

Slide 24

Slide 24 text

https://github.com/CSC3100/Maven 24

Slide 25

Slide 25 text

Jsoup Java HTML Parser

Slide 26

Slide 26 text

Jsoup • A J a v a libr a ry th a t simpli f ies working with HTML a nd XML. • O ff ers URL fetching, d a t a p a rsing, extr a ction, a nd m a nipul a tion. • https://jsoup.org/ 26

Slide 27

Slide 27 text

MVN Repository 27

Slide 28

Slide 28 text

Load Maven Changes 28

Slide 29

Slide 29 text

Jsoup Example 29

Slide 30

Slide 30 text

https://github.com/CSC3100/Maven 30 https://github.com/CSC3100/Tool-Maven

Slide 31

Slide 31 text

Tulip GitHub Handler

Slide 32

Slide 32 text

Load Maven Changes 32

Slide 33

Slide 33 text

No content

Slide 34

Slide 34 text

No content

Slide 35

Slide 35 text

JavaParser A Parser for Java Code

Slide 36

Slide 36 text

JavaParser • A J a v a libr a ry to a n a lyze, tr a nsform, a nd gener a te J a v a code. • https://j a v a p a rser.org/ 36

Slide 37

Slide 37 text

MVN Repository 37

Slide 38

Slide 38 text

Load Maven Changes 38

Slide 39

Slide 39 text

JavaParser Example 39

Slide 40

Slide 40 text

https://github.com/CSC3100/Maven 40 https://github.com/CSC3100/Tool-Maven

Slide 41

Slide 41 text

We need to talk about the Null Object Pattern Pattern 41

Slide 42

Slide 42 text

JDBC SQL Database

Slide 43

Slide 43 text

MariaDB • Open-source a nd cre a ted by MySQL origin a l developers • https://m a ri a db.com/downlo a ds/ • For M a c, you c a n use the Homebrew p a ck a ge m a n a ger: > brew install mariadb > mysql.server start 43

Slide 44

Slide 44 text

Key Idea 44 ⚙

Slide 45

Slide 45 text

www.freesqldatabase.com 45

Slide 46

Slide 46 text

www.freesqldatabase.com 46

Slide 47

Slide 47 text

Create Tables 47 CREATE TABLE database.students ( ID INT NOT NULL, user VARCHAR(8) NOT NULL , password VARCHAR(8) NOT NULL ) INSERT INTO students (ID, user, password) VALUES (1, "javiergs", "qwerty")

Slide 48

Slide 48 text

Dependencies 48

Slide 49

Slide 49 text

Connection 49

Slide 50

Slide 50 text

SQL Statements 50

Slide 51

Slide 51 text

We need to talk about Standard Solutions Pattern 51

Slide 52

Slide 52 text

Questions 52

Slide 53

Slide 53 text

Lab

Slide 54

Slide 54 text

Create a Maven Project on your IDE Lab 54

Slide 55

Slide 55 text

Download and Run on Your computer: https://github.com/CSC3100/Tool-Maven Lab 55

Slide 56

Slide 56 text

Let’s Work 56 A. Configure Maven B. Add a Dependency C. Create a Chart D. Show me your (Java) and POM file

Slide 57

Slide 57 text

Review this curated list of Java libraries: https://github.com/akullpp/awesome-java Lab 57

Slide 58

Slide 58 text

CSC 305 Individual Software Design and Development Javier Gonzalez-Sanchez, Ph.D. [email protected] Fall 2025 Copyright. These slides can only be used as study material for the class CSC305 at Cal Poly. They cannot be distributed or used for another purpose.