【问题标题】:Jenkins - Build Vaadin Web Application takes foreverJenkins - 构建 Vaadin Web 应用程序需要很长时间
【发布时间】:2014-11-01 18:36:10
【问题描述】:

我的目标是建立一个持续集成(IntelliJ IDEA -> github -> jenkins -> tomcat),但是“构建 Vaadin Web 应用程序”的过程不会结束(见下文)。这个过程是从我的 maven 构建中隐式调用的,并且仅在我终止服务器时结束(顺便说一句:服务器的内存限制为 500mb)。

jenkins 中的 maven 目标是“干净的包”。战争文件将通过另一个 jenkins 插件部署,但 jenkins 甚至还没有走那么远。

我的 pom 的构建部分如下所示(它来自原型,我还不太了解这部分):

<build>
        <plugins>
            <!--vaadin-->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.7</source>
                    <target>1.7</target>
                </configuration>
            </plugin>
            <!-- As we are doing "inplace" GWT compilation, ensure the widgetset -->
            <!-- directory is cleaned properly -->
            <plugin>
                <artifactId>maven-clean-plugin</artifactId>
                <version>2.4.1</version>
                <configuration>
                    <filesets>
                        <fileset>
                            <directory>src/main/webapp/VAADIN/widgetsets</directory>
                        </fileset>
                    </filesets>
                </configuration>
            </plugin>
            <plugin>
                <groupId>com.vaadin</groupId>
                <artifactId>vaadin-maven-plugin</artifactId>
                <version>${vaadin.plugin.version}</version>
                <configuration>
                    <extraJvmArgs>-Xmx512M -Xss1024k</extraJvmArgs>
                    <!-- <runTarget>mobilemail</runTarget> -->
                    <!-- We are doing "inplace" but into subdir VAADIN/widgetsets. This
                        way compatible with Vaadin eclipse plugin. -->
                    <webappDirectory>${basedir}/src/main/webapp/VAADIN/widgetsets
                    </webappDirectory>
                    <hostedWebapp>${basedir}/src/main/webapp/VAADIN/widgetsets
                    </hostedWebapp>
                    <noServer>true</noServer>
                    <!-- Remove draftCompile when project is ready -->
                    <draftCompile>false</draftCompile>
                    <compileReport>true</compileReport>
                    <style>OBF</style>
                    <strict>true</strict>
                    <runTarget>http://localhost:8080/</runTarget>
                </configuration>
                <executions>
                    <execution>
                        <configuration>
                            <!-- if you don't specify any modules, the plugin will find them -->
                            <!-- <modules> <module>com.vaadin.demo.mobilemail.gwt.ColorPickerWidgetSet</module>
                                </modules> -->
                        </configuration>
                        <goals>
                            <goal>resources</goal>
                            <goal>update-widgetset</goal>
                            <goal>compile</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <!--<plugin>-->
                <!--<groupId>org.mortbay.jetty</groupId>-->
                <!--<artifactId>jetty-maven-plugin</artifactId>-->
            <!--</plugin>-->
            <!--vaadin end-->
        </plugins>
        <pluginManagement>
            <plugins>
                <!--vaadin-->
                <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
                <plugin>
                    <groupId>org.eclipse.m2e</groupId>
                    <artifactId>lifecycle-mapping</artifactId>
                    <version>1.0.0</version>
                    <configuration>
                        <lifecycleMappingMetadata>
                            <pluginExecutions>
                                <pluginExecution>
                                    <pluginExecutionFilter>
                                        <groupId>com.vaadin</groupId>
                                        <artifactId>
                                            vaadin-maven-plugin
                                        </artifactId>
                                        <versionRange>
                                            [7.0.0.beta3,)
                                        </versionRange>
                                        <goals>
                                            <goal>resources</goal>
                                            <goal>update-widgetset</goal>
                                            <goal>compile</goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <ignore></ignore>
                                    </action>
                                </pluginExecution>
                            </pluginExecutions>
                        </lifecycleMappingMetadata>
                    </configuration>
                </plugin>
                <!--vaadin end-->
            </plugins>
        </pluginManagement>
    </build>

自动生成的 AppWidgetSet 如下所示:

<module>
    <inherits name="com.vaadin.DefaultWidgetSet"/>
</module>

web.xml 如下所示:

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee"
         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
         id="WebApp_ID" version="2.5">
    <display-name>Vaadin Web Application</display-name>
    <context-param>
        <description>Vaadin production mode</description>
        <param-name>productionMode</param-name>
        <param-value>false</param-value>
    </context-param>
    <servlet>
        <servlet-name>Vaadin Application Servlet</servlet-name>
        <servlet-class>com.vaadin.server.VaadinServlet</servlet-class>
        <init-param>
            <description>Vaadin UI to display</description>
            <param-name>UI</param-name>
            <param-value>de.bahr.dhbw.logframe.UI.NavigatorUI</param-value>
        </init-param>
        <init-param>
            <description>Application widgetset</description>
            <param-name>widgetset</param-name>
            <param-value>de.bahr.dhbw.logframe.AppWidgetSet</param-value>
        </init-param>
    </servlet>
    <servlet-mapping>
        <servlet-name>Vaadin Application Servlet</servlet-name>
        <url-pattern>/*</url-pattern>
    </servlet-mapping>
</web-app>

有没有关于在 Jenkins 中使用 Vaadin 的指南?你能帮我让这个设置运行吗?提前致谢!

(也问https://vaadin.com/forum#!/thread/8523481。)

【问题讨论】:

  • 它很可能会被交换到死。您的 JVM 选项未针对您的虚拟机进行调整。

标签: java maven jenkins continuous-integration vaadin


【解决方案1】:

正如 Thorbjørn 指出的那样,问题出在服务器的容量上。

第一个服务器内存限制为 512 mb 并且没有交换空间(主机最初不提供交换)。增加交换空间会导致相同的结果。因此,我选择了另一台具有 1 GB 内存且没有交换的服务器。在那种情况下,我遇到了“maven failed with status 137”,它告诉我(通过谷歌)使用交换。

做到了:至少 1 GB 内存和一些交换(在我的情况下为 4 GB)。 vaadin 小部件集的编译似乎相当繁重。

【讨论】:

  • 6 年后还是这样!
猜你喜欢
  • 2020-08-21
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2018-08-13
  • 1970-01-01
  • 2014-07-27
  • 2014-05-06
相关资源
最近更新 更多