Troubleshooting snapcraft/gradle integration

Hi there. I am pretty new to snapcraft so this may be a beginner’s question. Currently I have a java swing application that can be built via gradle, and I want to distribute it as snap.

I created a project using core18, the gradle plugin etc, and running snapcraft it executes gradle successfully. But then, when snapcraft should take back control and move on I always get the message

snapcraft --version
...
Could not find any built jar files for part

I admit my gradle build is quirky, and through debugging I find my jar inside the VM at

/root/parts/<part-name>/src/app/build/libs/app-0.1.0-SNAPSHOT.jar
/root/parts/<part-name>/build/app/build/libs/app-0.1.0-SNAPSHOT.jar

I do not know why it is there twice. But regardless of what I configure as gradle-output-dir that message does not go away. Where is snapcraft or the gradle plugin looking for my file when it claims that it was not found?

Further more, just having the project jar is not sufficient. I need a number of dependencies, which all get nicely zipped and tarred into

/root/parts/<part-name>/src/app/build/distributions/<project-name>-<version>.zip
/root/parts/<part-name>/src/app/build/distributions/<project-name>-<version>.tar
/root/parts/<part-name>/build/app/build/distributions/<project-name>-<version>.zip
/root/parts/<part-name>/build/app/build/distributions/<project-name>-<version>.tar

So I’d prefer snapcraft to working with those files rather than the plain jar.

How can I find out where my output files are being searched? How can I modify the file type that the gradle-plugin expects?

$ snapcraft version
snapcraft, version 6.1
$ snap version
snap    2.56
snapd   2.56
series  16
ubuntu  20.04
kernel  5.13.0-48-generic

Welcome @hiran1!

Snapcraft looks for *.jar files in the gradle-output-dir directory. If it’s not finding them, I’d have to see your snapcraft.yaml file to see how your project is setup.

Can you post your snapcraft.yaml file? (or the relevant parts of it?) And the full output of snapcraft --enable-developer-debug?

The file is easily shared as the whole project is open source. Check out

I think I mitigated by downloading the .deb package created by JPackage, but that can be changed. Probably the permissions is the bigger issue.

$ snapcraft --enable-developer-debug
Starting snapcraft 7.0.7 from /snap/snapcraft/7717/lib/python3.8/site-packages/snapcraft_legacy/cli.
configure_requests_ca: using '/etc/ssl/certs/ca-certificates.crt' for certificate verification
snapcraft is running in a docker or podman (OCI) container
Parts dir /home/hiran/NetBeansProjects/settlers-installer/parts
Stage dir /home/hiran/NetBeansProjects/settlers-installer/stage
Prime dir /home/hiran/NetBeansProjects/settlers-installer/prime
ignoring or passing through unknown icon=app/src/main/resources/images/siedler3-helme-logo-120.png
ignoring or passing through unknown parts=OrderedDict([('settlers-installer', OrderedDict([('plugin', 'dump'), ('source', 'https://github.com/HiranChaudhuri/settlers-installer/releases/download/nightly/settlersremake_1.0-1_amd64.deb'), ('source-type', 'deb')]))])
Launching a VM.
Running multipass start snapcraft-settlers-remake
snapcraft is running as a snap True, SNAP_NAME set to 'snapcraft'               
Enable use of snapd snap.
Running: sudo -H env SNAPCRAFT_BUILD_ENVIRONMENT=managed-host HOME=/root SNAPCRAFT_HAS_TTY=True SNAPCRAFT_ENABLE_DEVELOPER_DEBUG=True snap set system experimental.snapd-snap=true
Running multipass exec snapcraft-settlers-remake -- sudo -H env SNAPCRAFT_BUILD_ENVIRONMENT=managed-host HOME=/root SNAPCRAFT_HAS_TTY=True SNAPCRAFT_ENABLE_DEVELOPER_DEBUG=True snap set system experimental.snapd-snap=true
Holding refreshes for snaps.
Running: sudo -H env SNAPCRAFT_BUILD_ENVIRONMENT=managed-host HOME=/root SNAPCRAFT_HAS_TTY=True SNAPCRAFT_ENABLE_DEVELOPER_DEBUG=True snap set system refresh.hold=2022-06-26T22:49:42.652260Z
Running multipass exec snapcraft-settlers-remake -- sudo -H env SNAPCRAFT_BUILD_ENVIRONMENT=managed-host HOME=/root SNAPCRAFT_HAS_TTY=True SNAPCRAFT_ENABLE_DEVELOPER_DEBUG=True snap set system refresh.hold=2022-06-26T22:49:42.652260Z
Waiting for pending snap auto refreshes.
Running: sudo -H env SNAPCRAFT_BUILD_ENVIRONMENT=managed-host HOME=/root SNAPCRAFT_HAS_TTY=True SNAPCRAFT_ENABLE_DEVELOPER_DEBUG=True snap watch '--last=auto-refresh?'
Running multipass exec snapcraft-settlers-remake -- sudo -H env SNAPCRAFT_BUILD_ENVIRONMENT=managed-host HOME=/root SNAPCRAFT_HAS_TTY=True SNAPCRAFT_ENABLE_DEVELOPER_DEBUG=True snap watch --last=auto-refresh?
Running multipass transfer - snapcraft-settlers-remake:/var/tmp/snapcraft.snap
Finished streaming source file
Process completed
Running multipass transfer - snapcraft-settlers-remake:/var/tmp/snapcraft.assert
Finished streaming source file
Process completed
Running: sudo -H -i env SNAPCRAFT_BUILD_ENVIRONMENT=managed-host HOME=/root SNAPCRAFT_HAS_TTY=True SNAPCRAFT_ENABLE_DEVELOPER_DEBUG=True snap ack /var/tmp/snapcraft.assert
Running multipass exec snapcraft-settlers-remake -- sudo -H -i env SNAPCRAFT_BUILD_ENVIRONMENT=managed-host HOME=/root SNAPCRAFT_HAS_TTY=True SNAPCRAFT_ENABLE_DEVELOPER_DEBUG=True snap ack /var/tmp/snapcraft.assert
Running: sudo -H -i env SNAPCRAFT_BUILD_ENVIRONMENT=managed-host HOME=/root SNAPCRAFT_HAS_TTY=True SNAPCRAFT_ENABLE_DEVELOPER_DEBUG=True snap install --classic /var/tmp/snapcraft.snap
Running multipass exec snapcraft-settlers-remake -- sudo -H -i env SNAPCRAFT_BUILD_ENVIRONMENT=managed-host HOME=/root SNAPCRAFT_HAS_TTY=True SNAPCRAFT_ENABLE_DEVELOPER_DEBUG=True snap install --classic /var/tmp/snapcraft.snap
snapcraft 7.0.7 from Canonical✓ installed
Running: sudo -H -i env SNAPCRAFT_BUILD_ENVIRONMENT=managed-host HOME=/root SNAPCRAFT_HAS_TTY=True SNAPCRAFT_ENABLE_DEVELOPER_DEBUG=True snap switch snapcraft --channel latest/stable
Running multipass exec snapcraft-settlers-remake -- sudo -H -i env SNAPCRAFT_BUILD_ENVIRONMENT=managed-host HOME=/root SNAPCRAFT_HAS_TTY=True SNAPCRAFT_ENABLE_DEVELOPER_DEBUG=True snap switch snapcraft --channel latest/stable
"snapcraft" switched to the "latest/stable" channel

