0

In late 2014, the Vaadin Plugin for NetBeans was updated to create projects using the new multi-module Maven archetype.

How does one add an Add-On such as Vaadin Charts 2?

I tried pasting into the "-ui" sub-module’s Pom file the Maven snippet found on the Add-On Directory page. No go. When running my app, the web page renders a message suggesting the WidgetSet does not contain the add-on.

screen shot of running app with message about “WidgetSet does not contain implementation…”

That "add-on instructions" link leads to this page. Little information is provided. Even worse: None of the info is relevant to the current multi-module Maven archetype for new Vaadin apps.

If there were any documentation telling me exactly what to do in adding an add-on and recompiling my WidgetSet, I'd gladly follow it. I found Using Add-ons in NetBeans, but it is outdated. I opened a ticket asking for a new edition of that page.

Basil Bourque
  • 303,325
  • 100
  • 852
  • 1,154

2 Answers2

0
mvn clean install

in the root directory of your project should compile widgetset for your project.

Henri Kerola
  • 4,947
  • 1
  • 17
  • 19
  • Can I do that from within NetBeans? Or must I use the command-line? – Basil Bourque Feb 14 '15 at 04:33
  • I tried this on the command-line, but it did not help. I quit NetBeans, in Terminal I did a `cd` to the project folder in `NetBeansProjects` folder. I went into the folder that contains the `…-production`, `…-ui`, and `…-widgetset` folders. I copy-pasted your `mvn clean install`, hit return, nothing appeared on console. I re-opened NetBeans, did a clean-and-build on my `…-ui` folder, and ran the project. Same message as seen in my screenshot in Question. So I tried this same procedure, but using `mvn vaadin:update-widgetset install`. Lots of output on console. But same error msg. – Basil Bourque Feb 14 '15 at 05:00
  • In which pom.xml you added the dependency to charts? – Henri Kerola Feb 14 '15 at 05:03
  • In this experimental project, I had Control-clicked on the `…-ui` item in "Projects" panel of NetBeans. From the context menu, I chose `Vaadin` > `Open Add-Ons Browser`. I used that browser to add Vaadin Charts 2 (2.0.0). I noticed a new file `AppWidgetSet.gwt.xml` appear next to my `MyUi.java` file, and the `vaadin-charts-2.0.0.jar` appeared in the `…-ui` "Dependencies" folder. So I assume the Charts add-on was successfully added. – Basil Bourque Feb 14 '15 at 05:08
  • In other experimental projects I had manually edited `…-ui` item > `Project Files` > pom.xml. – Basil Bourque Feb 14 '15 at 05:10
0

Hack

I found one hacky workaround: Put Maven dependency in both the …-ui and …-widgetset sub-module projects’ .pom files.

I'm trying to install Vaadin Charts 2. So on the Directory page for that product, I grab the Maven dependency XML snippet:

<dependency>
   <groupId>com.vaadin.addon</groupId>
   <artifactId>vaadin-charts</artifactId>
   <version>2.0.0</version>
</dependency>

I open two of the .pom files, and paste that dependency into both.

screen shot of two .pom files in list under -ui and -widgetset folders

Then I context-click on the …-parent module to choose Clean and then choose Build With Dependencies.

Lastly, run the project and find the add-on now working.

Note this workaround does not involve an command-line incantations with mvn. Works entirely within NetBeans (which calls Maven on our behalf).

This is a tricky kludge in that when an update of your add-on becomes available, you will need to update both dependency declarations. There must be a better way.

Basil Bourque
  • 303,325
  • 100
  • 852
  • 1,154