Maven Things
Everything related to maven
Missing pom.xml version
If version in pom.xml isnt mentioned, then how does spring boot know which version to use ?
The version belonging the parent module will be referenced. Spring Boot starter comes with a lot of libraries in-built, with is referenced as a parent in the pom.xml file of your project
Click on
spring-boot-starter-parent
and to open its' pom.xml and then openspring-boot-dependencies
and you will find the list of version of each dependencies mentioned in it, used the specific spring-boot version you are using.
Now, if we have a child module in our spring application, and if we dont specify the version number, we either need to mention the parent pom or specify the version there.
or you can the specify the version inside the dependency tag or in the properties tag
You can also exclude the child module ( if you want to use another implementation ) from the parent pom.
Example : Excluding the artifactedId hamcrest-core from junit.
Check the maven tab, you will find that
hamcrest-core
is no longer a sub-dependency of junit and will also find the exact version.
Maven Build Phases
validate
- validate the project is correct and all necessary information is availablecompile
- compile the source code of the projecttest
- test the compiled source code using a suitable unit testing framework. These tests should not require the code be packaged or deployedpackage
- take the compiled code and package it in its distributed format, such as a JAR.verify
- run any checks on results of integration tests to ensure quality criteria are metinstall
- install the package into the local repository, for use as a dependency in other projects locallydeploy
- done in the build environment, copies the final package to the remote repository for sharing with other developers and projects.
Last updated