您如何使用Windows管理多个Grails版本的开发? [英] How do you manage developing with multiple versions of Grails using Windows?

查看:163
本文介绍了您如何使用Windows管理多个Grails版本的开发?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们现在已经使用Grails一段时间了,现在已经通过了几个Grails版本。我们并不总是希望立即迁移我们的旧版应用程序,但通常会使用新版本进行新的开发。更改Windows环境变量是不方便的,因为我有时必须同时运行两个相关的项目,这些项目运行不同版本的Grails。



在Linux中,我会可能会创建包装脚本或别名,以允许我在命令行上指定版本切换,但我不相信Grails支持这一点。



其他人需要编码对多个版本的Grails进行管理?



更新:

我创建了一个gv.bat文件来设置 GRAILS \\ \\_HOME PATH 环境变量。我在我的框中添加了一个 GRAILS \_INSTALLS 环境变量( c:\usr\local\grails ),并从我的 PATH 中删除​​了%GRAILS_HOME%\bin 引用。



gv.bat

  @echo off 
SET GRAILS_HOME = %GRAILS_INSTALLS%\grails-%1
SET PATH =%GRAILS_HOME%\ bin;%PATH%

要执行任何Grails工作,我需要运行> gv 1.1.2或任何需要使用的版本。我想弄清楚如何在 PATH 中进行字符串替换以更改值,但对我来说这很难。


现在已经晚了很多,如果你使用命令行来运行它们,还有另一种方法来管理你的Groovy和Grails版本:Posh-gvm。


https://github.com/flofreud/posh-gvm



GVM是一个用于unix / mac环境的工具,用于管理Groovy / Gradle / Grails /更多版本,并且有人最终创建了一个名为Posh-gvm(Power-shell GVM的缩写) 。这是非常有用和易于使用的下载和配置您的环境,无论您想要在任何时间点使用这些工具的版本。



如果您使用IDE,posh-gvm仍然是下载/安装新版本的好方法,您的IDE可以指向posh-gvm安装目录。


We've been using Grails for a little while now and have been through a few Grails versions now. We don't always want to migrate our 'older' apps immediately but often use a newer version for new development. Changing the Windows environment variables is inconvenient since I sometimes have to work on two related projects at the same time that are running different versions of Grails.

In Linux, I'd probably create wrapper scripts or aliases to allow me to specify on the command line a version switch but I don't believe Grails supports this.

How are others that need to code against multiple versions of Grails managing it?

Update:
I created a gv.bat file to set the GRAILS\_HOME and PATH environment variables. I added a GRAILS\_INSTALLS environment variable (c:\usr\local\grails on my box) and removed the %GRAILS_HOME%\bin reference from my PATH.

gv.bat

@echo off
SET GRAILS_HOME=%GRAILS_INSTALLS%\grails-%1
SET PATH=%GRAILS_HOME%\bin;%PATH%

To do any Grails work I run > gv 1.1.2 or whatever version I need to work with. I'd like to figure out how to do a string replace in the PATH to change the value but that turned out to be difficult for me

解决方案

It's now much later, and there's yet another way to manage your Groovy and Grails versions if you use the command-line to run them: Posh-gvm. https://github.com/flofreud/posh-gvm

GVM is a tool for unix/mac environments to manage Groovy/Gradle/Grails/more versions, and someone finally made a Windows equivalent called Posh-gvm (short for Power-shell GVM). It's very useful and easy to use to download and configure your environment for whichever version of these tools you want to use at any point in time.

If you're using an IDE, posh-gvm is still a great way to download/install the new versions as they come out, and your IDE can point into the posh-gvm install directories.

这篇关于您如何使用Windows管理多个Grails版本的开发?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