How to compile widgetsets in IntelliJ IDEA?

I am using Vaadin in IntelliJ. As programming language I’m using Scala.
I would like to know how to compile the widgetsets for addons in this IDE.

Does anyone have experience in this set of technologies (Vaadin + Scala)?

Unfortunately, i have zero experience with IDEA in general. But if there’s no suitable Vaadin plug-in (there’s no official plug-in, that i know), you can try to use the Ant script found at
http://dev.vaadin.com/browser/versions/6.4/build/package/build-widgetset.xml
. You’ll need to download the latest GWT package from
http://code.google.com/webtoolkit/download.html
(download the GWT SDK, and you need the gwt-dev.jar and gwt-user.jar packages)

Hello:
We are in 2015 and the IDE IntelliJ IDEA has version 1.0 of its plugin for Vaadin, however, I still have the same questions that Ricardo was four years ago, How to compile widgetsets in IntelliJ IDEA ?.

According to the documentation plugin 1.0, developed by the team of IntelliJ IDEA, The following features are available:

  1. Dedicated pages for creating a Vaadin project.
  2. Ability to create Vaadin components.
  3. Automatic setup of Google Web Toolkit (GWT) compiler for Vaadin custom widget sets.
  4. Support for debugging custom widget sets using GWT run configurations.

I ask them to concentrate on the number 3. Apparently this plugin can automatically compile the widget sets. Is it really true ?, not be compiled before the Add-ons, as is done in Elcipse?

I have been several days tried to execute an example of an Add-ons, the Graph-Explorer-demo-master, but I have no success. When buildingeverything goes well, but in the browser the following message appears:

"Widgetset ‘com.vaadin.DefaultWidgetSet’ does not Contain implementation for com.vaadin.graph.GraphExplorer. Check ITS component connector’sConnect mapping, widgetsets GWT module description file and re-compile your widgetset. In case You have downloaded to add vaadin -on package, you Might want to refer to add-on instructions. "

I guess the problem is that I have not compiled correctly the Add Ons. Any help?

Best regards.

Hi,

It depends a bit how you build your project, but in general I’d suggest to use the de-facto standard Maven. IntelliJ has a good support for Maven project and you can just choose “package” phace (into which vaadin-maven-plugin should be attached to), or specific plugin targets to do just the widgetset compilation.

See also this blog entry:
https://vaadin.com/blog/-/blogs/vaadin-and-intellij-idea-community-edition

cheers,
matti

I have recently started wirh Vaadin development and also run into this “widgetset compile” thing.
I’m using IntelliJ Ultimate Edition. How can I recompile the widget set?
As I’m using IntelliJ Ultimate Edition I did not use maven for the project.

Hi,
As @Matti stated, if you’re using Maven, this is quite straightforward.
Make sure you have the vaadin-maven-plugin in place and configure it.
Then run “package” goal for the project and it should do the trick. This would be an example configuration that is working in one of my projects:

<plugin> <groupId>com.vaadin</groupId> <artifactId>vaadin-maven-plugin</artifactId> <version>${vaadin.plugin.version}</version> <configuration> <extraJvmArgs>-Xmx512M -Xss1024k</extraJvmArgs> <webappDirectory>${basedir}/src/main/webapp/VAADIN/widgetsets</webappDirectory> <hostedWebapp>${basedir}/src/main/webapp/VAADIN/widgetsets</hostedWebapp> <noServer>true</noServer> <draftCompile>false</draftCompile> <style>OBF</style> <compileReport>true</compileReport> <runTarget>http://localhost:8080/</runTarget> </configuration> <executions> <execution> <configuration> </configuration> <goals> <goal>resources</goal> <goal>update-widgetset</goal> <goal>compile</goal> </goals> </execution> </executions> </plugin> Hope it helps
Cheers
Fran

Hi,

all experts that I know are using maven or gradle for their Vaadin projects, even though they have the Ultimate Edition. Was there some specific reason not to use Maven?

cheers,
matti

Hi,

I did not use Maven as I did not think I’d need it with the Ultimate Edition and, frankly, I don’t know it very well.
Do I have to convert my project to a Maven project or what?

Thank you,
Jiří

Hi Jiri,
I would not say that you
need
to convert it, but I would highly recommend it.
You should in general use sophisticated build tools that save you quite a lot of work.
Take into account that tools like Maven, not only provide the building capabilities, but also a proper library/dependency management that is VERY valuable nowadays. Don’t get scared because you’ll be quite rapidly working with the Maven essentials and you will never regret from having gone this way.
Cheers
Fran

HI,
I tried to have a go on using maven and Vaadin and I have to say that my experience is pretty bad so far.
Even the example given on Vaadin pages on how to create a Vaadin appplication doesn’t work (see below).
Yes, I may be doing something wrong, but to figure this stuff out I’d have to read tons of documentation and forum posts just to get my code to compile.