Running: sudo -H -i env SNAPCRAFT_BUILD_ENVIRONMENT=managed-host HOME=/root SNAPCRAFT_HAS_TTY=True SNAPCRAFT_ENABLE_DEVELOPER_DEBUG=True snap unset system proxy.http
Running multipass exec snapcraft-settlers-remake -- sudo -H -i env SNAPCRAFT_BUILD_ENVIRONMENT=managed-host HOME=/root SNAPCRAFT_HAS_TTY=True SNAPCRAFT_ENABLE_DEVELOPER_DEBUG=True snap unset system proxy.http
Running: sudo -H -i env SNAPCRAFT_BUILD_ENVIRONMENT=managed-host HOME=/root SNAPCRAFT_HAS_TTY=True SNAPCRAFT_ENABLE_DEVELOPER_DEBUG=True snap unset system proxy.https
Running multipass exec snapcraft-settlers-remake -- sudo -H -i env SNAPCRAFT_BUILD_ENVIRONMENT=managed-host HOME=/root SNAPCRAFT_HAS_TTY=True SNAPCRAFT_ENABLE_DEVELOPER_DEBUG=True snap unset system proxy.https
Running: sudo -H -i env SNAPCRAFT_BUILD_ENVIRONMENT=managed-host HOME=/root SNAPCRAFT_HAS_TTY=True SNAPCRAFT_ENABLE_DEVELOPER_DEBUG=True snapcraft snap
Running multipass exec snapcraft-settlers-remake -- sudo -H -i env SNAPCRAFT_BUILD_ENVIRONMENT=managed-host HOME=/root SNAPCRAFT_HAS_TTY=True SNAPCRAFT_ENABLE_DEVELOPER_DEBUG=True snapcraft snap
Starting snapcraft 7.0.7 from /snap/snapcraft/7717/lib/python3.8/site-packages/snapcraft_legacy/cli.
configure_requests_ca: using '/etc/ssl/certs/ca-certificates.crt' for certificate verification
Parts dir /root/parts
Stage dir /root/stage
Prime dir /root/prime
ignoring or passing through unknown icon=app/src/main/resources/images/siedler3-helme-logo-120.png
ignoring or passing through unknown parts=OrderedDict([('settlers-installer', OrderedDict([('plugin', 'dump'), ('source', 'https://github.com/HiranChaudhuri/settlers-installer/releases/download/nightly/settlersremake_1.0-1_amd64.deb'), ('source-type', 'deb')]))])
ignoring or passing through unknown icon=app/src/main/resources/images/siedler3-helme-logo-120.png
ignoring or passing through unknown parts={'settlers-installer': {'plugin': 'dump', 'source': 'https://github.com/HiranChaudhuri/settlers-installer/releases/download/nightly/settlersremake_1.0-1_amd64.deb', 'source-type': 'deb', 'build-environment': [{'PATH': '/snap/gnome-3-38-2004-sdk/current/usr/bin:$PATH'}, {'XDG_DATA_DIRS': '/root/stage/usr/share:/snap/gnome-3-38-2004-sdk/current/usr/share:/usr/share:$XDG_DATA_DIRS'}, {'LD_LIBRARY_PATH': '/snap/gnome-3-38-2004-sdk/current/lib/x86_64-linux-gnu:/snap/gnome-3-38-2004-sdk/current/usr/lib/x86_64-linux-gnu:/snap/gnome-3-38-2004-sdk/current/usr/lib:/snap/gnome-3-38-2004-sdk/current/usr/lib/vala-current:/snap/gnome-3-38-2004-sdk/current/usr/lib/x86_64-linux-gnu/pulseaudio${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}'}, {'PKG_CONFIG_PATH': '/snap/gnome-3-38-2004-sdk/current/usr/lib/x86_64-linux-gnu/pkgconfig:/snap/gnome-3-38-2004-sdk/current/usr/lib/pkgconfig:/snap/gnome-3-38-2004-sdk/current/usr/share/pkgconfig:$PKG_CONFIG_PATH'}, {'GETTEXTDATADIRS': '/snap/gnome-3-38-2004-sdk/current/usr/share/gettext-current:$GETTEXTDATADIRS'}, {'GDK_PIXBUF_MODULE_FILE': '/snap/gnome-3-38-2004-sdk/current/usr/lib/x86_64-linux-gnu/gdk-pixbuf-current/loaders.cache'}, {'ACLOCAL_PATH': '/snap/gnome-3-38-2004-sdk/current/usr/share/aclocal${ACLOCAL_PATH:+:$ACLOCAL_PATH}'}, {'PYTHONPATH': '/snap/gnome-3-38-2004-sdk/current/usr/lib/python3.8:/snap/gnome-3-38-2004-sdk/current/usr/lib/python3/dist-packages${PYTHONPATH:+:$PYTHONPATH}'}], 'stage': [], 'prime': []}, 'gnome-3-38-extension': {'source': '/snap/snapcraft/7717/share/snapcraft/extensions/desktop', 'source-subdir': 'gnome', 'plugin': 'make', 'make-parameters': ['WITH_PYTHON=3.8', 'PLATFORM_PLUG=gnome-3-38-2004'], 'build-snaps': ['gnome-3-38-2004-sdk/latest/stable'], 'build-packages': ['gcc'], 'stage': [], 'prime': []}}
Loading plugin module 'dump' with sys.path ['/root/project/snap/plugins', '/snap/snapcraft/7717/bin', '/snap/snapcraft/7717/usr/lib/python38.zip', '/snap/snapcraft/7717/usr/lib/python3.8', '/snap/snapcraft/7717/usr/lib/python3.8/lib-dynload', '/snap/snapcraft/7717/lib/python3.8/site-packages']
Setting up part 'settlers-installer' with plugin 'dump' and properties {'plugin': 'dump', 'source': 'https://github.com/HiranChaudhuri/settlers-installer/releases/download/nightly/settlersremake_1.0-1_amd64.deb', 'source-type': 'deb', 'build-environment': [{'PATH': '/snap/gnome-3-38-2004-sdk/current/usr/bin:$PATH'}, {'XDG_DATA_DIRS': '/root/stage/usr/share:/snap/gnome-3-38-2004-sdk/current/usr/share:/usr/share:$XDG_DATA_DIRS'}, {'LD_LIBRARY_PATH': '/snap/gnome-3-38-2004-sdk/current/lib/x86_64-linux-gnu:/snap/gnome-3-38-2004-sdk/current/usr/lib/x86_64-linux-gnu:/snap/gnome-3-38-2004-sdk/current/usr/lib:/snap/gnome-3-38-2004-sdk/current/usr/lib/vala-current:/snap/gnome-3-38-2004-sdk/current/usr/lib/x86_64-linux-gnu/pulseaudio${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}'}, {'PKG_CONFIG_PATH': '/snap/gnome-3-38-2004-sdk/current/usr/lib/x86_64-linux-gnu/pkgconfig:/snap/gnome-3-38-2004-sdk/current/usr/lib/pkgconfig:/snap/gnome-3-38-2004-sdk/current/usr/share/pkgconfig:$PKG_CONFIG_PATH'}, {'GETTEXTDATADIRS': '/snap/gnome-3-38-2004-sdk/current/usr/share/gettext-current:$GETTEXTDATADIRS'}, {'GDK_PIXBUF_MODULE_FILE': '/snap/gnome-3-38-2004-sdk/current/usr/lib/x86_64-linux-gnu/gdk-pixbuf-current/loaders.cache'}, {'ACLOCAL_PATH': '/snap/gnome-3-38-2004-sdk/current/usr/share/aclocal${ACLOCAL_PATH:+:$ACLOCAL_PATH}'}, {'PYTHONPATH': '/snap/gnome-3-38-2004-sdk/current/usr/lib/python3.8:/snap/gnome-3-38-2004-sdk/current/usr/lib/python3/dist-packages${PYTHONPATH:+:$PYTHONPATH}'}], 'stage': [], 'prime': []}.
Loading plugin module 'make' with sys.path ['/root/project/snap/plugins', '/snap/snapcraft/7717/bin', '/snap/snapcraft/7717/usr/lib/python38.zip', '/snap/snapcraft/7717/usr/lib/python3.8', '/snap/snapcraft/7717/usr/lib/python3.8/lib-dynload', '/snap/snapcraft/7717/lib/python3.8/site-packages']
Setting up part 'gnome-3-38-extension' with plugin 'make' and properties {'source': '/snap/snapcraft/7717/share/snapcraft/extensions/desktop', 'source-subdir': 'gnome', 'plugin': 'make', 'make-parameters': ['WITH_PYTHON=3.8', 'PLATFORM_PLUG=gnome-3-38-2004'], 'build-snaps': ['gnome-3-38-2004-sdk/latest/stable'], 'build-packages': ['gcc'], 'stage': [], 'prime': []}.
Requested build-packages: ['gcc', 'make']
Marking 'make' (and its dependencies) to be fetched
package: <Package: name:'make' architecture='amd64' id:640>
Marking 'gcc' (and its dependencies) to be fetched
package: <Package: name:'gcc' architecture='amd64' id:642>
Requested build-packages already installed: []
snapcraft is running in a docker or podman (OCI) container
Preparing to pull gnome-3-38-extension 
Cleaning later steps and re-pulling gnome-3-38-extension ('source' property changed)
snapcraft is running as a snap True, SNAP_NAME set to 'snapcraft'
+ snapcraftctl pull
Skipping pull settlers-installer (already ran)
Preparing to build gnome-3-38-extension 
Building gnome-3-38-extension 
snapcraft is running as a snap True, SNAP_NAME set to 'snapcraft'
+ snapcraftctl build
+ make -j2 WITH_PYTHON=3.8 PLATFORM_PLUG=gnome-3-38-2004
+ make -j2 install WITH_PYTHON=3.8 PLATFORM_PLUG=gnome-3-38-2004 DESTDIR=/root/parts/gnome-3-38-extension/install
install -d /root/parts/gnome-3-38-extension/install/gnome-platform
install -D -m755 hooks-configure-desktop "/root/parts/gnome-3-38-extension/install/snap/command-chain"/hooks-configure-desktop
install -d /root/parts/gnome-3-38-extension/install/data-dir
install -d /root/parts/gnome-3-38-extension/install/data-dir/icons
install -d /root/parts/gnome-3-38-extension/install/data-dir/sounds
install -d /root/parts/gnome-3-38-extension/install/data-dir/themes
install -D -m755 desktop-launch "/root/parts/gnome-3-38-extension/install/snap/command-chain"/desktop-launch
Skipping build settlers-installer (already ran)
Staging gnome-3-38-extension 
snapcraft is running as a snap True, SNAP_NAME set to 'snapcraft'
+ snapcraftctl stage
Skipping stage settlers-installer (already ran)
Priming gnome-3-38-extension 
snapcraft is running as a snap True, SNAP_NAME set to 'snapcraft'
+ snapcraftctl prime
_handle_elf: search_paths=['/root/prime', '/snap/core20/current', '/snap/gtk-common-themes/current/share/gtk2/Breeze', '/snap/gtk-common-themes/current/share/themes/Arc-Dark', '/snap/gtk-common-themes/current/share/themes/Adwaita-dark', '/snap/gtk-common-themes/current/share/icons/Yaru-red', '/snap/gnome-3-38-2004/current/', '/snap/gtk-common-themes/current/share/gtk2/Yaru-magenta', '/snap/gtk-common-themes/current/share/themes/Yaru-light', '/snap/gtk-common-themes/current/share/icons/Yaru-viridian-dark', '/snap/gtk-common-themes/current/share/themes/Greybird', '/snap/gtk-common-themes/current/share/themes/Yaru-sage', '/snap/gtk-common-themes/current/share/themes/Yaru-sage-dark', '/snap/gtk-common-themes/current/share/themes/Yaru-prussiangreen', '/snap/gtk-common-themes/current/share/icons/Yaru-sage-dark', '/snap/gtk-common-themes/current/share/icons/Humanity', '/snap/gtk-common-themes/current/share/gtk2/Breeze-Dark', '/snap/gtk-common-themes/current/share/icons/Yaru-sage', '/snap/gtk-common-themes/current/share/themes/Ambiance', '/snap/gtk-common-themes/current/share/icons/Yaru-purple', '/snap/gtk-common-themes/current/share/gtk2/HighContrast', '/snap/gtk-common-themes/current/share/icons/Papirus-Light-Maia', '/snap/gtk-common-themes/current/share/themes/Yaru-bark', '/snap/gtk-common-themes/current/share/themes/Matcha-dark-azul', '/snap/gtk-common-themes/current/share/themes/Matcha-dark-sea', '/snap/gtk-common-themes/current/share/themes/Yaru-red-dark', '/snap/gtk-common-themes/current/share/themes/Adwaita', '/snap/gtk-common-themes/current/share/gtk2/Adwaita', '/snap/gtk-common-themes/current/share/themes/Yaru-red', '/snap/gtk-common-themes/current/share/gtk2/Yaru-red', '/snap/gtk-common-themes/current/share/gtk2/Yaru-viridian-dark', '/snap/gtk-common-themes/current/share/themes/Yaru-viridian-dark', '/snap/gtk-common-themes/current/share/themes/Yaru-olive-dark', '/snap/gtk-common-themes/current/share/themes/Yaru-olive', '/snap/gtk-common-themes/current/share/themes/Matcha-dark-aliz', '/snap/gtk-common-themes/current/share/themes/Yaru-purple-dark', '/snap/gtk-common-themes/current/share/icons/ubuntu-mono-dark', '/snap/gtk-common-themes/current/share/gtk2/Greybird-dark', '/snap/gtk-common-themes/current/share/themes/Yaru-mate', '/snap/gtk-common-themes/current/share/gtk2/Yaru-mate-dark', '/snap/gtk-common-themes/current/share/icons/Yaru-prussiangreen', '/snap/gtk-common-themes/current/share/themes/Matcha-aliz', '/snap/gtk-common-themes/current/share/gtk2/Radiance', '/snap/gtk-common-themes/current/share/themes/Yaru-magenta', '/snap/gtk-common-themes/current/share/icons/Radiant-MATE', '/snap/gtk-common-themes/current/share/gtk2/Yaru-MATE-dark', '/snap/gtk-common-themes/current/share/gtk2/Yaru-dark', '/snap/gtk-common-themes/current/share/gtk2/Adwaita-dark', '/snap/gtk-common-themes/current/share/gtk2/Matcha-sea', '/snap/gtk-common-themes/current/share/icons/ubuntu-mono-light', '/snap/gtk-common-themes/current/share/themes/Yaru-dark', '/snap/gtk-common-themes/current/share/gtk2/Yaru-sage-dark', '/snap/gtk-common-themes/current/share/themes/Materia-dark', '/snap/gtk-common-themes/current/share/icons/Yaru-dark', '/snap/gtk-common-themes/current/share/icons/Yaru-mate', '/snap/gtk-common-themes/current/share/themes/Yaru-purple', '/snap/gtk-common-themes/current/share/icons/elementary', '/snap/gtk-common-themes/current/share/icons/Yaru-prussiangreen-dark', '/snap/gtk-common-themes/current/share/icons/redglass', '/snap/gtk-common-themes/current/share/gtk2/Materia-compact', '/snap/gtk-common-themes/current/share/gtk2/Yaru-mate', '/snap/gtk-common-themes/current/share/icons/elementary-xfce', '/snap/gtk-common-themes/current/share/gtk2/Yaru-magenta-dark', '/snap/gtk-common-themes/current/share/icons/Yaru-viridian', '/snap/gtk-common-themes/current/share/themes/elementary', '/snap/gtk-common-themes/current/share/gtk2/Yaru-sage', '/snap/gtk-common-themes/current/share/icons/Ambiant-MATE', '/snap/gtk-common-themes/current/share/icons/Yaru-blue-dark', '/snap/gtk-common-themes/current/share/themes/Breeze-Dark', '/snap/gtk-common-themes/current/share/themes/HighContrast', '/snap/gtk-common-themes/current/share/gtk2/Matcha-azul', '/snap/gtk-common-themes/current/share/icons/Yaru-purple-dark', '/snap/gtk-common-themes/current/share/gtk2/Matcha-aliz', '/snap/gtk-common-themes/current/share/icons/Yaru-MATE-light', '/snap/gtk-common-themes/current/share/themes/Yaru-MATE-light', '/snap/gtk-common-themes/current/share/gtk2/Materia-dark-compact', '/snap/gtk-common-themes/current/share/gtk2/Arc-Dark', '/snap/gtk-common-themes/current/share/themes/Yaru-MATE-dark', '/snap/gtk-common-themes/current/share/gtk2/Yaru-olive-dark', '/snap/gtk-common-themes/current/share/icons/DMZ-White', '/snap/gtk-common-themes/current/share/icons/Papirus-Adapta-Nokto-Maia', '/snap/gtk-common-themes/current/share/icons/hicolor', '/snap/gtk-common-themes/current/share/icons/Yaru-olive', '/snap/gtk-common-themes/current/share/themes/Yaru-blue', '/snap/gtk-common-themes/current/share/themes/Materia', '/snap/gtk-common-themes/current/share/themes/Yaru-mate-dark', '/snap/gtk-common-themes/current/share/icons/Yaru-mate-dark', '/snap/gtk-common-themes/current/share/themes/Yaru-viridian', '/snap/gtk-common-themes/current/share/themes/Greybird-dark', '/snap/gtk-common-themes/current/share/themes/Materia-dark-compact', '/snap/gtk-common-themes/current/share/icons/handhelds', '/snap/gtk-common-themes/current/share/gtk2/Greybird', '/snap/gtk-common-themes/current/share/icons/default', '/snap/gtk-common-themes/current/share/icons/Yaru-bark', '/snap/gtk-common-themes/current/share/icons/breeze_cursors', '/snap/gtk-common-themes/current/share/gtk2/Yaru-red-dark', '/snap/gtk-common-themes/current/share/themes/Materia-compact', '/snap/gtk-common-themes/current/share/icons/Papirus-Adapta-Maia', '/snap/gtk-common-themes/current/share/themes/Materia-light-compact', '/snap/gtk-common-themes/current/share/gtk2/Yaru-MATE-light', '/snap/gtk-common-themes/current/share/themes/Yaru-blue-dark', '/snap/gtk-common-themes/current/share/icons/whiteglass', '/snap/gtk-common-themes/current/share/gtk2/Yaru-bark', '/snap/gtk-common-themes/current/share/themes/Ambiant-MATE-Dark', '/snap/gtk-common-themes/current/share/themes/Arc', '/snap/gtk-common-themes/current/share/gtk2/Yaru-prussiangreen-dark', '/snap/gtk-common-themes/current/share/icons/Yaru-olive-dark', '/snap/gtk-common-themes/current/share/icons/elementary-xfce-darker', '/snap/gtk-common-themes/current/share/themes/Matcha-sea', '/snap/gtk-common-themes/current/share/gtk2/Matcha-dark-aliz', '/snap/gtk-common-themes/current/share/gtk2/Ambiant-MATE', '/snap/gtk-common-themes/current/share/gtk2/Arc-Darker', '/snap/gtk-common-themes/current/share/gtk2/elementary', '/snap/gtk-common-themes/current/share/gtk2/Yaru-bark-dark', '/snap/gtk-common-themes/current/share/icons/Breeze_Snow', '/snap/gtk-common-themes/current/share/gtk2/Arc', '/snap/gtk-common-themes/current/share/icons/elementary-xfce-darkest', '/snap/gtk-common-themes/current/share/themes/Radiance', '/snap/gtk-common-themes/current/share/icons/Yaru-magenta-dark', '/snap/gtk-common-themes/current/share/gtk2/Yaru-purple', '/snap/gtk-common-themes/current/share/icons/DMZ-Black', '/snap/gtk-common-themes/current/share/gtk2/Ambiance', '/snap/gtk-common-themes/current/share/themes/Yaru', '/snap/gtk-common-themes/current/share/gtk2/Radiant-MATE', '/snap/gtk-common-themes/current/share/gtk2/Ambiant-MATE-Dark', '/snap/gtk-common-themes/current/share/icons/Adwaita', '/snap/gtk-common-themes/current/share/themes/Matcha-azul', '/snap/gtk-common-themes/current/share/icons/Yaru-red-dark', '/snap/gtk-common-themes/current/share/gtk2/Matcha-dark-azul', '/snap/gtk-common-themes/current/share/icons/elementary-xfce-dark', '/snap/gtk-common-themes/current/share/sounds/Yaru', '/snap/gtk-common-themes/current/share/themes/Ambiant-MATE', '/snap/gtk-common-themes/current/share/sounds/freedesktop', '/snap/gtk-common-themes/current/share/gtk2/Yaru', '/snap/gtk-common-themes/current/share/themes/Radiant-MATE', '/snap/gtk-common-themes/current/share/icons/Yaru-MATE-dark', '/snap/gtk-common-themes/current/share/themes/Yaru-magenta-dark', '/snap/gtk-common-themes/current/share/themes/Breeze', '/snap/gtk-common-themes/current/share/gtk2/Yaru-olive', '/snap/gtk-common-themes/current/share/icons/Yaru-bark-dark', '/snap/gtk-common-themes/current/share/gtk2/Yaru-prussiangreen', '/snap/gtk-common-themes/current/share/gtk2/Matcha-dark-sea', '/snap/gtk-common-themes/current/share/icons/Yaru-magenta', '/snap/gtk-common-themes/current/share/icons/Yaru-blue', '/snap/gtk-common-themes/current/share/icons/Papirus-Dark-Maia', '/snap/gtk-common-themes/current/share/themes/Yaru-bark-dark', '/snap/gtk-common-themes/current/share/themes/Arc-Darker', '/snap/gtk-common-themes/current/share/gtk2/Yaru-purple-dark', '/snap/gtk-common-themes/current/share/themes/Yaru-prussiangreen-dark', '/snap/gtk-common-themes/current/share/icons/Humanity-Dark', '/snap/gtk-common-themes/current/share/themes/Materia-light', '/snap/gtk-common-themes/current/share/gtk2/Yaru-blue', '/snap/gtk-common-themes/current/share/icons/Yaru', '/snap/gtk-common-themes/current/share/icons/Papirus-Maia', '/snap/gtk-common-themes/current/share/gtk2/Yaru-blue-dark', '/snap/gtk-common-themes/current/share/gtk2/Yaru-viridian', '/snap/gtk-common-themes/current/share/icons/HighContrast']
_handle_elf: split_dependencies={'/': set(), '/root/prime': set(), '/snap/core20/current': set(), '/snap/gtk-common-themes/current/share/gtk2/Breeze': set(), '/snap/gtk-common-themes/current/share/themes/Arc-Dark': set(), '/snap/gtk-common-themes/current/share/themes/Adwaita-dark': set(), '/snap/gtk-common-themes/current/share/icons/Yaru-red': set(), '/snap/gnome-3-38-2004/current/': set(), '/snap/gtk-common-themes/current/share/gtk2/Yaru-magenta': set(), '/snap/gtk-common-themes/current/share/themes/Yaru-light': set(), '/snap/gtk-common-themes/current/share/icons/Yaru-viridian-dark': set(), '/snap/gtk-common-themes/current/share/themes/Greybird': set(), '/snap/gtk-common-themes/current/share/themes/Yaru-sage': set(), '/snap/gtk-common-themes/current/share/themes/Yaru-sage-dark': set(), '/snap/gtk-common-themes/current/share/themes/Yaru-prussiangreen': set(), '/snap/gtk-common-themes/current/share/icons/Yaru-sage-dark': set(), '/snap/gtk-common-themes/current/share/icons/Humanity': set(), '/snap/gtk-common-themes/current/share/gtk2/Breeze-Dark': set(), '/snap/gtk-common-themes/current/share/icons/Yaru-sage': set(), '/snap/gtk-common-themes/current/share/themes/Ambiance': set(), '/snap/gtk-common-themes/current/share/icons/Yaru-purple': set(), '/snap/gtk-common-themes/current/share/gtk2/HighContrast': set(), '/snap/gtk-common-themes/current/share/icons/Papirus-Light-Maia': set(), '/snap/gtk-common-themes/current/share/themes/Yaru-bark': set(), '/snap/gtk-common-themes/current/share/themes/Matcha-dark-azul': set(), '/snap/gtk-common-themes/current/share/themes/Matcha-dark-sea': set(), '/snap/gtk-common-themes/current/share/themes/Yaru-red-dark': set(), '/snap/gtk-common-themes/current/share/themes/Adwaita': set(), '/snap/gtk-common-themes/current/share/gtk2/Adwaita': set(), '/snap/gtk-common-themes/current/share/themes/Yaru-red': set(), '/snap/gtk-common-themes/current/share/gtk2/Yaru-red': set(), '/snap/gtk-common-themes/current/share/gtk2/Yaru-viridian-dark': set(), '/snap/gtk-common-themes/current/share/themes/Yaru-viridian-dark': set(), '/snap/gtk-common-themes/current/share/themes/Yaru-olive-dark': set(), '/snap/gtk-common-themes/current/share/themes/Yaru-olive': set(), '/snap/gtk-common-themes/current/share/themes/Matcha-dark-aliz': set(), '/snap/gtk-common-themes/current/share/themes/Yaru-purple-dark': set(), '/snap/gtk-common-themes/current/share/icons/ubuntu-mono-dark': set(), '/snap/gtk-common-themes/current/share/gtk2/Greybird-dark': set(), '/snap/gtk-common-themes/current/share/themes/Yaru-mate': set(), '/snap/gtk-common-themes/current/share/gtk2/Yaru-mate-dark': set(), '/snap/gtk-common-themes/current/share/icons/Yaru-prussiangreen': set(), '/snap/gtk-common-themes/current/share/themes/Matcha-aliz': set(), '/snap/gtk-common-themes/current/share/gtk2/Radiance': set(), '/snap/gtk-common-themes/current/share/themes/Yaru-magenta': set(), '/snap/gtk-common-themes/current/share/icons/Radiant-MATE': set(), '/snap/gtk-common-themes/current/share/gtk2/Yaru-MATE-dark': set(), '/snap/gtk-common-themes/current/share/gtk2/Yaru-dark': set(), '/snap/gtk-common-themes/current/share/gtk2/Adwaita-dark': set(), '/snap/gtk-common-themes/current/share/gtk2/Matcha-sea': set(), '/snap/gtk-common-themes/current/share/icons/ubuntu-mono-light': set(), '/snap/gtk-common-themes/current/share/themes/Yaru-dark': set(), '/snap/gtk-common-themes/current/share/gtk2/Yaru-sage-dark': set(), '/snap/gtk-common-themes/current/share/themes/Materia-dark': set(), '/snap/gtk-common-themes/current/share/icons/Yaru-dark': set(), '/snap/gtk-common-themes/current/share/icons/Yaru-mate': set(), '/snap/gtk-common-themes/current/share/themes/Yaru-purple': set(), '/snap/gtk-common-themes/current/share/icons/elementary': set(), '/snap/gtk-common-themes/current/share/icons/Yaru-prussiangreen-dark': set(), '/snap/gtk-common-themes/current/share/icons/redglass': set(), '/snap/gtk-common-themes/current/share/gtk2/Materia-compact': set(), '/snap/gtk-common-themes/current/share/gtk2/Yaru-mate': set(), '/snap/gtk-common-themes/current/share/icons/elementary-xfce': set(), '/snap/gtk-common-themes/current/share/gtk2/Yaru-magenta-dark': set(), '/snap/gtk-common-themes/current/share/icons/Yaru-viridian': set(), '/snap/gtk-common-themes/current/share/themes/elementary': set(), '/snap/gtk-common-themes/current/share/gtk2/Yaru-sage': set(), '/snap/gtk-common-themes/current/share/icons/Ambiant-MATE': set(), '/snap/gtk-common-themes/current/share/icons/Yaru-blue-dark': set(), '/snap/gtk-common-themes/current/share/themes/Breeze-Dark': set(), '/snap/gtk-common-themes/current/share/themes/HighContrast': set(), '/snap/gtk-common-themes/current/share/gtk2/Matcha-azul': set(), '/snap/gtk-common-themes/current/share/icons/Yaru-purple-dark': set(), '/snap/gtk-common-themes/current/share/gtk2/Matcha-aliz': set(), '/snap/gtk-common-themes/current/share/icons/Yaru-MATE-light': set(), '/snap/gtk-common-themes/current/share/themes/Yaru-MATE-light': set(), '/snap/gtk-common-themes/current/share/gtk2/Materia-dark-compact': set(), '/snap/gtk-common-themes/current/share/gtk2/Arc-Dark': set(), '/snap/gtk-common-themes/current/share/themes/Yaru-MATE-dark': set(), '/snap/gtk-common-themes/current/share/gtk2/Yaru-olive-dark': set(), '/snap/gtk-common-themes/current/share/icons/DMZ-White': set(), '/snap/gtk-common-themes/current/share/icons/Papirus-Adapta-Nokto-Maia': set(), '/snap/gtk-common-themes/current/share/icons/hicolor': set(), '/snap/gtk-common-themes/current/share/icons/Yaru-olive': set(), '/snap/gtk-common-themes/current/share/themes/Yaru-blue': set(), '/snap/gtk-common-themes/current/share/themes/Materia': set(), '/snap/gtk-common-themes/current/share/themes/Yaru-mate-dark': set(), '/snap/gtk-common-themes/current/share/icons/Yaru-mate-dark': set(), '/snap/gtk-common-themes/current/share/themes/Yaru-viridian': set(), '/snap/gtk-common-themes/current/share/themes/Greybird-dark': set(), '/snap/gtk-common-themes/current/share/themes/Materia-dark-compact': set(), '/snap/gtk-common-themes/current/share/icons/handhelds': set(), '/snap/gtk-common-themes/current/share/gtk2/Greybird': set(), '/snap/gtk-common-themes/current/share/icons/default': set(), '/snap/gtk-common-themes/current/share/icons/Yaru-bark': set(), '/snap/gtk-common-themes/current/share/icons/breeze_cursors': set(), '/snap/gtk-common-themes/current/share/gtk2/Yaru-red-dark': set(), '/snap/gtk-common-themes/current/share/themes/Materia-compact': set(), '/snap/gtk-common-themes/current/share/icons/Papirus-Adapta-Maia': set(), '/snap/gtk-common-themes/current/share/themes/Materia-light-compact': set(), '/snap/gtk-common-themes/current/share/gtk2/Yaru-MATE-light': set(), '/snap/gtk-common-themes/current/share/themes/Yaru-blue-dark': set(), '/snap/gtk-common-themes/current/share/icons/whiteglass': set(), '/snap/gtk-common-themes/current/share/gtk2/Yaru-bark': set(), '/snap/gtk-common-themes/current/share/themes/Ambiant-MATE-Dark': set(), '/snap/gtk-common-themes/current/share/themes/Arc': set(), '/snap/gtk-common-themes/current/share/gtk2/Yaru-prussiangreen-dark': set(), '/snap/gtk-common-themes/current/share/icons/Yaru-olive-dark': set(), '/snap/gtk-common-themes/current/share/icons/elementary-xfce-darker': set(), '/snap/gtk-common-themes/current/share/themes/Matcha-sea': set(), '/snap/gtk-common-themes/current/share/gtk2/Matcha-dark-aliz': set(), '/snap/gtk-common-themes/current/share/gtk2/Ambiant-MATE': set(), '/snap/gtk-common-themes/current/share/gtk2/Arc-Darker': set(), '/snap/gtk-common-themes/current/share/gtk2/elementary': set(), '/snap/gtk-common-themes/current/share/gtk2/Yaru-bark-dark': set(), '/snap/gtk-common-themes/current/share/icons/Breeze_Snow': set(), '/snap/gtk-common-themes/current/share/gtk2/Arc': set(), '/snap/gtk-common-themes/current/share/icons/elementary-xfce-darkest': set(), '/snap/gtk-common-themes/current/share/themes/Radiance': set(), '/snap/gtk-common-themes/current/share/icons/Yaru-magenta-dark': set(), '/snap/gtk-common-themes/current/share/gtk2/Yaru-purple': set(), '/snap/gtk-common-themes/current/share/icons/DMZ-Black': set(), '/snap/gtk-common-themes/current/share/gtk2/Ambiance': set(), '/snap/gtk-common-themes/current/share/themes/Yaru': set(), '/snap/gtk-common-themes/current/share/gtk2/Radiant-MATE': set(), '/snap/gtk-common-themes/current/share/gtk2/Ambiant-MATE-Dark': set(), '/snap/gtk-common-themes/current/share/icons/Adwaita': set(), '/snap/gtk-common-themes/current/share/themes/Matcha-azul': set(), '/snap/gtk-common-themes/current/share/icons/Yaru-red-dark': set(), '/snap/gtk-common-themes/current/share/gtk2/Matcha-dark-azul': set(), '/snap/gtk-common-themes/current/share/icons/elementary-xfce-dark': set(), '/snap/gtk-common-themes/current/share/sounds/Yaru': set(), '/snap/gtk-common-themes/current/share/themes/Ambiant-MATE': set(), '/snap/gtk-common-themes/current/share/sounds/freedesktop': set(), '/snap/gtk-common-themes/current/share/gtk2/Yaru': set(), '/snap/gtk-common-themes/current/share/themes/Radiant-MATE': set(), '/snap/gtk-common-themes/current/share/icons/Yaru-MATE-dark': set(), '/snap/gtk-common-themes/current/share/themes/Yaru-magenta-dark': set(), '/snap/gtk-common-themes/current/share/themes/Breeze': set(), '/snap/gtk-common-themes/current/share/gtk2/Yaru-olive': set(), '/snap/gtk-common-themes/current/share/icons/Yaru-bark-dark': set(), '/snap/gtk-common-themes/current/share/gtk2/Yaru-prussiangreen': set(), '/snap/gtk-common-themes/current/share/gtk2/Matcha-dark-sea': set(), '/snap/gtk-common-themes/current/share/icons/Yaru-magenta': set(), '/snap/gtk-common-themes/current/share/icons/Yaru-blue': set(), '/snap/gtk-common-themes/current/share/icons/Papirus-Dark-Maia': set(), '/snap/gtk-common-themes/current/share/themes/Yaru-bark-dark': set(), '/snap/gtk-common-themes/current/share/themes/Arc-Darker': set(), '/snap/gtk-common-themes/current/share/gtk2/Yaru-purple-dark': set(), '/snap/gtk-common-themes/current/share/themes/Yaru-prussiangreen-dark': set(), '/snap/gtk-common-themes/current/share/icons/Humanity-Dark': set(), '/snap/gtk-common-themes/current/share/themes/Materia-light': set(), '/snap/gtk-common-themes/current/share/gtk2/Yaru-blue': set(), '/snap/gtk-common-themes/current/share/icons/Yaru': set(), '/snap/gtk-common-themes/current/share/icons/Papirus-Maia': set(), '/snap/gtk-common-themes/current/share/gtk2/Yaru-blue-dark': set(), '/snap/gtk-common-themes/current/share/gtk2/Yaru-viridian': set(), '/snap/gtk-common-themes/current/share/icons/HighContrast': set()}
snapcraft is running as a snap True, SNAP_NAME set to 'snapcraft'
Skipping prime settlers-installer (already ran)
'grade' property not specified: defaulting to 'stable'.
ignoring or passing through unknown icon=app/src/main/resources/images/siedler3-helme-logo-120.png
ignoring or passing through unknown parts={'settlers-installer': {'plugin': 'dump', 'source': 'https://github.com/HiranChaudhuri/settlers-installer/releases/download/nightly/settlersremake_1.0-1_amd64.deb', 'source-type': 'deb', 'build-environment': [{'PATH': '/snap/gnome-3-38-2004-sdk/current/usr/bin:$PATH'}, {'XDG_DATA_DIRS': '/root/stage/usr/share:/snap/gnome-3-38-2004-sdk/current/usr/share:/usr/share:$XDG_DATA_DIRS'}, {'LD_LIBRARY_PATH': '/snap/gnome-3-38-2004-sdk/current/lib/x86_64-linux-gnu:/snap/gnome-3-38-2004-sdk/current/usr/lib/x86_64-linux-gnu:/snap/gnome-3-38-2004-sdk/current/usr/lib:/snap/gnome-3-38-2004-sdk/current/usr/lib/vala-current:/snap/gnome-3-38-2004-sdk/current/usr/lib/x86_64-linux-gnu/pulseaudio${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}'}, {'PKG_CONFIG_PATH': '/snap/gnome-3-38-2004-sdk/current/usr/lib/x86_64-linux-gnu/pkgconfig:/snap/gnome-3-38-2004-sdk/current/usr/lib/pkgconfig:/snap/gnome-3-38-2004-sdk/current/usr/share/pkgconfig:$PKG_CONFIG_PATH'}, {'GETTEXTDATADIRS': '/snap/gnome-3-38-2004-sdk/current/usr/share/gettext-current:$GETTEXTDATADIRS'}, {'GDK_PIXBUF_MODULE_FILE': '/snap/gnome-3-38-2004-sdk/current/usr/lib/x86_64-linux-gnu/gdk-pixbuf-current/loaders.cache'}, {'ACLOCAL_PATH': '/snap/gnome-3-38-2004-sdk/current/usr/share/aclocal${ACLOCAL_PATH:+:$ACLOCAL_PATH}'}, {'PYTHONPATH': '/snap/gnome-3-38-2004-sdk/current/usr/lib/python3.8:/snap/gnome-3-38-2004-sdk/current/usr/lib/python3/dist-packages${PYTHONPATH:+:$PYTHONPATH}'}], 'stage': [], 'prime': []}, 'gnome-3-38-extension': {'source': '/snap/snapcraft/7717/share/snapcraft/extensions/desktop', 'source-subdir': 'gnome', 'plugin': 'make', 'make-parameters': ['WITH_PYTHON=3.8', 'PLATFORM_PLUG=gnome-3-38-2004'], 'build-snaps': ['gnome-3-38-2004-sdk/latest/stable'], 'build-packages': ['gcc'], 'stage': [], 'prime': []}}
Running pack command: [PosixPath('/usr/bin/snap'), 'pack', '/root/prime']
Snapping |                                                                                                                                                                                      
stdout: built: settlers-remake_0.0.1_amd64.snap
 | stderr: 
