Unable to compile snap on linux

I am trying to compile snap-engine and desktop 6.0 on linux. But facing following issue:

snap-ui does not seem to jar the class files. Issue being stale object.
This seems to get solved somehow on another machine.

Now after solving all the dependencies, when I reach the last module in snap-desktop,
snap desktop application, it is giving following error:

We could not find org-netbeans-bootstrap among the modules in the appliation. Launcher could not be found.

Just one more thing, I am now compiling it in offline mode with all the repos downloaded from internet to my local repository.

Kindly guide.

Ghansham

In general this should work. Our daily build are running on linux.
But why are you compiling version 6.0? Do you have special needs for it?
Have you checked out a certain tag or branch?
Can you provide the maven output, at least the interesting part?

As per your advice, I just pulled the latest master branch from


After that, I cleaned my local repository I compiled using maven (allowed maven to pull the jars to my local repo) using following command.

mvn install -DskipTests=true

When I was compiling, snap-engine. following jars I had to download manually from the maven central as the poms seem to be outdated:

ajt-2.11.jar
commons-net-3.3.jar
gt-coverage-17.1.jar
gt-main-17.1.jar
gt-render-17.1.jar
imageio-ext-geocore-1.3.2.jar
jama-1.0.3.jar
jhdf5.jar
jscience-4.3.1.jar
udunits-4.3.22.jar
commons-codec-1.9.jar
geoapi-2.2.0.jar
gt-data-17.1.jar
gt-metadata-17.1.jar
gt-shapefile-17.1.jar
imageio-ext-tiff-1.2.2.jar
javaml-0.1.7.jar
jhdf.jar
netcdf-4.3.22.jar
commons-io-2.5.jar
gt-api-17.1.jar
gt-epsg-hsql-17.1.jar
gt-referencing-17.1.jar
gt-xsd-gml3-17.1.jar
jai_imageio-1.1.jar
jcoord-1.0.jar
jpy-0.8.jar
nujan-1.4.1.1.jar

After this I am able to compile snap-engine successfully. But when I compiled snap-desktop.
I again encounter errors. And I had to download many jars again to compile some of the modules in snap-desktop. Following were the jars:

org-netbeans-api-annotations-common-RELEASE82.jar
org-openide-explorer-RELEASE82.jar
org-openide-util-lookup-RELEASE82.jar
org-openide-util-ui-RELEASE82.jar
org-netbeans-modules-options-api-RELEASE82.jar
org-openide-nodes-RELEASE82.jar
org-openide-util-RELEASE82.jar
org-openide-windows-RELEASE82.jar

Please see the stack trace below:

[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /data1/giwrk/nightly_build/snap-desktop/snap-ui/src/main/java/org/esa/snap/ui/SnapFileChooser.java:[29,40] package org.esa.snap.vfs.ui.file.chooser does not exist
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] SNAP Desktop Project 8.0.0-SNAPSHOT … SUCCESS [ 1.595 s]
[INFO] SNAP Desktop NB Branding 8.0.0-SNAPSHOT … SUCCESS [ 3.689 s]
[INFO] SNAP Desktop Tango Icons 8.0.0-SNAPSHOT … SUCCESS [ 4.467 s]
[INFO] SNAP Virtual File System UI 8.0.0-SNAPSHOT … SUCCESS [ 4.051 s]
[INFO] SNAP User Interface Library 8.0.0-SNAPSHOT … FAILURE [ 1.364 s]
[INFO] tiled-editors 1.0 … SKIPPED
[INFO] doc-windows 1.0 … SKIPPED
[INFO] Java NetBeans Launcher 8.0.0-SNAPSHOT … SKIPPED
[INFO] SNAP Main 8.0.0-SNAPSHOT … SKIPPED
[INFO] SNAP Desktop Rich Client Platform 8.0.0-SNAPSHOT … SKIPPED
[INFO] SNAP Graph Processing Framework (GPF) GUI 8.0.0-SNAPSHOT SKIPPED
[INFO] SNAP Remote Execution GUI 8.0.0-SNAPSHOT … SKIPPED
[INFO] SNAP Graph Builder 8.0.0-SNAPSHOT … SKIPPED
[INFO] SNAP Classification UI 8.0.0-SNAPSHOT … SKIPPED
[INFO] SNAP Digital Elevation Models UI 8.0.0-SNAPSHOT … SKIPPED
[INFO] SNAP Help 8.0.0-SNAPSHOT … SKIPPED
[INFO] SNAP Land Cover UI 8.0.0-SNAPSHOT … SKIPPED
[INFO] SNAP Product Library UI 8.0.0-SNAPSHOT … SKIPPED
[INFO] SNAP Raster Operators UI 8.0.0-SNAPSHOT … SKIPPED
[INFO] SNAP Level-3 Binning GUI 8.0.0-SNAPSHOT … SKIPPED
[INFO] SNAP Collocation GUI 8.0.0-SNAPSHOT … SKIPPED
[INFO] SNAP Spectral Unmixing GUI 8.0.0-SNAPSHOT … SKIPPED
[INFO] SNAP Watermask Operator GUI 8.0.0-SNAPSHOT … SKIPPED
[INFO] SNAP Pixel Extraction Tool UI 8.0.0-SNAPSHOT … SKIPPED
[INFO] SNAP Virtual File System Preferences UI 8.0.0-SNAPSHOT SKIPPED
[INFO] SNAP WorldWind 8.0.0-SNAPSHOT … SKIPPED
[INFO] SNAP Standalone Tool Adapter GUI 8.0.0-SNAPSHOT … SKIPPED
[INFO] SNAP Smart Configurator UI 8.0.0-SNAPSHOT … SKIPPED
[INFO] SNAP Desktop NB Application 8.0.0-SNAPSHOT … SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 18.764 s
[INFO] Finished at: 2019-10-01T14:37:25+05:30
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.5.1:compile (default-compile) on project snap-ui: Compilation failure
[ERROR] /data1/giwrk/nightly_build/snap-desktop/snap-ui/src/main/java/org/esa/snap/ui/SnapFileChooser.java:[29,40] package org.esa.snap.vfs.ui.file.chooser does not exist

