After import of an existing project, the gradle version is less then when creating a Gradle project - buildship

When I create a new Gradle project, the Gradle version is 3.3. But when I import an existing Gradle project, the Gradle version is 2.4.11. How are the version determined, especially the last one, because as far as I can see, there is no Gradle version information in the existing Gradle project.

I don't know am I understand your issue correctly or not. But as I understood:
The version of gradle is determined in your build.gradle file.
There is a line there like below:
classpath 'com.android.tools.build:gradle: 2.2.2'
which 2.2.2 is the version.
the highest stable version till now is 2.2.3 (which it is not suitable for me) .
Note that versions above 2.2 need jdk 8 (not work with jdk 7)

I found out that you have to look at the file gradle/wrapper/gradle-wrapper.properties. The last line of this file gives the Gradle version:
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-bin.zip
Before importing an existing Gradle project, maybe you want to edit this line.

Related

How to change JRE Libraries on Eclipse Maven Project?

is anyone knows how to change the jre libraries on java dynamic web project(I am using Eclipse and Maven)? The case is this, when I first created the project on Eclipse Oxygen package M5 the default jre was 1.6, I changed the Java Build Path(libraries) into 1.7/1.8, however upon updating the project it always returns to 1.6 and there is a red mark on the project folder. I already tried deleting the project and import it as Existing Maven Project and then update and clean but still nothing happens. This happens whenever I am creating a project without XML based configuration. I installed JDK 1.8.0 update 111, 121, and 131 and Apache Tomcat V7(XAMPP). On my brother's laptop everything works fine.
By the way, I also tried to replace .m2 folder of my laptop by copying .m2 folder from my brother's laptop.
Any help is much appreciated.
I assume you are using m2e, the Maven integration for Eclipse, which offers the import as Existing Maven Project option. m2e takes the version for the JRE System Library container from the configuration of the maven-compiler-plugin; this ensures that Eclipse and mvn behave consistently. Try changing the <source> and <target> configuration options of the maven-compiler-plugin, maybe followed by a Maven > Update Project to make sure m2e has sync’ed the changes to the pom.xml with the Eclipse buildpath.

build Grails 3 war with specific java compiler version

I am using IDEA 15. I have a grails 3 project setup. The app server I need to deploy to has Java Version 7. My local JDK is Java 8. I have set some properties in my build.gradle to use the target version 1.7.
apply plugin: 'java'
compileJava {
targetCompatibility = '1.7'
}
When I rebuild my project, it generates class files for 1.7, but when I run a maven war build from the IDEA menu, the classes are rebuilt and end up being Java 8 versions. I have set Java version in my project to 1.7 as well, but this did not help. How can I get to where I am producing a war file from my grails app that contains 1.7 versioned class files?
Thanks!
What are you using to build war file? "grails war" or "gradle war". Try to use gradle.

Grails Project not shown in NetBeans project window

I create a new Grails project from NetBeans but when I complete the project complition wizard, nothing to show in my NetBeans project window. My details configuration is:
NetBeans 8.0.2, JDK 8 64bit, Grails 3.0.1
I check my environment veriable setting for Java & Grails also. Everything seems ok, and one important thing is in command line when I type grails -version, it shows the version name and so on. I uninstall NetBeans, JDK, & Grails several times but same problem, I also try it for JDK 1.7 32 bit, no result. I'm used to with NetBeans, so I don't try to other IDE.
Maybe look where the project is defined on disk and open it into NetBeans.
I dont know how this case was solved, but to me it looks like the problem is still valid:
The New Project wizard (Groovy -> Grails Application) calls "grails create-app" but does not generate the nbproject directory.
My environment is:
NetBeans: 8.0.2; Grails Version: 3.0.4; Groovy Version: 2.4.4; JVM Version: 1.7.0_79
Netbeans 8.0.* does not have support for Grails 3.* projects. It can create project but cannot recognize and open the project since the project structure has been dramatically changed from Grails 2.* to 3.*. There was a task created to resolve this problem. Now it reads VERIFIED FIXED for version 8.1. So please upgrade to Netbeans 8.1.* in order to be able to handle Grails 3.* projects in Netbeans.

