- Как установить Groovy консоль.
- Distributions
- Verification
- 4.0.0-alpha-3 distributions
- 4.0.0-alpha-2 distributions
- 3.0.7 distributions
- 2.5.14 distributions
- 2.4.21 distributions
- Other versions
- Invoke dynamic support
- Operating system/package manager installation
- From your build tools
- Maven repositories
- Install Groovy
- 1. Download
- 1.1. Stable
- 1.2. Snapshots
- 1.3. Prerequisites
- 2. Maven Repository
- 2.1. Stable Release
- 3. SDKMAN! (The Software Development Kit Manager)
- GROOVY_HOME is not being set on Windows 10 #3
- Comments
- itavero commented Jun 14, 2016
- itavero commented Jun 14, 2016 •
- keeganwitt commented Jun 19, 2016
- keeganwitt commented Aug 1, 2016
- AlexanderZobkov commented Aug 26, 2016 •
- SikoSoft commented May 14, 2018 •
- keeganwitt commented May 15, 2018
- keeganwitt commented May 15, 2018
- SikoSoft commented May 15, 2018
Как установить Groovy консоль.
Что такое Groovy я писать не буду, об этом вы сможете прочитать в wikipedia. Скажу только, что Groovy позволяет писать код на Java без лишних оберток, в стиле Ruby или Python. Но я буду рассказывать здесь не про сам язык Groovy, а про установку Groovy консоли, которая позволяет отлаживать автотесты написанные на java. B в groovy консоли это действительно очень удобно делать.
Для начала скачаем бинарный дистрибутив с официального сайта Groovy http://groovy.codehaus.org/Download
На момент написания статьи это Groovy 2.0.4
Для того, чтобы у вас работал Groovy, вам необходимо поставить java на свой компьютер, об этом я писал в статье «Установка JAVA. Отличие JDK от JRE»
Распаковываем архив и переносим папку groovy-2.0.4 в удобное нам место, у меня это диск C
Далее необходимо прописать все необходимые переменные окружения.
Для этого (В windows 7) Щелкаем правой кнопкой мыши на «Мой компьютер» — «Свойства» —
«Дополнительные параметры системы» —- переключаемся на вкладку «Дполнительно» —- нажимаем на «Переменные среды» в открывшемся окне в «системные переменные» нажимаем «Создать», в имя переменной пишем GROOVY_HOME в значении переменной C:\groovy-2.0.4 ( указываем путь куда вы перенесли папку groovy-2.0.4) Нажимаем «Ок»
Далее ищем в списке системных переменных, переменную «Path» щелкаем по ней, вписываем туда дополнительный путь » C:\groovy-2.0.4\bin», нажимаем «Ок»
Все, установка Groovy консоли завершена. Теперь чтобы открыть нашу Groovy консоль необходимо нажать «Пуск» — в поле «Найти программы и файлы» ввести «cmd»— нажать на найденный файл cmd.exe
В обработчике команд перейти на C:\groovy-2.0.4\, ввести команду groovyConsole, нажать Enter
и у вас откроется вот такая симпатичная консолька.
На этом все, как пользоваться самой groovy консолью вы можете посмотреть в этом видео от Алексея Баранцева:
Distributions
Distributions are bundles of source or class files needed to build or use Groovy.
All Apache projects provide a source zip which lets anyone build the software from scratch. If any doubt arises, you can regard the source zip as the authoritative artifact for each release. We also provide binary, downloadable documentation and SDK (combines src, binary and docs) convenience artifacts. You can also find a link to a non-ASF Windows installer convenience executable (if available).
Verification
We provide OpenPGP signatures (‘.asc’) files and checksums (‘.sha256’) for every release artifact. We recommend that you verify the integrity of downloaded files by generating your own checksums and matching them against ours and checking signatures using the KEYS file which contains the OpenPGP keys of Groovy’s Release Managers across all releases.
Newer releases have two sets of verification links. The dist labelled links are through the normal Apache distribution mechanism. The perm labelled links are through the Apache archive server. The latter of these won’t change but may not be available for a short while (usually less than a day) after a release. Older releases are only available from the archive server.
Groovy 4.0 is a bleeding edge version of Groovy designed for JDK8+ with much improved JPMS support.
4.0.0-alpha-3 distributions
binary dist: asc sha256 perm: asc sha256 | source asc sha256 | documentation dist: asc sha256 perm: asc sha256 | SDK bundle dist: asc sha256 perm: asc sha256 |
Please consult the change log for details.
4.0.0-alpha-2 distributions
binary asc sha256 | source asc sha256 | documentation asc sha256 | SDK bundle asc sha256 | Windows installer (community artifact) |
Please consult the change log for details.
Groovy 3.0 is the latest stable version of Groovy designed for JDK8+ with a new more flexible parser (aka Parrot parser).
3.0.7 distributions
binary dist: asc sha256 perm: asc sha256 | source asc sha256 | documentation dist: asc sha256 perm: asc sha256 | SDK bundle dist: asc sha256 perm: asc sha256 | Windows installer (community artifact) |
Please consult the change log for details.
Groovy 2.5 is the previous stable version of Groovy.
2.5.14 distributions
binary dist: asc sha256 perm: asc sha256 | source asc sha256 | documentation dist: asc sha256 perm: asc sha256 | SDK bundle dist: asc sha256 perm: asc sha256 | Windows installer (community artifact) |
Please consult the change log for details.
Groovy 2.4 is an earlier version of Groovy still in widespread use. Important: Releases before 2.4.4 weren’t done under the Apache Software Foundation and are provided as a convenience, without any warranty.
2.4.21 distributions
binary dist: asc sha256 perm: asc sha256 | source asc sha256 | documentation dist: asc sha256 perm: asc sha256 | SDK bundle dist: asc sha256 perm: asc sha256 | Windows installer (community artifact) |
Please consult the change log for details.
Other versions
Downloads for all versions are hosted (and mirrored) in:
- Apache’s release mirrors and archive repository.
- Groovy’s artifactory instance (includes pre-ASF versions).
You can also read the changelogs for all versions.
Invoke dynamic support
Please read the invoke dynamic support information if you would like to enable indy support and are using Groovy on JDK 7+.
Operating system/package manager installation
Installing Apache Groovy from a distribution zip is not hard but if you don’t want the hassle, consider the alternatives listed here.
SDKMAN! is a tool for managing parallel versions of multiple Software Development Kits on most Unix-based systems:
Windows users: see the SDKMAN install instructions for potential options.
Homebrew is «the missing package manager for macOS»:
SnapCraft is «the app store for Linux». Groovy is supported in the store or via the commandline:
MacPorts is a system for managing tools on macOS:
Scoop is a command-line installer for Windows inspired by Homebrew:
Chocolatey provides a sane way to manage software on Windows:
Linux/*nix users: you may also find Groovy is available using your preferred operating system package manager, e.g.: apt, dpkg, pacman, etc.
Windows users: consider also the Windows installer (see links above under Distributions).
From your build tools
If you wish to add Groovy as a dependency in your projects, you can refer to the Groovy JARs in the dependency section of your project build file descriptor:
Gradle | Maven | Explanation |
---|---|---|
Groovy versions 1.x to 3.x | ||
org.codehaus.groovy:groovy:x.y.z | org.codehaus.groovy groovy x.y.z | Just the core of Groovy without the modules*. Also includes jarjar’ed versions of Antlr, ASM, and an internal copy of needed CLI implementation classes. |
org.codehaus.groovy:groovy-$module:x.y.z | org.codehaus.groovy groovy-$module x.y.z | «$module» stands for the different optional groovy modules*. Example: groovy-sql . |
org.codehaus.groovy:groovy-all:x.y.z | org.codehaus.groovy groovy-all x.y.z pom | Core plus all of the modules (excluding optional modules) according to the version packaging scheme**. |
Groovy versions 4.0+ | ||
As above but use org.apache.groovy instead of org.codehaus.groovy . | ||
* Modules: 2.4.X: «ant», «bsf», «console», «docgenerator», «groovydoc», «groovysh», «jmx», «json», «jsr223», «nio», «servlet», «sql», «swing», «test», «templates», «testng» and «xml» 2.5.0: as above but excluding optional module «bsf» plus «cli-picocli», «datetime», «macro», «test-junit5». Optional modules: «bsf», «dateutil», «cli-commons» 2.5.1+: as above but «groovy-jaxb» is moved to become optional 3.0.0+: as above but «groovy-yaml» is a new optional module 4.0.0+: as above but «groovy-contracts», «groovy-typecheckers» and «groovy-macro-library» are new optional modules, «groovy-jaxb» and «groovy-bsf» are no longer supported, «groovy-yaml» is now included in «groovy-all», and «groovy-testng» is now an optional module | ||
** Packaging Scheme: 2.4.X: The core plus all the modules merged into one «fat jar». Optional dependencies are marked as optional, so you may need to include some of the optional dependencies to use some features of Groovy, e.g. AntBuilder, GroovyMBeans. 2.5+: A «fat pom» groovy-all-x.y.z.pom referring to the core plus all modules (excluding optional ones). In order to cater to the module system of Java 9+, the groovy-all-x.y.z.jar file is no longer available. | ||
Indy jars You can access the indy version of the core or a module jar by using the ‘indy’ classifier. |
Maven repositories
Groovy version(s) | Release Jars |
---|---|
Groovy versions 1.x to 3.x | Maven Central or Groovy artifactory release repository |
Groovy versions 4.x+ | Maven Central or Groovy artifactory release repository |
Note for the development community: developers needing access to pre-release artifacts to assist with integration testing leading up to an official release should consult the appropriate developer documentation.
Install Groovy
1. Download
In this download area, you will be able to download the distribution (binary and source), the Windows installer and the documentation for Groovy.
For a quick and effortless start on Mac OSX, Linux or Cygwin, you can use SDKMAN! (The Software Development Kit Manager) to download and configure any Groovy version of your choice. Basic instructions can be found below.
1.1. Stable
Combined binary / source / documentation bundle: Distribution bundle
You can learn more about this version in the release notes or in the changelog.
If you plan on using invokedynamic support, read those notes.
1.2. Snapshots
For those who want to test the very latest versions of Groovy and live on the bleeding edge, you can use our snapshot builds. As soon as a build succeeds on our continuous integration server a snapshot is deployed to Artifactory’s OSS snapshot repository.
1.3. Prerequisites
Groovy 3.0 requires Java 6+ with full support up to Java 8. There are currently some known issues for some aspects when using Java 9 snapshots. The groovy-nio module requires Java 7+. Using Groovy’s invokeDynamic features require Java 7+ but we recommend Java 8.
The Groovy CI server is also useful to look at to confirm supported Java versions for different Groovy releases. The test suite (getting close to 10000 tests) runs for the currently supported streams of Groovy across all the main versions of Java each stream supports.
2. Maven Repository
If you wish to embed Groovy in your application, you may just prefer to point to your favourite maven repositories or the JCenter maven repository.
2.1. Stable Release
Just the core of groovy without the modules (see below).
«$module» stands for the different optional groovy modules «ant», «bsf», «console», «docgenerator», «groovydoc», «groovysh», «jmx», «json», «jsr223», «servlet», «sql», «swing», «test», «testng» and «xml». Example: groovy-sql
The core plus all the modules. Optional dependencies are marked as optional. You may need to include some of the optional dependencies to use some features of Groovy, e.g. AntBuilder, GroovyMBeans, etc.
To use the InvokeDynamic version of the jars just append ‘:indy’ for Gradle or indy for Maven.
3. SDKMAN! (The Software Development Kit Manager)
This tool makes installing Groovy on any Bash platform (Mac OSX, Linux, Cygwin, Solaris or FreeBSD) very easy.
Simply open a new terminal and enter:
Follow the instructions on-screen to complete installation.
Open a new terminal or type the command:
Then install the latest stable Groovy:
After installation is complete and you’ve made it your default version, test it with:
GROOVY_HOME is not being set on Windows 10 #3
Comments
itavero commented Jun 14, 2016
I ran a silent install ( /S /A /N /D=C:\groovy ) and expected the environment GROOVY_HOME to be set and added to the path.
Neither of this happened on my Windows 10 machine (did not try another version).
The text was updated successfully, but these errors were encountered:
itavero commented Jun 14, 2016 •
Update: I also added the /V flag to the arguments, because it was described as Set Variables so I figured I might need that as well.
Result was the same: no variables were added/set.
keeganwitt commented Jun 19, 2016
It looks like there’s a bug with setting GROOVY_HOME with silent installs. I’ll look into it.
keeganwitt commented Aug 1, 2016
Sorry for the long turnaround on this. I believe this is happening because the file associations and environment variable setting is done through custom page functions, and pages don’t appear in silent installs. I’ll need to figure out another option for setting these.
AlexanderZobkov commented Aug 26, 2016 •
Hello,
I can say that /F (file association) switch is not working as well.
Looking into setup.nsi, it looks like non standard NSIS command line switches are not recognized.
SikoSoft commented May 14, 2018 •
Still not working.
Installed today, couldn’t figure out why my groovy binaries couldn’t be found in the shell, despite GROOVY_HOME\bin being in the PATH variable. Upon closer investigation my GROOVY_HOME variable is set to «C:\PROGRA
Also, I’m not even sure what a «silent install» is. I just installed from the Windows installer binary and this was the result.
keeganwitt commented May 15, 2018
I’m not sure offhand what went wrong — I’m on Win10 Pro also and my home got set to C:\PROGRA
keeganwitt commented May 15, 2018
As much as NSIS has made things easy for me, I think the best long-term fix for this kind of stuff is to dump NSIS and go to WIX. That way we can get enterprise installs, system restore points, etc. In the mean time, I’ll keep looking and see if I can figure out what went wrong.
SikoSoft commented May 15, 2018
It’s an easy enough fix to manually correct yourself if you notice what is going wrong. I wasn’t sure if it was literally what I was seeing or if it was Windows being silly and just truncating it for display.
Perhaps a notice (if there isn’t one already) to Windows 10 users is enough somewhere in the doc/readme/install process. Could save you headache from having to devote too much time into this, and you can just wait for enough reports with hard details coming in to paint a clearer picture.
I hope I didn’t come off as nagging. I just wanted to mention it still seems to happen.