devsoap/ds-gradle-vaadin

war package dependencies in bower_components missing

ru5t opened this issue · 2 comments

ru5t commented

Desktop (please complete the following information):

  • OS: Arch Linux
  • JDK version: 11
  • Gradle version: 5.1.1
  • Vaadin Plugin version: 1.1.2

Describe the bug
Using AppLayout addon ("com.github.appreciated:app-layout-addon:2.0.8"). It uses org.webjars.bowergithub.oyeharry:app-menu:2.1.2 (from dependency graph). When war packed and deployed facing unsatisfied resource
404 : http://localhost:8080/frontend-es6/bower_components/app-menu/app-menu-icon-item.html
In war file: frontend-es6/bower_components/ contains only webcomponentsjs folder.
In basic starter projects (Maven-based) resulting war contains much more stuff.
To Reproduce
Steps to reproduce the behavior:

  1. Setup project like in wiki but with additional
plugins{
...
  id 'war'
}
vaadin {
  productionMode = true
}
  1. Run Gradle task vaadinCreateProject
  2. Run Gradle task war
  3. Explore produced war file's frontedn-es6/bower_components dir.

Expected behavior
Mentioned dir contains all necessary dependencies

Additional context
I'm fairly new to this plugin so maybe this task supposed to be done other way.

For me, the war-plugin does somehow inhibit the invocation of vaadinAssembleClient in productionMode (does not gets called in build anymore either).

I manually added the dependency to war, which works for me.

if (vaadin.productionMode) {
    war.dependsOn(AssembleClientDependenciesTask.NAME)
}

(plugin 1.2.0, with gradle 5.4.1)

The WAR task should be made dependent on the assemble task by the WarPluginAction.groovy#L41.

The only reason I can see why this could possibly fail is if you apply the plugin to project without the WAR plugin.