Snapped settlers-remake_0.0.1_amd64.snap
Running multipass stop --time 10 snapcraft-settlers-remake
$

Thanks for the link to source. I’m not a gradle user, but I’ve been learning quite a bit building your project.

A few things:

gradle-output-dir

gradle-output-dir is appended to the path /root/parts/settlers-remake/build. When I ran snapcraft with gradle-output-dir: app/build/libs, snapcraft was able to find the jar file.
Perhaps that will work for you?

gradlew command

In your github workflow, you run gradlew --info build. However, snapcraft runs gradlew jar. Does that make a difference for your building process?

Related, I had to remove gradle-options: [binZip, -xtest, -xcreateGitTag]. I couldn’t figure out why they were giving me errors.

git commit

I tried using the snapcraft file in this commit. The subsequent commits had the non-gradle version of the snapcraft.yaml file. I had a bit of trouble with some of it (like with source-tag and gradle-options).

downloading a deb package

Downloading the deb release from the github nightly builder is clever! I still think we can get it to build with snapcraft’s gradle plugin.

Permissions

“Probably the permissions is the bigger issue.” What do you mean by this?

Wow, you really investigated on my project. Thank you for taking the time and the laborate answer. Let me comment on the things you raised.

gradle-output-dir / gradlew command

It seems my quirky build needs to be run with the correct options, or I have to fix some things in the build script. Probably improving the build script is the easier part and I am willing to do so. But then I did not find what to look for in any documentation or error message and that may be room for improvement on snapcraft side.

