Gradle is a build automation tool for java and android projects. Developer working on java projects know about gradle command use. This tutorial covers list of commands used by developer for dailu usage in projects
- Gitignore file for Intelli IDEA editor for gradle projects. The gradle projects are loaded and configured differently in each IDE. Intelli IDE generates a lot of temporary files, add them to the gitignore file in gradle applications. Here is the git ignore file example for Intelli IDEA.
- The Brew Cheatsheet commands can be downloaded from the link below. The PDF document contains a list of the brew commands that are frequently used. This cheatsheet document is not intended as a complete documented list of all commands and for that you should rather visit the official brew documentation page.
Please have a look of my previous article maven installation. For the maven installation, the JDK is required.
This tip explains how to synchronize your project with Gradle when updating build.gradle files and provides insight on handling the cache when using Android Studio. There are multiple levels of cache. We will explain the difference between the cache behind the 'Invalidate cache and restart' menu, the 'Clean project' one and other gradle caches involved in building an Android project.
Gradle commands list
You can use either gradlew
or gradle.bat file for command execution
Compile gradle project
It will compile the project java files
list tasks of a gradle build
all tasks can be listed for build file using below command
It will display all tasks related the build file in a project
Running spring boot project with gradle
In spring boot project, once gradle plugin is configured, Application is build using below command
How do you make jar file for spring boot application
Here is the command for creating war file for the same
Spring boot application can be started using bootRun command
This will compile, copy and run the spring boot server, It is not required to build and compile the application.
This is a reference card of useful commands for administrating Gentoo systems. Newcomers and grey beards alike are encouraged to add their helpful tips below.
Package management
Sync methods
Sync all repositories that are set to auto-sync including the Gentoo ebuild repository:
Sync the Gentoo ebuild repository using the mirrors by obtaining a snapshot that is (at most) a day old:
Sync custom package repository and the Gentoo ebuild repository using eix:
If there are overlays created by app-portage/layman, to sync them:
app-portage/layman can be installed by issuing:
app-portage/eix can be installed by issuing:
Gather more information on eix by reading its manual:
Angstrom to Bohr and Bohr to Angstrom conversion. A simplistic 'Google Translate' for Angstrom to Bohr and Bohr to Angstrom conversion page. Whatever (space separated) numbers you type or paste in there get converted preserving the (im)precision. You can paste in entire xyz files. How many angstrom in 1 bohr? The answer is 0.52918. We assume you are converting between angstrom and bohr. You can view more details on each measurement unit: angstrom or bohr The SI base unit for length is the metre. 1 metre is equal to 0 angstrom, or 6.321 bohr. Note that rounding errors may occur, so always check the results. Angstrom to bohr conversion factor. More information about this unit: angstrom / bohr radius The base unit of length in the International System Of Units (SI) is: meter (m) 1 meter is equal to 0 angstrom; 1 angstrom is equal to 1.0E-10 meter; 1 meter is equal to 6.321 bohr radius; 1. How many bohr in 1 angstrom? The answer is 1.321. We assume you are converting between bohr and angstrom. You can view more details on each measurement unit: bohr or angstrom The SI base unit for length is the metre. 1 metre is equal to 6.321 bohr, or 0 angstrom. Note that rounding errors may occur, so always check the results.
Package listings
qlist is provided by app-portage/portage-utils
List installed packages with version number and name of used overlay:
To view the list of packages in the world set along with their available versions it is possible to use app-portage/eix
You can keep color in the output by calling it with the 'color' switch:
Package installation
In the following examples the www-client/firefox package will be used, but users can replace it with their package of interest.
List what packages would be installed without installing them:
Install a specific version of a package (Use '='(backslash and equal sign) if the current shell attaches special meaning to '=' in a command):
Install a package without adding it to the world file:
or
Package removal
Recommended method
The recommended way to remove a package is by using deselect. This removes it from the @world set (i.e. says the package is no longer wanted). To clean up the system afterwards, run depclean as given below.
And then depclean afterwards (the -p should be removed if after running, it shows will not remove any needed packages):
Separately, to remove a package that no other packages depend on:
root #
emerge --ask --verbose --depclean www-client/firefox
As a safety measure, depclean will not remove any packages unless all required dependencies have been resolved. As a consequence of this, it often becomes necessary to run:
root #
emerge --update --newuse --deep --quiet @world
Avoid unnecessary rebuilds when USE flags only get added to or dropped from the repository and use the --quiet
flag for quicker execution:
root #
emerge --update --changed-use --deep --quiet @world
Unclean removal (ignoring dependencies)
Remove a package even if it is needed by other packages:
Use with caution. The
-C
option can break software. Best if used to temporarily remove to satisfy a hard block.Package upgrades
Upgrade all installed packages, dependencies, and deep dependencies that are outdated or have USE flag changes (avoiding unnecessary rebuilds when USE changes have no impact):
root #
emerge --ask --verbose --update --deep --changed-use @world
Package troubleshooting
Check for and rebuild missing libraries (not normally needed):
equery is part of app-portage/gentoolkit. You can obtain it by issuing this command:
Tell which installed package provides a command using equery:
Tell which (not) installed package provides a command using e-file:
Install e-file with:
Tell which packages depend on a specific package (cat/pkg in the example) using equery:
Get information about a package using eix:
Do not unemerge sys-libs/glibc. It is needed by nearly every other package. If you inadvertedly remove it you may need a rescue stick/disk. You can fetch glibc after setting
PORTAGE_BINHOST='http://packages.gentooexperimental.org/packages/amd64-stable/'
in /etc/portage/make.conf.Portage enhancements
Manage configuration changes after an emerge completes:
Or alternatively:
After installations or updates
After updating perl-core packages:
or if previous didn't help:
For haskell packages:
USE flags
Obtain descriptions and usage of the USE flag X
using euse:
Gather more information on euse by reading its manual page:
Show what packages have the mysql
USE flag:
Show what packages are currently built with the mysql
USE flag:
Show what USE flags are available for a specific package:
Quickly add a required USE flag for a package install:
root #
echo 'dev-util/cmake -qt5' >> /etc/portage/package.use
Important Portage files[i 1]
- /etc/portage/make.conf - Global settings (USE flags, compiler options).
- /etc/portage/package.use - USE flags of individual packages. Can also be a folder containing multiple files.
- /etc/portage/package.accept_keywords - Keyword individual packages; e.g. ~amd64, ~x86, or ∼arm.
- /etc/portage/package.license - Accepted licenses
- /var/lib/portage/world - List of explicitly installed package atoms.
- /var/db/pkg - Contains information for every installed package a set of files about the installation.
Log management
genlop
genlop is a Portage log processor, also estimating build times when emerging packages.
Install genlop by issuing:
You can gather more information on app-portage/genlop by reading its manual page:
View the last 10 emerges (installs):
View how long emerging LibreOffice took:
Estimate how long emerge -uND --with-bdeps=y @world will take:
Watch the latest merging ebuild during system upgrades:
Overlays
eselect repository
app-eselect/eselect-repository can be installed by issuing:
List all existing overlays:
List all installed overlays:
See also Eselect/Repository
Layman
app-portage/layman can be installed by issuing:
List all existing overlays:
List all installed overlays:
See also Layman
Services
Obtain root shell (if the current user is listed in the sudoers list):
OpenRC
Start the ssh daemon in the default runlevel at boot:
Start the sshd service now:
Check if the sshd service is running:
systemd
Start the ssh daemon at boot:
Start the sshd service now:
Check if the sshd service is running:
Gentoo Monthly Newsletter (GMN)
Search packages in Portage by regular expressions:
Overlays vary from very small to very large in size. As a result they slow down the majority of Portage operations. That happens because overlays do not contain metadata caches. The cache is used to speed up searches and the building of dependency trees. A neat trick is to generate local metadata cache after syncing overlays.
This trick also works in conjunction with eix. eix-update can use metadata cache generated by emerge --regen to speed up things. To enable this, add the following variable to /etc/eixrc/00-eixrc:
/etc/eixrc/00-eixrc
qcheck
Use qcheck to verify installed packages:
qcheck comes with app-portage/portage-utils and can be installed by running this command:
Learn more about qcheck by reading its manual page:
See also
External resources
Spring boot application can be started using bootRun command
This will compile, copy and run the spring boot server, It is not required to build and compile the application.
This is a reference card of useful commands for administrating Gentoo systems. Newcomers and grey beards alike are encouraged to add their helpful tips below.
Package management
Sync methods
Sync all repositories that are set to auto-sync including the Gentoo ebuild repository:
Sync the Gentoo ebuild repository using the mirrors by obtaining a snapshot that is (at most) a day old:
Sync custom package repository and the Gentoo ebuild repository using eix:
If there are overlays created by app-portage/layman, to sync them:
app-portage/layman can be installed by issuing:
app-portage/eix can be installed by issuing:
Gather more information on eix by reading its manual:
Angstrom to Bohr and Bohr to Angstrom conversion. A simplistic 'Google Translate' for Angstrom to Bohr and Bohr to Angstrom conversion page. Whatever (space separated) numbers you type or paste in there get converted preserving the (im)precision. You can paste in entire xyz files. How many angstrom in 1 bohr? The answer is 0.52918. We assume you are converting between angstrom and bohr. You can view more details on each measurement unit: angstrom or bohr The SI base unit for length is the metre. 1 metre is equal to 0 angstrom, or 6.321 bohr. Note that rounding errors may occur, so always check the results. Angstrom to bohr conversion factor. More information about this unit: angstrom / bohr radius The base unit of length in the International System Of Units (SI) is: meter (m) 1 meter is equal to 0 angstrom; 1 angstrom is equal to 1.0E-10 meter; 1 meter is equal to 6.321 bohr radius; 1. How many bohr in 1 angstrom? The answer is 1.321. We assume you are converting between bohr and angstrom. You can view more details on each measurement unit: bohr or angstrom The SI base unit for length is the metre. 1 metre is equal to 6.321 bohr, or 0 angstrom. Note that rounding errors may occur, so always check the results.
Package listings
qlist is provided by app-portage/portage-utils
List installed packages with version number and name of used overlay:
To view the list of packages in the world set along with their available versions it is possible to use app-portage/eix
You can keep color in the output by calling it with the 'color' switch:
Package installation
In the following examples the www-client/firefox package will be used, but users can replace it with their package of interest.
List what packages would be installed without installing them:
Install a specific version of a package (Use '='(backslash and equal sign) if the current shell attaches special meaning to '=' in a command):
Install a package without adding it to the world file:
or
Package removal
Recommended method
The recommended way to remove a package is by using deselect. This removes it from the @world set (i.e. says the package is no longer wanted). To clean up the system afterwards, run depclean as given below.
And then depclean afterwards (the -p should be removed if after running, it shows will not remove any needed packages):
Separately, to remove a package that no other packages depend on:
root #
emerge --ask --verbose --depclean www-client/firefox
As a safety measure, depclean will not remove any packages unless all required dependencies have been resolved. As a consequence of this, it often becomes necessary to run:
root #
emerge --update --newuse --deep --quiet @world
Avoid unnecessary rebuilds when USE flags only get added to or dropped from the repository and use the --quiet
flag for quicker execution:
root #
emerge --update --changed-use --deep --quiet @world
Unclean removal (ignoring dependencies)
Remove a package even if it is needed by other packages:
Use with caution. The
-C
option can break software. Best if used to temporarily remove to satisfy a hard block.Package upgrades
Upgrade all installed packages, dependencies, and deep dependencies that are outdated or have USE flag changes (avoiding unnecessary rebuilds when USE changes have no impact):
root #
emerge --ask --verbose --update --deep --changed-use @world
Package troubleshooting
Check for and rebuild missing libraries (not normally needed):
equery is part of app-portage/gentoolkit. You can obtain it by issuing this command:
Tell which installed package provides a command using equery:
Tell which (not) installed package provides a command using e-file:
Install e-file with:
Tell which packages depend on a specific package (cat/pkg in the example) using equery:
Get information about a package using eix:
Do not unemerge sys-libs/glibc. It is needed by nearly every other package. If you inadvertedly remove it you may need a rescue stick/disk. You can fetch glibc after setting
PORTAGE_BINHOST='http://packages.gentooexperimental.org/packages/amd64-stable/'
in /etc/portage/make.conf.Portage enhancements
Manage configuration changes after an emerge completes:
Or alternatively:
After installations or updates
After updating perl-core packages:
or if previous didn't help:
For haskell packages:
USE flags
Obtain descriptions and usage of the USE flag X
using euse:
Gather more information on euse by reading its manual page:
Show what packages have the mysql
USE flag:
Show what packages are currently built with the mysql
USE flag:
Show what USE flags are available for a specific package:
Quickly add a required USE flag for a package install:
root #
echo 'dev-util/cmake -qt5' >> /etc/portage/package.use
Important Portage files[i 1]
- /etc/portage/make.conf - Global settings (USE flags, compiler options).
- /etc/portage/package.use - USE flags of individual packages. Can also be a folder containing multiple files.
- /etc/portage/package.accept_keywords - Keyword individual packages; e.g. ~amd64, ~x86, or ∼arm.
- /etc/portage/package.license - Accepted licenses
- /var/lib/portage/world - List of explicitly installed package atoms.
- /var/db/pkg - Contains information for every installed package a set of files about the installation.
Log management
genlop
genlop is a Portage log processor, also estimating build times when emerging packages.
Install genlop by issuing:
You can gather more information on app-portage/genlop by reading its manual page:
View the last 10 emerges (installs):
View how long emerging LibreOffice took:
Estimate how long emerge -uND --with-bdeps=y @world will take:
Watch the latest merging ebuild during system upgrades:
Overlays
eselect repository
app-eselect/eselect-repository can be installed by issuing:
List all existing overlays:
List all installed overlays:
See also Eselect/Repository
Layman
app-portage/layman can be installed by issuing:
List all existing overlays:
List all installed overlays:
See also Layman
Services
Obtain root shell (if the current user is listed in the sudoers list):
OpenRC
Start the ssh daemon in the default runlevel at boot:
Start the sshd service now:
Check if the sshd service is running:
systemd
Start the ssh daemon at boot:
Start the sshd service now:
Check if the sshd service is running:
Gentoo Monthly Newsletter (GMN)
Search packages in Portage by regular expressions:
Overlays vary from very small to very large in size. As a result they slow down the majority of Portage operations. That happens because overlays do not contain metadata caches. The cache is used to speed up searches and the building of dependency trees. A neat trick is to generate local metadata cache after syncing overlays.
This trick also works in conjunction with eix. eix-update can use metadata cache generated by emerge --regen to speed up things. To enable this, add the following variable to /etc/eixrc/00-eixrc:
/etc/eixrc/00-eixrc
qcheck
Use qcheck to verify installed packages:
qcheck comes with app-portage/portage-utils and can be installed by running this command:
Learn more about qcheck by reading its manual page: