summaryrefslogtreecommitdiffstats
path: root/test/servlet-containers/karaf/karaf-run/pom.xml
blob: df2ca49de9ae7eb008bb68656ab379df5ea9aa93 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <parent>
        <artifactId>vaadin-test-karaf</artifactId>
        <groupId>com.vaadin</groupId>
        <version>8.14-SNAPSHOT</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <artifactId>karaf-run</artifactId>
    <packaging>pom</packaging>
    <name>Vaadin Karaf Test Runner</name>

    <dependencies>
        <!--Vaadin dependencies should not be in a classpath-->
        <dependency>
            <groupId>com.vaadin</groupId>
            <artifactId>vaadin-server</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.vaadin</groupId>
            <artifactId>vaadin-themes</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.vaadin</groupId>
            <artifactId>vaadin-karaf-bundle1</artifactId>
            <version>${project.version}</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>com.vaadin</groupId>
            <artifactId>vaadin-karaf-bundle2</artifactId>
            <version>${project.version}</version>
            <scope>runtime</scope>
        </dependency>
    </dependencies>
    <profiles>
        <profile>
            <id>windows</id>
            <activation>
                <os>
                    <family>Windows</family>
                </os>
            </activation>
            <properties>
                <karaf.script>karaf.bat</karaf.script>
            </properties>
        </profile>
    </profiles>

    <properties>
        <karaf.script>karaf</karaf.script>
        <karaf.home>${project.basedir}/apache-karaf-${karaf.plugin.version}-minimal</karaf.home>
    </properties>

    <build>
        <plugins>
            <plugin>
                <artifactId>maven-clean-plugin</artifactId>
                <executions>
                    <execution><id>clean-karaf</id>
                        <phase>pre-integration-test</phase>
                        <goals><goal>clean</goal></goals>
                        <configuration>
                            <failOnError>false</failOnError>
                            <excludeDefaultDirectories>true</excludeDefaultDirectories>
                            <filesets>
                                <fileset>
                                    <directory>${karaf.home}</directory>
                                    <includes>
                                        <include>lock</include>
                                        <include>karaf.pid</include>
                                        <include>instances/*</include>
                                        <include>data/*</include>
                                        <include>data/*</include>
                                        <include>data/*/**</include>
                                    </includes>
                                </fileset>
                            </filesets>
                        </configuration>
                        </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <version>1.6.0</version>
                <executions>
                    <execution>
                        <id>start-karaf-background</id>
                        <phase>pre-integration-test</phase>
                        <goals>
                            <goal>exec</goal>
                        </goals>
                        <configuration>
                            <executable>${karaf.home}/bin/${karaf.script}
                            </executable>
                            <async>true</async>
                            <asyncDestroyOnShutdown>true</asyncDestroyOnShutdown>
                            <commandlineArgs>server</commandlineArgs>
                            <workingDirectory>${project.build.directory}</workingDirectory>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.karaf.tooling</groupId>
                <artifactId>karaf-maven-plugin</artifactId>
                <version>4.2.1</version>
                <executions>
                    <execution>
                        <id>karaf-client-ctrl</id>
                        <phase>pre-integration-test</phase>
                        <goals>
                            <goal>client</goal>
                        </goals>
                        <configuration>
                            <delay>5</delay>
                            <attempts>150</attempts>
                            <commands>
                                <!--Scheduled shutdown in 15 minutes-->
                                <command>shutdown -f +10</command>
                                <command>feature:install http</command>
                                <command>feature:install http-whiteboard</command>
                                <command>bundle:install -s mvn:org.jsoup/jsoup/1.11.2</command>
                                <command>bundle:install -s mvn:com.vaadin.external/gentyref/1.2.0.vaadin1</command>
                                <command>bundle:install -s mvn:com.vaadin/vaadin-shared/${vaadin.version}</command>
                                <command>bundle:install -s mvn:com.vaadin/vaadin-server/${vaadin.version}</command>
                                <command>bundle:install -s mvn:com.vaadin/vaadin-osgi-integration/${vaadin.version}
                                </command>
                                <command>bundle:install -s mvn:com.vaadin/vaadin-client-compiled/${vaadin.version}
                                </command>
                                <command>bundle:install -s mvn:com.vaadin/vaadin-themes/${vaadin.version}</command>
                                <command>
                                    <![CDATA[bundle:install -s file:./../../vaadin-karaf-bundle1/target/vaadin-karaf-bundle1-${project.version}.jar]]></command>
                                <command>
                                    <![CDATA[bundle:install -s file:./../../vaadin-karaf-bundle2/target/vaadin-karaf-bundle2-${project.version}.jar]]></command>
                            </commands>
                        </configuration>
                    </execution>
                    <execution>
                        <id>karaf-client-shutdown</id>
                        <phase>post-integration-test</phase>
                        <goals>
                            <goal>client</goal>
                        </goals>
                        <configuration>
                            <delay>5</delay>
                            <attempts>10</attempts>
                            <commands>
                                <command>system:shutdown -f</command>
                            </commands>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-failsafe-plugin</artifactId>
                <version>2.19.1</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>integration-test</goal>
                            <goal>verify</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <environmentVariables>
                        <vaadin.version>${vaadin.version}</vaadin.version>
                    </environmentVariables>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>