So what I learned now is that per default snapcraft runs gradlew jar and it is expected to drop the built jar file in the build directory of the main project.

git commit / downloading a deb package

You even tried to look at the history of the project. I am impressed. Yes, I tried different stuff - not really knowing where to go to, and I am aware my gradle build script may behave strange.

Downloading the deb was my way out of not getting the project built directly. I was surprised a bit that this was not one of the standard walkthroughs on the snapcraft website, but eventually it works. If building on snapcraft is the preferred way I can switch that as well, this is probably just a matter of taste.

Permissions

You are absolutely right on this one: The permissions are what made me stop searching further. So a snap is an isolated piece of code - maybe a bit like a docker container but on desktop computers with direct user interaction. And it can only interact with other system resources if such access is declared - I like that.

Now looking at the need for my application I feel I need full access to the filesystem, which would require extra permission from snapcraft but I am not sure. My application is an installer so running another project (settlers-remake) gets done more easily. I thought about different packaging, even packaging settlers-remake directly but there is still some strange stuff then. Hence the idea to make a snap for the installer.

But then this installer can access CD/DVD (and it has to search /etc/fstab for the correct mount points), in case the files are on the computer already it can scan the filesystem to point the user to the existing files etc. If snaps should have the least possible privileges, how can I do that? Or the other way round: If I cannot do that, actually snapping my project would not make much sense.

How to go with that?

gradle-output-dir / gradlew command

+1 on updating the build script to work with gradlew jar.

I agree that the gradle plugin would benefit from improvements:

  1. More descriptive logging and error messaging.
  2. Field in snapcraft.yaml to override gradlew jar.

I’ve noted this feedback and will see what I can do.

Permissions

My suggestion for troubleshooting filesystem access:

Set confinement: devmode in snapcraft.yaml while building your snap. Once it works, install snappy-debug and check what interfaces are being used, add them to your snapcraft.yaml file, and finally set confinement: strict.

1 Like