pom.xml 13.1 KB
Newer Older
J
Jesse Glick 已提交
1
<?xml version="1.0" encoding="UTF-8"?>
K
kohsuke 已提交
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
<!--
The MIT License

Copyright (c) 2004-2009, Sun Microsystems, Inc., Kohsuke Kawaguchi

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-->
25
<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/maven-v4_0_0.xsd">
26 27
  <modelVersion>4.0.0</modelVersion>

28
  <parent>
29
    <groupId>org.jenkins-ci.main</groupId>
30
    <artifactId>jenkins-parent</artifactId>
31
    <version>${revision}${changelist}</version>
32
  </parent>
33

34
  <artifactId>jenkins-test</artifactId>
35

36 37
  <name>Tests for Jenkins core</name>
  <description>Functional tests for Jenkins core</description>
38

39
  <properties>
J
Jesse Glick 已提交
40
    <concurrency>2</concurrency> <!-- may use e.g. 2C for 2 × (number of cores) -->
S
Seiji Sogabe 已提交
41
    <mavenDebug>false</mavenDebug>
42
    <jacocoSurefireArgs /><!-- empty by default -->
43 44
  </properties>

45 46 47
  <dependencies>
    <dependency>
      <groupId>${project.groupId}</groupId>
K
Kohsuke Kawaguchi 已提交
48
      <artifactId>jenkins-war</artifactId>
49
      <version>${project.version}</version>
50 51
      <type>executable-war</type>
      <scope>test</scope>
52
    </dependency>
53 54 55
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>jenkins-test-harness</artifactId>
56
      <version>2.36</version>
57
      <scope>test</scope>
58 59 60 61 62 63
      <exclusions>
        <exclusion>
          <groupId>${project.groupId}</groupId>
          <artifactId>jenkins-war</artifactId>
        </exclusion>
      </exclusions>
64 65 66 67
    </dependency>
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>jenkins-test-harness-tools</artifactId>
68
      <version>2.0</version>
69 70
      <scope>test</scope>
    </dependency>
71 72 73
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>maven-plugin</artifactId>
74
      <version>${maven-plugin.version}</version>
75
      <exclusions>
76
        <exclusion> <!-- perhaps unnecessary as of JENKINS-35445? -->
77 78 79 80 81 82 83
          <groupId>org.apache.httpcomponents</groupId>
          <artifactId>httpclient</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.apache.httpcomponents</groupId>
          <artifactId>httpcore</artifactId>
        </exclusion>
84 85 86 87
        <exclusion>
          <groupId>commons-codec</groupId>
          <artifactId>commons-codec</artifactId>
        </exclusion>
88 89 90 91 92 93 94 95
        <exclusion>
          <groupId>com.google.inject</groupId>
          <artifactId>guice</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.apache.ant</groupId>
          <artifactId>ant</artifactId>
        </exclusion>
96
      </exclusions>
97
    </dependency>
J
Jesse Glick 已提交
98 99 100
    <dependency>
      <groupId>org.jenkins-ci.plugins</groupId>
      <artifactId>matrix-auth</artifactId>
J
Jesse Glick 已提交
101
      <version>1.0.2</version>
J
Jesse Glick 已提交
102
    </dependency>
103 104 105 106
    <dependency>
      <groupId>org.jenkins-ci.plugins</groupId>
      <artifactId>antisamy-markup-formatter</artifactId>
      <version>1.0</version>
107
      <scope>test</scope>
108
    </dependency>
109 110 111
    <dependency>
      <groupId>org.jenkins-ci.plugins</groupId>
      <artifactId>matrix-project</artifactId>
112
      <version>${matrix-project.version}</version>
113
    </dependency>
114 115 116
    <dependency>
      <groupId>org.jenkins-ci.plugins</groupId>
      <artifactId>junit</artifactId>
117
      <version>1.6</version>
118
      <scope>test</scope>
119
    </dependency>
120 121 122 123 124 125
    <dependency>
      <groupId>org.jenkins-ci.plugins</groupId>
      <artifactId>structs</artifactId>
      <version>1.2</version>
      <scope>test</scope>
    </dependency>
126 127 128 129
    <dependency>
      <groupId>org.jvnet.mock-javamail</groupId>
      <artifactId>mock-javamail</artifactId>
      <version>1.7</version>
130 131 132 133 134 135
      <exclusions>
        <exclusion>
          <groupId>javax.mail</groupId>
          <artifactId>mail</artifactId>
        </exclusion>
      </exclusions>
136
    </dependency>
137 138
    <dependency>
      <groupId>org.hamcrest</groupId>
