pom.xml 11.7 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>pom</artifactId>
31
    <version>2.74-SNAPSHOT</version>
32
  </parent>
33

34
  <artifactId>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.20</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
      </exclusions>
89
    </dependency>
J
Jesse Glick 已提交
90 91 92
    <dependency>
      <groupId>org.jenkins-ci.plugins</groupId>
      <artifactId>matrix-auth</artifactId>
J
Jesse Glick 已提交
93
      <version>1.0.2</version>
J
Jesse Glick 已提交
94
    </dependency>
95 96 97 98
    <dependency>
      <groupId>org.jenkins-ci.plugins</groupId>
      <artifactId>antisamy-markup-formatter</artifactId>
      <version>1.0</version>
99
      <scope>test</scope>
100
    </dependency>
101 102 103
    <dependency>
      <groupId>org.jenkins-ci.plugins</groupId>
      <artifactId>matrix-project</artifactId>
104
      <version>${matrix-project.version}</version>
105
    </dependency>
106 107 108
    <dependency>
      <groupId>org.jenkins-ci.plugins</groupId>
      <artifactId>junit</artifactId>
J
Jesse Glick 已提交
109
      <version>1.2-beta-4</version>
110
      <scope>test</scope>
111
    </dependency>
112 113 114 115 116 117
    <dependency>
      <groupId>org.jenkins-ci.plugins</groupId>
      <artifactId>structs</artifactId>
      <version>1.2</version>
      <scope>test</scope>
    </dependency>
118 119 120 121 122
    <dependency>
      <groupId>org.jvnet.mock-javamail</groupId>
      <artifactId>mock-javamail</artifactId>
      <version>1.7</version>
    </dependency>
123 124
    <dependency>
      <groupId>org.hamcrest</groupId>
125
      <artifactId>hamcrest-core</artifactId>
J
Jesse Glick 已提交
126
      <version>1.3</version>
127
    </dependency>
128 129 130 131
    <dependency><!-- we exclude this transient dependency from htmlunit, which we actually need in the test -->
      <groupId>xalan</groupId>
      <artifactId>xalan</artifactId>
      <version>2.7.1</version>
132 133
      <exclusions>
        <exclusion>
134 135
          <groupId>xml-apis</groupId>
          <artifactId>xml-apis</artifactId>
136 137
        </exclusion>
      </exclusions>
138
    </dependency>
139 140 141 142
    <dependency>
      <!-- for testing JNLP launch. -->
      <groupId>org.jvnet.hudson</groupId>
      <artifactId>netx</artifactId>
K
kohsuke 已提交
143
      <version>0.5-hudson-2</version>
144
    </dependency>
H
huybrechts 已提交
145 146 147 148 149
    <dependency>
      <groupId>org.easymock</groupId>
      <artifactId>easymock</artifactId>
      <version>2.4</version>
    </dependency>
150 151 152 153 154
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-core</artifactId>
      <scope>test</scope>
    </dependency>
155
    <dependency>
S
Sam Van Oort 已提交
156 157 158 159
      <groupId>org.reflections</groupId>
      <artifactId>reflections</artifactId>
      <version>0.9.9</version>
    </dependency>
160
    <dependency>
161 162 163 164
      <groupId>org.codehaus.geb</groupId>
      <artifactId>geb-implicit-assertions</artifactId>
      <version>0.7.2</version>
    </dependency>
O
Oleg Nenashev 已提交
165 166 167 168
    <dependency>
      <groupId>org.javassist</groupId>
      <artifactId>javassist</artifactId>
      <version>3.19.0-GA</version>
169
      <scope>test</scope>
O
Oleg Nenashev 已提交
170 171 172 173 174
    </dependency>
    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-collections4</artifactId>
      <version>4.0</version>
175
      <scope>test</scope>
O
Oleg Nenashev 已提交
176
    </dependency>
177
  </dependencies>
178

179 180
  <build>
    <plugins>
181 182 183 184 185
      <plugin>
        <groupId>org.jenkins-ci.tools</groupId>
        <artifactId>maven-hpi-plugin</artifactId>
        <extensions>true</extensions>
      </plugin>
186 187 188 189 190 191 192
      <plugin>
        <groupId>org.kohsuke.stapler</groupId>
        <artifactId>maven-stapler-plugin</artifactId>
        <!-- version specified in grandparent pom -->
        <extensions>true</extensions>
      </plugin>
      <plugin>
