I'm trying to change the source of a java snap. Here's what I do:
Download the sample project.
svn export https://github.com/snapcore/snapcraft/trunk/demos/java-hello-world
Build the snap named java-hello-world.
cd java-hello-world snapcraft
Install the snap.
sudo snap install java-hello-world_0_amd64.snap --dangerous
Run the snap.
The output is
Hello Worldas expected.
Now I want to change the snap so it prints "Hello Snap" instead of "Hello World". Here's what I do:
java-hello-world/snap/snapcraft.yaml. Change grade to
develand confinement to
java-hello-world/src/oata/HelloWorld.java. Change line 7 to
Iterate over the snap.
snapcraft prime sudo snap try --devmode prime/
The output is
Hello World. I would like to have the output
What I'm doing wrong: There are two things in the build process which seem suspicious to me.
When running snapcraft prime it says:
Skipping pull local (already ran) Skipping build local (already ran) Skipping stage local (already ran) Skipping prime local (already ran) Skipping pull wrapper (already ran) Skipping build wrapper (already ran) Skipping stage wrapper (already ran) Skipping prime wrapper (already ran)
I guess skipping all these steps also includes skipping reading and compiling the file
java-hello-world/src/oata/HelloWorld.java. Thats why the output is still the same after editing the file. How can I not skip that step? The tutorial says:
Note: The different steps of snapcraft are: pull (download source for all parts), build, stage (consolidate installed files of all parts), prime (distill down to just the desired files), snap (create a snap out of the prime/ directory). Each steps depends on the previous one to be completed".
I tried to
snapcraft pullinstead of
prime, but the result is the same.
snapcraftthe first time,
antgives a warning.
[javac] /home/username/Java/java-hello-world/parts/local/build/build.xml:19: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
I don't know what
defaulting to build.sysclasspath=lastmeans. So that might be the problem. "set to false for repeatable builds" should be ok, because thats what this answer suggests.
How can I refresh the source of the snap after changing it? Many thanks in advance.