Starting a maven project
Use the IDE to do this, it is much easier than using the command line.
NOTE: Make sure you have an internet connection to allow maven to download stuff.
Starting archtype project
This will create a simple project with a prod file and test file, some dependencies and plugins in the pom.xml. In most cases, these files will be amended to suit the projects needs.
Via IntelliJ
click file> new project
click maven on right hand side
tick archtype box
select
maven-archetype-quickstart
click nextName group id ie com.project
Name artifact ie project-name
click next (change if you want)
click next (I normally change the folder of the project)
click finish
This will start to download all the dependcies, you can see this at the bottom right of Intellij. Sometimes a pop up will ask to import
or enable auto-import
, click auto import makes life easier. You can check the project tool window > External libraries
to see the libraries of the dependencies that have been downloaded and can be used in this project.
Go into the pom.xml and change the following version to the current version of java you are using.
Via command line
Follow the example in the documentation
https://maven.apache.org/archetypes/maven-archetype-quickstart/
Starting a non archtype project
This will be the bog standard way of doing it. It will give you a blank canvas to work with. Much better to use to help customise what you want.
Via IntelliJ
click file> new > project
click maven on right hand side
Name group id ie com.project
Name artifact ie project-name
click next (I normally change the folder of the project)
click finish
It will be good to add the following to pom.xml to set the java version
Last updated
Was this helpful?