I would suggest you to check once by just flushing the local repository and pulling the master branch from github. Or there is any other source from where it can be downloaded.? Kindly guide.

The official version is 7.0, I’d suggest you start with that.

@oana_hogoiu Could one of you check why this happens? Maybe, some dependency issue which only occurs when compiling the first time?

This error is coming because the expected vfs jar that is installed in local repo doesnt have classes. It shows stale message in maven compilation. Kindly help and guide.

Any update on this issue?

I have tried with snap 6.0, 7.0 and nightly builds. All have similar behavior. Someone should try a to clone the git repo in a fresh account and see most of the maven jars are not up to date for whatever reason it may be.

1 Like

I just tried with the master branch and a fresh local maven repository. It worked without any problem.

We use our own repository server which is specified in the pom file.
You can browse its content here: https://snap-build-server.tilaa.cloud/nexus/#browse/browse
I looked up two of the jars you have listed which were not downloaded.
They are present on the server.
org-netbeans-api-annotations-common-RELEASE82.jar
gt-coverage-17.1.jar

They should be automatically downloaded.

I know that maven has had problems in the past downloading many dependencies on the first attempt. But when invoking it again it worked. But actually I haven’t seen this problem anymore since a while.

Since you experience this issue with all branches, it seems not to be an issue with the project. Otherwise, others would have complained earlier.

It could be an issue with our maven server (@obarrilero can you have a look?) or maybe some special settings on your side. Do you have set something in the maven settings.xml file?

Does someone else experience similar problems?

@marpet @obarrilero complication instructions need to be clearly documented online to ease the process.

Usually, building SNAP from the command line is pretty simple. In brief:

> cd snap-engine
> mvn install
> cd ..\snap-desktop
> mvn install
That’s it.

It’s more exhaustively explained here: How to build SNAP from sources

For regularly occurring obstacles I agree, those should be added to the documentation.
But here I still think it is an edge case.

First of all thanks for putting some time to do the exercise of doing fresh compilation. I have not set anything in settings.xml. I will try one more time with nightly afresh and send you the console messages. First time the snap engine compilation stops when it is unable to find the jai jars used by snap-jai. Did you clone the github repo or from somewhere else?

Regards
Ghansham

I could make it out. The issue was related to SSL certificates.

I had to add a few options in the maven build command. This was the command I used.
mvn install -DskipTests=true -Dmaven.wagon.http.ssl.insecure=true -Dmavn.wagon.http.ssl.allowall=true -Dmaven.wagon.http.ssl.ignore.validity.dates=true

Thanks a lot Sir for taking pain to help me solve this issue.
And sorry for creating confusion.
I will now try to run it.

regards
Ghansham

Good that you found a solution.
But I wonder why these SSL settings are necessary.
My browser shows that everything is okay with the Certificate.
image
Do you have an explanation of why you need to make the configuration?

No idea why it happened so. Tried to check on internet. Seems like certificate needs to be fetched and stored in java installation directory at appropriate place. Will try at my end and provide the fix if possible. This one is a hack not a fix by the way :slight_smile: