Build SNAP from github source with maven 3.6


ATM I try to simply:

  • clone the snap engine, desktop and s1tbx repos from github
  • checkout to a specific commit
 git clone
 cd snap-engine
 git checkout 65c1230f35
 cd ..
 git clone
 cd snap-desktop
 git checkout 36fbe009
 cd ..
 git clone
 cd s1tbx
 git checkout 63f5ac39e
  • and compile with maven

but it fails as soon as I try compiling the engine repo

cd ~/snap2/snap-engine
mvn clean install -DskipTests=true

with this message:

Rule 0: org.apache.maven.plugins.enforcer.RequireMavenVersion failed with message:
Detected Maven Version: 3.6.0 is not in the allowed range [3.1.0,3.5.2].

This is strange to me since in the documentation you find this:

Maven >= v3.2.5

here are all the specs of my setup:

Ubuntu 18 LTS

$mvn -version
Apache Maven 3.6.0
Maven home: /usr/share/maven
Java version: 1.8.0_242, vendor: Private Build, runtime: /usr/lib/jvm/java-8-openjdk-amd64/jre
Default locale: en_US, platform encoding: ANSI_X3.4-1968
OS name: “linux”, version: “5.0.0-37-generic”, arch: “amd64”, family: “unix”

Why I am doing this:

downgrading to maven 3.5 is somehow difficult to me since I organize all of my setup with docker, therefore I try to use the latest version to run the docker build as smooth as possible

My specific question:
Does compiling with maven 3.6 work for other users, since the docu tells us to use something higher or equal to 3.2.5? Do I miss something, or do I have to downgrade?
If I have to downgrade, please update the error message behavior or the documentation concerning the working maven version.

Cheers and thx for help

Hi @thho,

I am using maven 3.6.1 on my linux machine without any issues on the current master branch.

Apache Maven 3.6.1
Maven home: /usr/share/maven
Java version: 1.8.0_241, vendor: Oracle Corporation, runtime: /usr/lib/jvm/oracle-java8-jdk-amd64/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "5.3.0-29-generic", arch: "amd64", family: "unix"

I will check on the specific commit 65c1230f35 that you are trying.

Best regards,

1 Like

that would be greate! thx

Hi @thho,

So in the commit you are checking out the maven version is limited to the 3.5.2 however you can try to modify the line 1049 of the pom.xml file:




However it could brake something else.
Can I ask you why you want to build this specific commit?

Best regards,

1 Like

@MartinoF, thx, that sounds reasonable.

As you asked, I want to use a Java Operator that I customized in the s1tbx, the changes were done on the commits provided above, and it worked back then. Now I know that the OP in s1tbx has changed and if I would simply put my operator into the latest commit, it would not work for the s1tbx, engine and desktop might work…but I want to have the same state like it was back half a year ago (or so) …that is the reason…

But, you are right, other things might be influenced by changing the pom.xml soo I see myself checking the OP in s1tbx and my customized one and bring all up to date I guess :wink: tried to avoid this but it is in the end the best way to go. Thanks for help until here.

Another thing, is there a Dockerfile around for setting up SNAP from source? If not I could generalize my version and share it after testing…let me know if you think that is of interest or if something like this already exist.


Hi @thho,

I don’t know if it could help, but maybe you could try to use the current branch 7.X that I believe it should be compatible with maven 3.6 and it should resemble more at what was SNAP half a year ago :wink:

I will search around and let you know for the Dockerfile. :slight_smile:

Best regards,

I have just finished the merging part, the only thing that changed is the multimastersplit if else statement in the IFG Operator, that, tbh makes me very curious :wink: so you are right, current branch is pretty similar to the commits I used until now

I will now sort some other things out and will then try to run the maven install and a test for my changes if they still work, but from my point of view they should.

thx for your help!

1 Like