Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Packaging tag missing in pom file

I am trying to follow the spring tutorials from the book Spring In Action 5th edition from Manning publications. The IDE I am using is Spring Tool Suite 4 and the latest version of Spring Boot I can see from it is 2.2.0

In the example of the pom file given in the book, it's mentioned that there will be a <packaging>jar</packaging>entry, however in the generated pom file, I don't find it. The book is based on version 2.0.4 and the section in the book for the said entry is this:

<groupId>sia</groupId>
 <artifactId>taco-cloud</artifactId>
 <version>0.0.1-SNAPSHOT</version>
 <packaging>jar</packaging>
 <name>taco-cloud</name>
 <description>Taco Cloud Example</description>

In the pom file generated in the IDE I see this:

<groupId>sia</groupId>
    <artifactId>taco-cloud</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <name>taco-cloud</name>
    <description>Taco Cloud Example</description>

Does anyone have any idea why the entry <packaging>jar</packaging> is missing?

like image 216
javaperson Avatar asked Sep 06 '25 05:09

javaperson


2 Answers

When no packaging is declared, Maven assumes the packaging is the default: jar

See: https://maven.apache.org/pom.html Section packaging.

Java application will packaged to JAR, it is default manner.

like image 73
Do Nhu Vy Avatar answered Sep 10 '25 01:09

Do Nhu Vy


"jar" is the default packaging type. The value will default to jar if not specified.

like image 36
Ryan Stuetzer Avatar answered Sep 10 '25 00:09

Ryan Stuetzer