Upgrade to Pro — share decks privately, control downloads, hide ads and more …

CSC305 Lecture 04

CSC305 Lecture 04

Individual Software Design and Development
Maven
(202501)

Javier Gonzalez-Sanchez

September 29, 2024
Tweet

More Decks by Javier Gonzalez-Sanchez

Other Decks in Programming

Transcript

  1. Dr. Javier Gonzalez-Sanchez [email protected] www.javiergs.info o ffi ce: 14 -227

    CSC 305 Individual Software Design and Development Lecture 04. Dependency Management
  2. 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. 6
  3. • 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. 8
  4. • 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. 9
  5. 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/ 18
  6. 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/ 25
  7. 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. 32
  8. Weka • Wek a is a collection of m a

    chine le a rning a nd d a t a a n a lysis • W a ik a to Environment for Knowledge An a lysis (Wek a ) • developed a t the University of W a ik a to, New Ze a l a nd • https://ml.cms.w a ik a to. a c.nz/wek a • 39
  9. Eclipse Paho for Java Wh a t is Eclipse P

    a ho? • A set of MQTT client libr a ries developed by the Eclipse Found a tion. • It supports multiple l a ngu a ges, such a s J a v a , Python, J a v a Script, etc. J a v a Dependency (M a ven) <dependency> <groupId>org.eclipse.paho</groupId> <artifactId>org.eclipse.paho.client.mqttv3</artifactId> <version>1.2.5</version> </dependency> 48
  10. Logging • Recording events, a ctions, or mess a ges

    th a t occur during the execution of a progr a m. • Proper logging is essenti a l for m a int a ining a nd troubleshooting a pplic a tions e ff ectively throughout their lifecycle. 63
  11. SLF4J Logback • St a nds for Simple Logging F

    a c a de for J a v a • It provides a uni f ied interf a ce for logging oper a tions, a llowing developers to write logging code without binding their a pplic a tion to a speci f ic logging implement a tion. • We need to t a lk a bout the F a c a de P a ttern 65
  12. We want this 71 message 01 message 02 message 03

    message 04 message 05 trace() debug() info () warn () error() Logger 71
  13. Resources Folder • The resources folder in a M a

    ven project stores non-source-code f iles th a t your a pplic a tion needs, such a s con f igur a tion f iles, property f iles, im a ges, a nd other resources. • These f iles a re included in the f in a l build output a nd a v a il a ble on the cl a ssp a th a t runtime. 74
  14. src/main/resources/logback.xml • logb a ck.xml is a con f igur

    a tion f ile for SLF4J Logb a ck. • It de f ines how logging should be h a ndled, including log levels, a ppenders (where logs a re written), a nd log form a ts. • When your a pplic a tion st a rts, SLF4J Logb a ck a utom a tic a lly looks for this con f igur a tion f ile. 75
  15. ConsoleAppender 76 message 01 message 02 message 03 message 04

    message 05 trace() debug() info () warn () error() Logger 76 Appender
  16. ConsoleAppender 79 message 01 message 02 message 03 message 04

    message 05 trace() debug() info () warn () error() Logger 79 Appender
  17. Logstash Logback Encoder | POM.xml • Let’s use a nother

    libr a ry to t a ke a dv a nt a ge of extr a encoders • form a t Spring Boot logs in JSON form a t 81 https://github.com/CSC3100/Tool-Logging
  18. Next 85 trace() debug() info () warn () error() message

    01 message 02 message 03 message 04 message 05 Logger Appender Appender
  19. CSC 305 Individual Software Design and Development Javier Gonzalez-Sanchez, Ph.D.

    [email protected] Summer 2024 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.