liveBook · Manning

Maven wrapper

As explained in Spring in Action, Sixth Edition

The Maven Wrapper is a set of project-local scripts that downloads or invokes a specified Maven version without requiring a system-wide Maven installation.

The Maven Wrapper is a set of project-local scripts that lets you build a Spring project without installing Maven system-wide. Use mvnw on Unix-like systems and mvnw.cmd on Windows. section 1.2.2

Build and run a Spring project

From the project directory, run ./mvnw package to create the application artifact, then start it with java -jar target/taco-cloud-0.0.1-SNAPSHOT.jar. For development, ./mvnw spring-boot:run launches the application directly; ./mvnw test runs its tests. section 1.2.2

Figure 1.6 The initial Spring project structure as shown in Spring Tool Suite

The project structure shows where mvnw and mvnw.cmd sit alongside pom.xml, application code, resources, and tests. section 1.2.2

How Spring in Action, Sixth Edition covers it

How deep it goes
Defines the wrapper and demonstrates its main commands, but does not explain script internals or Maven configuration.
Examples
Uses mvnw package, spring-boot:run, test, and the generated Taco Cloud application artifact.
What it assumes
Assumes a generated Maven project and command-line access, while avoiding a prerequisite system-wide Maven installation.
What you can do after
Operate/configure a project-local Maven build, application run, and test workflow through wrapper commands.
How it connects
Connects Maven Wrapper with Maven, pom.xml, Spring Initializr, Spring Boot, and project testing.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Spring in Action, Sixth Edition. The section links point to the parts of the book it draws on.