The point of these notes is to demonstrate creating a new, Maven project in
IntelliJ IDEA completely from scratch and devoid of any framework notions, but
basing its build on Maven and traditional, Java project layout. This was done
using IntelliJ IDEA 2018.3.4 Ultimate.
- If not already done, launch IntelliJ IDEA.
- If IDEA comes up on an existing project, dismiss that project by choosing
File → Close Project.
- In the Welcome to IntelliJ IDEA dialog that appears, click
Create New Project.
- Down the left-hand side, select Maven. Also choose the
Project SDK:, check Create from archetype and, from the
list below, select
org.apache.maven.archetypes:maven-archetype-quickstart.
(See also
Maven Quickstart Archetype.)
- Click Next.
- Fill in the following (see
Guide to naming conventions on groupId, artifactId, and version):
- GroupId: —uniquely identifies your project across all
other projects and follows Java package-name rules using a reversed
domain name that you control, e.g.:
com.windofkeltia.examples.jdbc.postgresql
- ArtifactId: —the name of the JAR you will produce
without version number. This can be any legal filesystem name,
e.g.: jdbc-example.
- Version: —any practical version number, typically
a mixture of digits and dots. Also tolerated are pertinent
notations like SNAPSHOT, indicating nightly builds, e.g.:
1.0-SNAPSHOT
- Click Next.
- Inspect the description of what you're about to create,
click Next.
- Specify (correct) the Project name and Project location
or accept them as presented.
Click OK.
- click OK.
- Wait until the IDE stops churning.
- In the little pop-up, Maven projects need to be imported, click
Import Changes.
- Dismiss/hide the Messages pane. You are left with a new
pom.xml suitable to begin development, however, it does tend to be
full of crap that you do not need. Compare it with the pom.xml of
another simple project and discard most of the Maven-specific
dependencies.
- Open the src subdirectory and all lower subdirectories and packages
in the Project pane to see your new project template. Rename
App.java and AppTest.java according to what you prefer to
call them for your new project.
- At this point, you're in business.