Eclipse + Gradle plugin, Eclipse is showing "Use default SDK ..."

130 views
Skip to first unread message

Michael Joyner

unread,
Jun 8, 2015, 3:22:48 PM6/8/15
to google-we...@googlegroups.com
When using Eclipse + Gradle I noticed that GWT version is set to "Use
default SDK ..."

When using Eclipse + Maven the SDK is set to use the version downloaded
into the local maven repo.

It is my understanding that the Maven configuration is "automatic" in
Eclipse based on "source path" and an automatic Google Plugin detection
feature.

What do I need to add to my Gradle file to get the same style of
behavior as when using Maven?

My concern is that I will have version 'A' in my Gradle file, but
Eclipse will have a default version 'B' and as a result what I doing in
Eclipse will not match up with what the compile and deploy sequence in
Gradle really is looking for ...

-Mike

Michael Joyner

unread,
Jun 8, 2015, 3:25:08 PM6/8/15
to google-we...@googlegroups.com
On 06/08/2015 03:22 PM, Michael Joyner wrote:
> When using Eclipse + Gradle I noticed that GWT version is set to "Use
> default SDK ..."
>

Here is my current build.gradle file:

apply plugin: 'java'
apply plugin: 'gwt'
apply plugin: 'war'
apply from:
'https://raw.github.com/akhikhl/gretty/master/pluginScripts/gretty.plugin'
apply plugin: 'eclipse-wtp'

sourceCompatibility = 1.7
targetCompatibility = 1.7
compileJava.options.encoding = 'UTF-8'

//
compileJava.options.bootClasspath='/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/rt.jar'

version = '1.0'

buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'de.richsource.gradle.plugins:gwt-gradle-plugin:0.6'
classpath 'org.akhikhl.gretty:gretty:+'
}
}

war {
archiveName 'TheWar.war'
}

gretty {
port = 8080;
servletContainer = 'tomcat7'
managedClassReload = false
extraResourceBase 'build/gwt/out'
}

repositories {
mavenLocal()
mavenCentral()
}

compileJava {
options.incremental = true
}


gwt {
minHeapSize = "1024M";
maxHeapSize = "2048M";

gwtVersion='2.7.0'

modules 'com.butterbusiness.ButterAdminModule'

compiler {
strict = true;
enableClosureCompiler = false;
disableClassMetadata = false;
disableCastChecking = false;
}
}

configurations {
provided
}

dependencies {
providedCompile 'javax.servlet:javax.servlet-api:3.0.1'
compile 'commons-validator:commons-validator:1.4.1'
compile 'org.apache.commons:commons-lang3:3.4'
compile 'com.mchange:c3p0:0.9.5'
compile 'com.fasterxml.jackson.core:jackson-databind:2.5.3'
compile 'mysql:mysql-connector-java:5.1.35'
}

sourceSets {
main {
compileClasspath += configurations.provided
}
test {
compileClasspath += configurations.provided
runtimeClasspath += configurations.provided
}
}

eclipseJdt << {
File f = file('.settings/org.eclipse.core.resources.prefs')
f.write('eclipse.preferences.version=1\n')
f.append('encoding/<project>=utf-8')
f = file('.settings/org.eclipse.core.runtime.prefs')
f.write('eclipse.preferences.version=1\n')
f.append('line.separator=\\n\n')
}

eclipse {
project {
name = 'GWT Project'
comment = 'GWT Project'
webAppDirName = 'src/main/webapp'
}
classpath {
plusConfigurations += [configurations.provided]
noExportConfigurations += [configurations.provided]
}
jdt {
sourceCompatibility=1.7
targetCompatibility=1.7
}
wtp {
facet {
facets = []
facet name: 'jst.java', version: '1.7'
facet name: 'jst.web', version: '3.0'
}
}
}
Reply all
Reply to author
Forward
0 new messages