Maven Flashcards
Learning maven build system
Maven project file?
pom.xml
How to find maven version?
mvn -version
How to create a maven project from command line
mvn archetype:generate
What is group id of a maven project?
Company website in reverse order,
com.codebind
It is unique for an organization.
What is artifact id of a maven project
It is the project name, e.g.,
my-maven-project
What does eclipse work space contain
A collection of projects
How to create a new maven project in eclipse
File -> New -> project -> maven -> maven project
What to do after creating a maven project in eclipse?
Create a class in src/main/java package
What is the relationship between “maven build life cycle”, “maven phase” and a “maven goal”?
A maven build life cycle contains multiple maven phases.
A “maven phase” contains multiple “maven goals”.
What does a pom.xml file should contain at the minimum?
GAV
Group ID,
Artifact ID,
Version
In maven, where are directories named after groupID and artifactID?
Directory named artifactID is child of directory named groupID.
In maven, how is resultant jar file named?
It is named after artifactID.
How do u execute a maven goal?
If the goal is a part of a maven phase, specify both phase:goal, like,
mvn dependency:copy-dependencies
If the goal is not a part of any phase, just specify that goal, like,
mvn clean
What are important parts of maven directory structure?
- src
- main
- java
- resources
- webapp
- test
- java
- resources
- main
- target
main dir contains only business src code.
test dir contains test src code.
target dir contains compiled code and jars etc.
How are dependencies specified in pom.xml file?
G, A, V (1)
G, A, V (2)
Each dependency ultimately names a jar file.