Snippet to create a java standard layout from a shell.

To create a java project standard directory layout from a unix shell (tested on bash) just type the following snippet.

mkdir -p src/{main,test}/{java,resources}

mkdir creates directories.

-p is used to tell mkdir to create parents if they don’t exist.

src/{main,test} is used to create a directory called src with 2 nested directories: main and test.

/{java,resources} tells to create 2 directories in each of main and test named java and resources.

The resulting directory layout is the following:
└── src
├── main
│   ├── java
│   └── resources
└── test
│ ├── java
│ └── resources
.... other stuff


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s