Hello everyone,
First of all (as it is my 1st post on the forum), I would like to thank the entire Vaadin team for providing such a well thought out framework.
Now, after too many hours failing to add the lib-gwt-imageupload add-ons to my project and find precise directions on how to compile Vaadin add-ons/widgetsets in Gradle managed projects, I would be very grateful for any advice and/or pointers in the right direction - thanks in advance.
The project is a Vaadin Spring Boot Gradle project deployed as a jar with embedded Undertow server - the IDE is Intellij Idea UE 14.1.4
Refreshing Gradle doesn’t generate any errors, but building the application gives the following:
F:\widgetest\src\main\java\com\mtvcpt\uis\components\PhotoCpnt.java
Error:(21, 23) java: cannot access com.google.gwt.user.client.ui.Widget
class file for com.google.gwt.user.client.ui.Widget not found
The build.gradle script is as follows:
[code]
buildscript {
ext {
springBootVersion = ‘1.2.6.RELEASE’
vaadinVersion = ‘7.5.7’
}
repositories {
mavenCentral()
maven {
url 'http://maven.vaadin.com/vaadin-addons'
}
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
classpath("io.spring.gradle:dependency-management-plugin:0.5.2.RELEASE")
}
configurations {
compile.exclude module: "spring-boot-starter-tomcat"
}
}
apply plugin: ‘java’
apply plugin: ‘eclipse’
apply plugin: ‘idea’
apply plugin: ‘spring-boot’
apply plugin: ‘io.spring.dependency-management’
jar {
baseName = ‘com.mtvcpt’
version = ‘0.0.1-SNAPSHOT’
}
sourceCompatibility = 1.8
targetCompatibility = 1.8
repositories {
mavenCentral()
maven {
url ‘http://maven.vaadin.com/vaadin-addons’
}
}
dependencies {
compile(“org.springframework.boot:spring-boot-starter-actuator”)
compile(“org.springframework.boot:spring-boot-starter-data-jpa”)
compile(“org.springframework.boot:spring-boot-starter-web”)
compile(“org.springframework.boot:spring-boot-starter-undertow”)
compile(“com.vaadin:vaadin-spring-boot-starter:1.0.0”)
compile("org.vaadin.juho:lib-gwt-imageupload:0.0.3")
compile("com.h2database:h2")
testCompile("org.springframework.boot:spring-boot-starter-test")
}
dependencyManagement {
imports {
mavenBom “com.vaadin:vaadin-bom:${vaadinVersion}”
}
}
eclipse {
classpath {
containers.remove(‘org.eclipse.jdt.launching.JRE_CONTAINER’)
containers ‘org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8’
}
}
task wrapper(type: Wrapper) {
gradleVersion = ‘2.6’
}
[/code]The failing Class (which extends as CustomComponent) is:
[code]
package com.mtvcpt.uis.components;
import com.vaadin.spring.annotation.SpringComponent;
import com.vaadin.ui.Button;
import com.vaadin.ui.CustomComponent;
import com.vaadin.ui.Panel;
import org.vaadin.juho.imageupload.client.ImageUpload;
import java.io.Serializable;
/**
*
*/
@SpringComponent
public class PhotoCpnt extends CustomComponent implements Serializable {
final ImageUpload fileUpload = new ImageUpload();
public PhotoCpnt() {
final Button TakePhoto = new Button(null, e -> {
fileUpload.click(); [color=#B22222]
<— Line giving the error
[/color]
});
Panel panel = new Panel();
panel.setSizeFull();
setCompositionRoot(panel);
}
}
[/code]Thanks again in advance.