Command-line Builds
CS 240: Advanced Software Construction
The Need for Command-line Builds
“Building” Software
Command-line Builds
Command-line Builds
Command-line Builds
Maven Project Structure
Project Structure
Generate new project
Multi-module Projects
Dependencies
Dependencies
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.10.1</version>
<scope>compile</scope> -- or “test” or “runtime”
</dependency>
Dependencies
Local JAR File Dependencies
Plugins
Plugins
Plugins
Plugins
Plugin | Function |
Maven “clean” plugin | Deletes files from previous builds |
Maven “compiler” plugin | Compiles Java code |
Maven “surefire” plugin | Runs JUnit tests |
Maven “jar” and “assembly” plugins | Package compiled code into JAR files |
Maven “install” plugin | Installs JAR files to local Maven repository |
Third-party “jacoco” plugin | Generates test coverage report |
Third-party “exec” plugin | Execute Java programs (server and client) |
Plugin | Function |
Maven “site” plugin | Generates project documentation website |
Maven “project info reports” plugin | Generates various project reports (dependencies, plugins) |
Maven “checkstyle” plugin | Generates a Checkstyle report |
Plugins
How Plugins Work
Plugin “Goals”
Plugin “Goals” and the Build Lifecycle
Plugin “Goals” and the Build Lifecycle
IDE + �Automated Builds
IDE + Automated Build Tool
IDE + Command-line Build Tool