Basil Bourque
Basil Bourque

Reputation: 339482

How to add an Add-On to a Vaadin 7.3 app using the new multi-module Maven archetype?

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.

Upvotes: 0

Views: 263

Answers (2)

Basil Bourque
Basil Bourque

Reputation: 339482

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.

Upvotes: 0

Henri Kerola
Henri Kerola

Reputation: 4967

mvn clean install

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

Upvotes: 0

Related Questions