193
        <groupId>org.apache.maven.plugins</groupId>
194 195 196
        <artifactId>maven-surefire-plugin</artifactId>
        <!-- version specified in grandparent pom -->
        <configuration>
B
Baptiste Mathus 已提交
197
          <argLine>${jacocoSurefireArgs} -Dfile.encoding=UTF-8 -Xmx1g</argLine>
198
          <systemPropertyVariables>
199
              <!-- use AntClassLoader that supports predictable file handle release -->
200 201 202 203
              <hudson.ClassicPluginStrategy.useAntClassLoader>true</hudson.ClassicPluginStrategy.useAntClassLoader>
              <hudson.maven.debug>${mavenDebug}</hudson.maven.debug>
              <buildDirectory>${project.build.directory}</buildDirectory>
          </systemPropertyVariables>
D
Daniel Beck 已提交
204
          <reuseForks>false</reuseForks>
J
Jesse Glick 已提交
205
          <forkCount>${concurrency}</forkCount>
206 207
        </configuration>
      </plugin>
K
Kohsuke Kawaguchi 已提交
208 209 210
      <plugin>
        <groupId>org.codehaus.gmaven</groupId>
        <artifactId>gmaven-plugin</artifactId>
211
        <!-- version specified in grandparent pom -->
K
Kohsuke Kawaguchi 已提交
212 213
        <executions>
          <execution>
214
            <id>default</id>
K
Kohsuke Kawaguchi 已提交
215 216 217 218 219 220
            <!-- compile and process annotations in Groovy test code -->
            <goals>
              <goal>generateTestStubs</goal>
              <goal>testCompile</goal>
            </goals>
          </execution>
221 222 223 224 225 226 227
        </executions>
        <dependencies>
          <dependency>
            <groupId>org.apache.ant</groupId>
            <artifactId>ant</artifactId>
            <version>1.8.0</version>
          </dependency>
228
          <!-- Usually a dependency of ant, but some people seem to have an incomplete ant POM. See JENKINS-11416 -->
229 230 231 232 233
          <dependency>
            <groupId>org.apache.ant</groupId>
            <artifactId>ant-launcher</artifactId>
            <version>1.8.0</version>
          </dependency>
234 235
        </dependencies>
      </plugin>
J
Jesse Glick 已提交
236 237 238 239 240 241
      <plugin>
        <artifactId>maven-deploy-plugin</artifactId>
        <configuration>
          <skip>true</skip>
        </configuration>
      </plugin>
242 243 244
    </plugins>
  </build>

245
  <profiles>
246 247 248
    <profile>
      <id>light-test</id>
      <properties>
249
        <skipTests>true</skipTests>
250 251
      </properties>
    </profile>
252 253 254 255 256 257 258 259 260
    <profile>
      <id>all-tests</id>
      <activation>
        <property>
          <name>!test</name>
        </property>
      </activation>
      <properties>
        <maven.test.redirectTestOutputToFile>true</maven.test.redirectTestOutputToFile>
261
        <surefire.rerunFailingTestsCount>4</surefire.rerunFailingTestsCount>
262 263
      </properties>
    </profile>
264
    <profile>
265
      <!-- Obtain code coverage report. This is done by running Unit tests on our own and suppressing surefire. -->
266 267 268 269
      <id>cobertura</id>
      <build>
        <plugins>
          <plugin>
270
            <groupId>org.codehaus.gmaven</groupId>
271
            <artifactId>gmaven-plugin</artifactId>
272
            <!-- version specified in grandparent pom -->
273 274 275 276 277 278 279 280 281
            <executions>
              <!-- run unit test -->
              <execution>
                <phase>test</phase>
                <goals>
                  <goal>execute</goal>
                </goals>
                <configuration>
                  <scriptpath>
K
kohsuke 已提交
282
                    <!-- load helpers from hg core -->
283 284 285 286 287 288 289 290 291
                    <element>${project.basedir}/../core/src/build-script</element>
                  </scriptpath>
                  <source>${project.basedir}/src/build-script/unitTest.groovy</source>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
O
Olivier Lamy 已提交
292
    </profile>    
293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338
    <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>
339
  </profiles>
K
kohsuke 已提交
340
</project>