139
      <artifactId>hamcrest-core</artifactId>
J
Jesse Glick 已提交
140
      <version>1.3</version>
141
    </dependency>
142 143 144
    <dependency><!-- we exclude this transient dependency from htmlunit, which we actually need in the test -->
      <groupId>xalan</groupId>
      <artifactId>xalan</artifactId>
145
      <version>2.7.2</version>
146 147
      <exclusions>
        <exclusion>
148 149
          <groupId>xml-apis</groupId>
          <artifactId>xml-apis</artifactId>
150 151
        </exclusion>
      </exclusions>
152
    </dependency>
153 154 155 156
    <dependency>
      <!-- for testing JNLP launch. -->
      <groupId>org.jvnet.hudson</groupId>
      <artifactId>netx</artifactId>
K
kohsuke 已提交
157
      <version>0.5-hudson-2</version>
158
    </dependency>
H
huybrechts 已提交
159 160 161 162 163
    <dependency>
      <groupId>org.easymock</groupId>
      <artifactId>easymock</artifactId>
      <version>2.4</version>
    </dependency>
164 165 166 167 168
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-core</artifactId>
      <scope>test</scope>
    </dependency>
169
    <dependency>
S
Sam Van Oort 已提交
170 171 172
      <groupId>org.reflections</groupId>
      <artifactId>reflections</artifactId>
      <version>0.9.9</version>
173 174 175 176 177 178 179 180 181 182
      <exclusions>
        <exclusion> <!-- TODO requests 15; apparently works well enough with the 11 we bundle -->
          <groupId>com.google.guava</groupId>
          <artifactId>guava</artifactId>
        </exclusion>
        <exclusion> <!-- pick up from Stapler -->
          <groupId>com.google.code.findbugs</groupId>
          <artifactId>jsr305</artifactId>
        </exclusion>
      </exclusions>
S
Sam Van Oort 已提交
183
    </dependency>
184
    <dependency>
185 186 187 188
      <groupId>org.codehaus.geb</groupId>
      <artifactId>geb-implicit-assertions</artifactId>
      <version>0.7.2</version>
    </dependency>
O
Oleg Nenashev 已提交
189 190 191 192
    <dependency>
      <groupId>org.javassist</groupId>
      <artifactId>javassist</artifactId>
      <version>3.19.0-GA</version>
193
      <scope>test</scope>
O
Oleg Nenashev 已提交
194 195 196 197 198
    </dependency>
    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-collections4</artifactId>
      <version>4.0</version>
199
      <scope>test</scope>
O
Oleg Nenashev 已提交
200
    </dependency>
201 202 203 204 205 206
    <dependency>
      <groupId>org.awaitility</groupId>
      <artifactId>awaitility</artifactId>
      <version>3.0.0</version>
      <scope>test</scope>
    </dependency>
B
Baptiste Mathus 已提交
207 208 209 210 211
    <dependency>
      <groupId>org.objenesis</groupId>
      <artifactId>objenesis</artifactId>
      <scope>test</scope>
    </dependency>
212
  </dependencies>
213

214 215
  <build>
    <plugins>
216 217 218 219 220
      <plugin>
        <groupId>org.jenkins-ci.tools</groupId>
        <artifactId>maven-hpi-plugin</artifactId>
        <extensions>true</extensions>
      </plugin>
221 222 223 224 225 226
      <plugin>
        <groupId>org.kohsuke.stapler</groupId>
        <artifactId>maven-stapler-plugin</artifactId>
        <!-- version specified in grandparent pom -->
        <extensions>true</extensions>
      </plugin>
227 228 229 230 231 232 233 234 235 236 237 238 239 240 241
      <plugin>
        <artifactId>maven-dependency-plugin</artifactId>
        <executions>
          <execution>
            <id>old-remoting-for-test</id>
            <phase>generate-test-resources</phase>
            <goals>
              <!-- we use copy as this is a dependency from outside the reactor -->
              <goal>copy</goal>
            </goals>
            <configuration>
              <artifactItems>
                <artifactItem>
                  <groupId>org.jenkins-ci.main</groupId>
                  <artifactId>remoting</artifactId>
242
                  <version>${remoting.minimum.supported.version}</version>
243 244 245 246 247 248 249 250 251
                  <type>jar</type>
                  <outputDirectory>${project.build.outputDirectory}/old-remoting</outputDirectory>
                  <destFileName>remoting-minimal-supported.jar</destFileName>
                </artifactItem>
              </artifactItems>
            </configuration>
          </execution>
        </executions>
      </plugin>
