first-war-project will be created with pom.xml file and src folder.
first-war-project
pom.xml
src
Open pom.xml file and verify that packaging value is changed to war.
In src >main > web app path is create.
src >main > web app
Change the folder path by entering cd my-war-project.
cd my-war-project
To compile type mvn compile.
mvn compile