How to build SNAP from sources

Requirements

In order to build SNAP and the toolboxes you need the following software

Checkout the source code

All the code related to SNAP and the Sentinel Toolboxes is hosted on GitHub. Checkout, respectively clone in git terms, the source code repositories into a folder named snap.

cd <myprojects>
mkdir snap
 
cd snap
git clone https://github.com/senbox-org/snap-engine.git
cd snap-engine
mvn clean install
 
cd ..
git clone https://github.com/senbox-org/snap-desktop.git
cd snap-desktop
mvn clean install

Some people reported they had to use sudo in front of mvn clean install. Usually it should not be necessary but in case you experience problems try sudo.

Build SNAP source code

In order to build the source code the maven install command should be invoked.

cd snap
cd snap-engine
mvn clean install

cd ..
cd snap-desktop
mvn clean install

Building additional Toolboxes

The following command are for the Microwave Toolbox.

Build S1TBX
cd snap
git clone https://github.com/senbox-org/microwave-toolbox.git
cd microwave-toolbox
mvn clean install

If you encounter unit-level test failures, build with tests turned off. Please report this in the forum. Actually we should notice this ourselves but sometimes things can slip through our fingers.

Build without tests
mvn clean install -DskipTests=true

Procedure for other toolboxes like the optical or smos toolbox is the same as described above for the microwave toolbox.

You should also consider to checkout the snap-examples project. It might contain valuable example code for you.

Further read How to run and debug SNAP from an IDE.