Running on Java 19-ea+23-1706 (Preview)
Home of The JavaSpecialists' Newsletter

2.4 Typical Directory Structure Under Maven

Juppies 2 by Dr Heinz M. Kabutz

Our package is mirrored in the same directory structure eu\javaspecialists\courses\juppies\anagrams\lib. This would be inside our Juppies2\AnagramGame\src\main\java. This is the most common structure for Java projects nowadays. Maven expects us to use a structure where the Java code is in src\main\java. There is also a src\test\java directory. This is where our JUnit test classes will go, typically in the same directory hierarchy as main. Since Maven expects this particular directory structure, our pom.xml is super simple. We can override the default structure, but then we have to customise our pom.xml file. Remember the Project Object Model (POM) is an XML file that is used to configure Maven. It manages our dependencies and will instruct Maven which other jar files to download. A jar file is a special type of library file that we use to store Java classes and other resource files such as images, text, xml, properties files, json, etc. It is actually a zip compressed file with an additional MANIFEST.MF file that describes our jar file. We can unzip the jar file with most compression tools.


When you load these comments, you'll be connected to Disqus. Privacy Statement.

Table of Contents

We hope you enjoyed this tutorial. If you did, you will also enjoy our courses. We suggest you start with Extreme Java - Advanced Java, followed by Extreme Java - Concurrency Performance for Java 8.

About the Author

Heinz Kabutz Java Conference Speaker

Java Champion, author of the Javaspecialists Newsletter, conference speaking regular... About Heinz

Superpack '22

Superpack '22 Our entire Java Specialists Training in one huge bundle more...

Free Java Book

Dynamic Proxies in Java Book
Java Training

We deliver relevant courses, by top Java developers to produce more resourceful and efficient programmers within their organisations.

Java Consulting

We can help make your Java application run faster and trouble-shoot concurrency and performance bugs...

Java Emergency?

If your system is down, we will review it for 15 minutes and give you our findings for just 1 € without any obligation.