This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 256159 - Grails Platform version detection not working for Grails 3.
Summary: Grails Platform version detection not working for Grails 3.
Status: VERIFIED FIXED
Alias: None
Product: groovy
Classification: Unclassified
Component: Grails (show other bugs)
Version: 8.1
Hardware: All All
: P3 normal (vote)
Assignee: bruno.flavio
URL:
Keywords:
Depends on:
Blocks: 255967
  Show dependency tree
 
Reported: 2015-10-24 22:37 UTC by bruno.flavio
Modified: 2016-02-14 12:27 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Proposed patch: when the build.properties approach fails invoke the grails command to get the version. (3.96 KB, patch)
2015-10-24 23:02 UTC, bruno.flavio
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description bruno.flavio 2015-10-24 22:37:08 UTC
There are cases in which NetBeans needs to know which version of grails is installed so the invocations can be correctly constructed/parsed.

With Grails 1 and 2, we relied on the build.properties file which existed in the grails home dir and contained a grails.version property.

Grails 3 releases no longer contains this file. Moreover, I couldn't find a similar file that could give this information other than invoking the "grails --version" command.
Comment 1 bruno.flavio 2015-10-24 23:02:32 UTC
Created attachment 156956 [details]
Proposed patch: when the build.properties approach fails invoke the grails command to get the version.

The proposed patch invokes the "grails --version" command when the build.properties file is not available.

This approach works for both grails 2 and 3. However, it requires the JDK home variable of NetBeans to be passed to the command, and not the project defined one. I don't think it'll be a problem, however it should be tested in other platforms.
Comment 2 bruno.flavio 2015-12-14 19:30:04 UTC
Patch applied to core-main: http://hg.netbeans.org/core-main/rev/cc6f46b7f174
Comment 3 Jiri Kovalsky 2015-12-15 09:56:57 UTC
Setting Target Milestone accordingly.
Comment 4 Quality Engineering 2015-12-16 02:31:36 UTC
Integrated into 'main-silver', will be available in build *201512160002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/cc6f46b7f174
User: Bruno Fl
Comment 5 bruno.flavio 2015-12-31 18:33:16 UTC
The platform detection is used internally and currently can only be verified indirectly: The fact that the dependent #255967 works for both grails 2 and 3 confirms that platform version detection is working.

Because the dependent #255957 resolves the inability to debug grails 2 and 3 applications this should be included in the 8.1 Patch 1.
Comment 6 Jiri Kovalsky 2016-01-27 17:56:58 UTC
Bruno, can you please integrate this fix to release81 branch by 1/31? Thanks!
Comment 7 bruno.flavio 2016-01-27 18:02:58 UTC
(In reply to Jiri Kovalsky from comment #6)
> Bruno, can you please integrate this fix to release81 branch by 1/31? Thanks!

Sure. I'll integrate the fix and upgrade the relevant module versions by Friday.
Comment 8 bruno.flavio 2016-01-28 22:45:21 UTC
The fix has been applied to the release81 branch.
Comment 9 Jiri Kovalsky 2016-01-29 07:45:01 UTC
Thanks Bruno. Do you have changeset number?
Comment 10 bruno.flavio 2016-01-29 08:23:37 UTC
(In reply to Jiri Kovalsky from comment #9)
> Thanks Bruno. Do you have changeset number?

Sorry, here it is:

Fix: http://hg.netbeans.org/releases/rev/2f6e6260bed4 

Spec version and message update: http://hg.netbeans.org/releases/rev/e6a78d0b0996
Comment 11 ejaz_ahmed 2016-02-12 12:16:14 UTC
I know the issue is fixed. But just for knowledge, there is gradle.properties file which provides this info. Here are the contents of it for my application:

grailsVersion=3.0.11
gradleWrapperVersion=2.3
Comment 12 bruno.flavio 2016-02-12 13:09:09 UTC
(In reply to ejaz_ahmed from comment #11)
> I know the issue is fixed. But just for knowledge, there is
> gradle.properties file which provides this info. Here are the contents of it
> for my application:
> 
> grailsVersion=3.0.11
> gradleWrapperVersion=2.3

Hello,

I think that using the gradle.properties file will lead to a better solution. Would you please open a new issue for this?

Thank you for your help,
-Bruno
Comment 13 ejaz_ahmed 2016-02-14 12:20:28 UTC
Yah, sure.
Comment 14 ejaz_ahmed 2016-02-14 12:27:18 UTC
Here it is https://netbeans.org/bugzilla/show_bug.cgi?id=257981