252
      <plugin>
253
        <groupId>org.apache.maven.plugins</groupId>
254 255 256
        <artifactId>maven-surefire-plugin</artifactId>
        <!-- version specified in grandparent pom -->
        <configuration>
B
Baptiste Mathus 已提交
257
          <argLine>${jacocoSurefireArgs} -Dfile.encoding=UTF-8 -Xmx1g</argLine>
258
          <systemPropertyVariables>
259
              <!-- use AntClassLoader that supports predictable file handle release -->
260 261 262 263
              <hudson.ClassicPluginStrategy.useAntClassLoader>true</hudson.ClassicPluginStrategy.useAntClassLoader>
              <hudson.maven.debug>${mavenDebug}</hudson.maven.debug>
              <buildDirectory>${project.build.directory}</buildDirectory>
          </systemPropertyVariables>
D
Daniel Beck 已提交
264
          <reuseForks>false</reuseForks>
J
Jesse Glick 已提交
265
          <forkCount>${concurrency}</forkCount>
266 267
        </configuration>
      </plugin>
J
Jesse Glick 已提交
268 269 270 271 272 273
      <plugin>
        <artifactId>maven-deploy-plugin</artifactId>
        <configuration>
          <skip>true</skip>
        </configuration>
      </plugin>
274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290
      <plugin> <!-- TODO pending JENKINS-45271 fix, would be best to finish moving MavenModuleSet-specific tests to maven-plugin and delete the test dep here -->
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-enforcer-plugin</artifactId>
        <configuration>
          <rules>
            <requireUpperBoundDeps>
              <excludes combine.children="append">
                <exclude>org.apache.maven:maven-embedder</exclude>
                <exclude>org.codehaus.plexus:plexus-classworlds</exclude>
                <exclude>org.apache.maven:maven-core</exclude>
                <exclude>org.apache.maven:maven-aether-provider</exclude>
                <exclude>org.codehaus.plexus:plexus-utils</exclude>
              </excludes>
            </requireUpperBoundDeps>
          </rules>
        </configuration>
      </plugin>
291 292 293 294 295 296 297 298
      <plugin> <!-- https://stackoverflow.com/a/19503679/12916 ysoserial deliberately uses internal APIs; suppress warnings about them -->
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <compilerArgument>-XDignore.symbol.file</compilerArgument>
          <fork>true</fork>
        </configuration>
      </plugin>
299 300 301
    </plugins>
  </build>

302
  <profiles>
303 304 305
    <profile>
      <id>light-test</id>
      <properties>
306
        <skipTests>true</skipTests>
307 308
      </properties>
    </profile>
309 310 311 312 313 314 315 316 317
    <profile>
      <id>all-tests</id>
      <activation>
        <property>
          <name>!test</name>
        </property>
      </activation>
      <properties>
        <maven.test.redirectTestOutputToFile>true</maven.test.redirectTestOutputToFile>
318
        <surefire.rerunFailingTestsCount>4</surefire.rerunFailingTestsCount>
J
Jesse Glick 已提交
319
        <surefire.skipAfterFailureCount>100</surefire.skipAfterFailureCount>
320 321
      </properties>
    </profile>
322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367
    <profile>
      <id>jacoco</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.jacoco</groupId>
            <artifactId>jacoco-maven-plugin</artifactId>
            <version>0.6.3.201306030806</version>
            <executions>
              <!--
                Prepares the property pointing to the JaCoCo runtime agent which
                is passed as VM argument when Maven the Surefire plugin is executed.
              -->
              <execution>
                <id>pre-unit-test</id>
                <goals>
                  <goal>prepare-agent</goal>
                </goals>
                <configuration>
                  <!-- Sets the path to the file which contains the execution data. -->
                  <destFile>${project.build.directory}/coverage-reports/jacoco-ut.exec</destFile>
                  <propertyName>jacocoSurefireArgs</propertyName>
                </configuration>
              </execution>
              <!--
                Ensures that the code coverage report for unit tests is created after
                unit tests have been run.
              -->
              <execution>
                <id>post-unit-test</id>
                <phase>test</phase>
                <goals>
                  <goal>report</goal>
                </goals>
                <configuration>
                  <!-- Sets the path to the file which contains the execution data. -->
                  <dataFile>${project.build.directory}/coverage-reports/jacoco-ut.exec</dataFile>
                  <!-- Sets the output directory for the code coverage report. -->
                  <outputDirectory>${project.reporting.outputDirectory}/jacoco-ut</outputDirectory>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
368
  </profiles>
K
kohsuke 已提交
369
</project>