Vaadin std prod project includes vaadin-client-compiler and jetty?

点点圈 提交于 2019-12-09 04:28:25

I believe I've found the answer. It seems Vaadin team was/is fully aware of this but it is kind of a left-over from the old days when there was some kind of annoying bug.

In your xxx-widgetset project you'll see something like this in the POM for that project:

<dependencies>
    <!-- Versions for these are configured in the parent POM -->
    <dependency>
        <groupId>com.vaadin</groupId>
        <artifactId>vaadin-client</artifactId>
        <!-- TODO this should have scope provided once http://dev.vaadin.com/ticket/14788 is resolved -->
        <!-- <scope>provided</scope> -->
    </dependency>
    <dependency>
        <groupId>com.vaadin</groupId>
        <artifactId>vaadin-client-compiler</artifactId>
        <!-- TODO this should have scope provided once http://dev.vaadin.com/ticket/14788 is resolved -->
        <!-- <scope>provided</scope> -->
    </dependency>

    ... you'll see more deps here if you've added 
    ... Vaadin add-ons to your project.
</dependencies>

See the TODO comments ?? Well, it just so happens that the bug mentioned in ticket 14788 doesn't happen anymore, at least not on 7.6.2. So you can now safely do what the TODO comment says.

This has reduced my WAR size by 50-70 pct.

It seems to me there's no longer any good reason why this archetype generation doesn't actually do what TODO comment says. Currently you'll have to manually correct it every time you generate a new project skeleton.

If you work with a different webserver (in your case Tomcat 8) you don't need the provided jetty-plugin.

As the archetype has some jetty-dependencies you can exclude them with the exclusions tag in the Maven POM file.

Example

<groupId>com.vaadin</groupId>
<artifactId>vaadin-client-compiler</artifactId>
<version>${vaadin.version}</version>
<exclusions>
    <exclusion>
        <groupId>org.eclipse.jetty</groupId>
        <artifactId>jetty-servlets</artifactId>
    </exclusion>
    <exclusion>
        <groupId>org.eclipse.jetty</groupId>
        <artifactId>jetty-annotations</artifactId>
    </exclusion>
    <exclusion>
        <groupId>org.eclipse.jetty</groupId>
        <artifactId>jetty-util</artifactId>
    </exclusion>
</exclusions>

Moreover delete/comment out all unnecessary "jetty" dependencies found in the module POM files.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!