ggts, new groovy compiler version not available to project after installing for workspace

Using GGTS 3.6.4
Just installed Groovy 2.4.1, and it shows up under Window=>Preferences; Groovy=>Compiler, and I see: "You are currently using Groovy Compiler version 2.4.1."
However, when I go to Project=>Properties; Groovy Compiler, I see only these 4 options under "Groovy compile level for project XxxxYyyyyZzzz":
I don't care
2.1
2.3
unspecified
I want to be able to designate 2.4 as the Groovy Compiler version for the project, but it's not there to pick! I've stopped/started GGTS, to no avail. What can I do?
Try changing the file .settings/org.eclipse.jdt.groovy.core.prefs wherever your workspace is for that project.
set it to:
groovy.compiler.level=24
stop/start and see if that works.

Grails GGTS "Task 'assemble' not found in root project" error when running "grails war" in Command Prompt

I have been learning Groovy/Grails Tool Suite (GGTS) 3.6.4, with Grails 2.4.4 using some video tutorials. When I attempt to package the project into an application using the grails war command on the Windows command prompt, I get the following error:
"Error Gradle build terminated with error: Task 'assemble' not found in root project ..."
Any references to this error that I have found online have only involved Android Studio (for instance), so I am at a loss here as to how to fix it for GGTS.
I have Android Studio 1.0.1 installed, and in case it was affecting the Grails packaging, I tried the solution of removing the <component name="FacetManager"> from the general Android Studio "MyApplication.iml" file, but that had no effect. I couldn't find any analogous file for the GGTS.
In case the issue lies elsewhere in my overall installation, I have Java JRE 7_79 (64-bit) installed, as well as the the JDK 1.7.0_79 (64-bit)
OK. I found out what the cause of the error was, and how to avoid it in the future.
The Problem
Grails 3.0.1 requires the following files for grails war to work:
build.gradle
gradle.properties
gradlew
gradlew.bat
\gradle (directory)
Grails 2.4.4 does not require any of the above files for making a WAR file.
GGTS 3.6.4 does not work with Grails 3.0.1, but it comes with and works fine with Grails 2.4.4.
The Solution
Copying the stated Gradle files & directory to a GGTS project folder fixed the problem. However, I wasn't satisfied with needing to do this manually or with a custom batch file for every project.
Looking deeper, it turns out that when working out compatibility issues between the Java 32-bit JRE existing on my system and the Java 64-bit JRE & SDK, Grails, and GGTS versions (there was a lot of fiddling to get things working), at one point I had set up my global variable to Grails to be directed at 3.0.1, and I failed to update it to Grails 2.4.4. Making this change has fixed the issue.
Explaining the Cause
When following this video series on installing a compatible set of Java, Grails, and GGTS, the instructor manually downloaded the latest version of Grails from the Grails site and then downloaded GGTS separately from its own site. Both of these were older versions than what I was working with.
In my case it turns out that, after setting up the Java SDK & Grails, the latest version of GGTS (3.6.4) did not work properly with the latest version of Grails (3.0.1). Fortunately the GGTS bundle came with an older version of Grails (2.4.4), and by referencing that, GGTS would work correctly. However, although I changed the IDE reference to Grails, I forgot to reset my environment variable ...
So GGTS was setting up the project for using Grails 2.4.4. However, when calling grails war, the command was using Grails 3.0.1! Apparently these two versions of Grails use different files for creating a WAR file, so GGTS was not setting up the project directories with the correct local files, and the packaging was failing.
Avoiding Future Occurrences
So, when using GGTS 3.6.4, make sure that all references to Grails point to Grails 2.4.4.
In general, if any GGTS bundle contains a version of Grails, you should have everything set up to use that version, even if it is old.

Resources