OTOH when using the IntelliJ builtin tools it just works. Except for the widget set compilation, that is.
I think that for now, I’ll just avoid using widget addons, so that I don’t have this problem.

Here is the maven error:

PS Y:\devel\projects\project2> mvn archetype:generate -DarchetypeGroupId=com.vaadin -DarchetypeArtifactId=vaadin-archetype-application -DarchetypeVersion=LATEST
[INFO]
 Scanning for projects...
[INFO]

[INFO]
 ------------------------------------------------------------------------
[INFO]
 Building project2 0.1
[INFO]
 ------------------------------------------------------------------------
[INFO]

[INFO]
 >>> maven-archetype-plugin:2.4:generate (default-cli) > generate-sources @ project2 >>>
[INFO]

[INFO]
 <<< maven-archetype-plugin:2.4:generate (default-cli) < generate-sources @ project2 <<<
[INFO]

[INFO]
 --- maven-archetype-plugin:2.4:generate (default-cli) @ project2 ---
[INFO]
 Generating project in Interactive mode
[WARNING]
 Archetype not found in any catalog. Falling back to central repository (http://repo.maven.apache.org/maven2).
[WARNING]
 Use -DarchetypeRepository=<your repository> if archetype's repository is elsewhere.
Downloading: http://repo.maven.apache.org/maven2/com/vaadin-archetype-application/maven-metadata.xml
[INFO]

[INFO]
 ------------------------------------------------------------------------
[INFO]
 Skipping project2
[INFO]
 This project has been banned from the build due to previous failures.
[INFO]
 ------------------------------------------------------------------------
[INFO]
 ------------------------------------------------------------------------
[INFO]
 BUILD FAILURE
[INFO]
 ------------------------------------------------------------------------
[INFO]
 Total time: 2.631 s
[INFO]
 Finished at: 2015-11-06T09:02:05+01:00
[INFO]
 Final Memory: 12M/28M
[INFO]
 ------------------------------------------------------------------------
[ERROR]
 Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:2.4:generate (default-cli) on project project2: The desired archetype does not exist (com:vaadin-archetype-application:LATEST) -> [Help 1]

[ERROR]

[ERROR]
 To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR]
 Re-run Maven using the -X switch to enable full debug logging.
[ERROR]

[ERROR]
 For more information about the errors and possible solutions, please read the following articles:
[ERROR]
 [Help 1]
 http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

Hi,

Did you copy paste the command from here:
https://vaadin.com/maven/

Don’t know what happened, but by reading the log it seems your groupId was wrong (com vs com.vaadin). In windows you shoulnd’t copy past the command and ignore the backslashes (that only work in unix based machines). Alternatively you can use the interactive mode or probably the most easiest method, just use the UI by your IDE.

cheers,
matti

The problem was that I was using Power Shell. When I ran the same command in “normal” windows shell it worked.
I’ve now got to the point when I can build and deploy the app.
But when I try to run it I get the following error:

"Failed to load the widgetset: ./VAADIN/widgetsets/com.vaadin.DefaultWidgetSet/com.vaadin.DefaultWidgetSet.nocache.js?1447319560469

Could you help me with that?

Thank you,
Jiri

Ok, I can solve this by including vaadin-client-compiled, but then I’m back to square one with my “compile widgetset” problem. The gwt compiler runs and compiles widgetset for the add-on I use, but I cannot figure out how to use it.

Hi,

Did you add @Widgetset annotation to your UI class? To me it seems it is now still using the precompiled widgetset although you already compile the application speficic one.

I typically use just @Widgetset(“AppWidgetSet”) and place the widgetset file (AppWidgetSet.gwt.xml) to resource root (src/main/resources).

cheers,
matti

Yes, I was finally able to make it work.

Thanks,
Jiri

Hi Jiri,
Please could you tell me how did you fix that ?

I eventually found out, that I don’t need to use maven at all. One just needs to add GWT facet to the project specify the GWT module and it wil work automagically.

Okey I will try this ,thank you very much

Jiri no resulat :confused:

24901.png

I have
MyAppWidgetset.gwt.xml in classpath, which looks likes this

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.5.1//EN" "http://google-web-toolkit.googlecode.com/svn/tags/2.5.1/distro-source/core/src/gwt-module.dtd">
<module>
<inherits name="org.vaadin.risto.stepper.widgetset.StepperWidgetset" />
<inherits name="org.vaadin.peter.contextmenu.ContextmenuWidgetset" />
<inherits name="com.vaadin.DefaultWidgetSet" />
</module>

Then I have
@Widgetset(“InvoicesWidgetset”)
annotation on my UI class.

Its working for me. Maybe I’m forgetting something, but it should work