简体   繁体   中英

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.

正在运行的应用的屏幕截图,其中包含有关“ WidgetSet不包含实现…”的消息

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.

mvn clean install

在项目的根目录中,应编译项目的小部件集。

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.

-ui和-widgetset文件夹下的列表中的两个.pom文件的屏幕截图

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM