devsoap / ds-gradle-vaadin

Gradle plugin for building Vaadin Flow 10/11/12/13/14/15 apps
https://devsoap.com/gradle-vaadin-flow-plugin
Other
36 stars 13 forks source link

war package dependencies in bower_components missing #251

Open ru5t opened 5 years ago

ru5t commented 5 years ago

Desktop (please complete the following information):

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
    }
  2. Run Gradle task vaadinCreateProject
  3. Run Gradle task war
  4. 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.

stapel commented 5 years ago

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)

johndevs commented 4 years ago

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.