Maven Important terminologies
Why Maven:
Can manage dependencies
to maintain proper project structure
used to create documentation
acts as build tool,compiler tool
Group id-company name
artifact -product
version-version
Manage dependencies:
once dependency added,required jars will be downloaded to the local automatically
Maintain Code Structure:
src/main/java-Actual code
src/main/resources-UI related images,files stored here
src/test/java-unit testing code
src/test/resources--resources stored here against above test/java
pom.xml-used to maintain dependencies,plugins,repositories
acts as a build tool:
maven compiler plugin used to maintain java 17 or to maintain required java version
maven jar plugin used to convert the project into executable jar file-->main class has to be mentioned here
maven dependency plugin also used to convert the project into executable jar file along with libraries
right click on project--->run as-->maven build---goal as Package--->it will generate the executable file along with main class ,required librarires
Maven working as a document tool
if we give goal as site it will create a document in html file(professional documentation tool)
Goals:
default------>upto project deployment-------------->this lifecycle covers everything from validation to deployment
clean--->delete target folder--->compiled code,packages will be removed
site--->Document tool--->it shows test results,code coverage,project informations
validate--->just check whether everything is correct like project name,pom.xml file is valid or not
verify--->run check on results ensure quality--->post testing check
package--->gives executable jar ,war,zip file
test--->not package or deploy,it runs the test
install--->installing or downloading the local dependencies in local
deploy-->final stage deploying to central repository
Comments
Post a Comment