pom.xml 12.5 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.51-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
    <trimStackTrace>false</trimStackTrace> <!-- SUREFIRE-1226 workaround -->
44 45
  </properties>

46 47
  <dependencies>
    <dependency>
48 49 50 51
      <!--
        put hudson.war in the classpath. we can't pull in the war artifact directly
        because Maven excludes all wars from classpath automatically. so we need a jar artifact.
      -->
52
      <groupId>${project.groupId}</groupId>
K
Kohsuke Kawaguchi 已提交
53
      <artifactId>jenkins-war</artifactId>
54
      <version>${project.version}</version>
55
      <classifier>war-for-test</classifier>
56 57 58 59 60 61
      <exclusions>
        <exclusion>
          <groupId>org.jenkins-ci.modules</groupId>
          <artifactId>sshd</artifactId>
        </exclusion>
      </exclusions>
62
    </dependency>
63 64 65
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>jenkins-test-harness</artifactId>
J
Jesse Glick 已提交
66
      <version>2.13</version>
67
      <scope>test</scope>
68 69 70 71 72 73
      <exclusions>
        <exclusion>
          <groupId>${project.groupId}</groupId>
          <artifactId>jenkins-war</artifactId>
        </exclusion>
      </exclusions>
74 75 76 77
    </dependency>
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>jenkins-test-harness-tools</artifactId>
78
      <version>2.0</version>
79 80
      <scope>test</scope>
    </dependency>
81 82 83
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>maven-plugin</artifactId>
84
      <version>${maven-plugin.version}</version>
85
      <exclusions>
86
        <exclusion> <!-- perhaps unnecessary as of JENKINS-35445? -->
87 88 89 90 91 92 93
          <groupId>org.apache.httpcomponents</groupId>
          <artifactId>httpclient</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.apache.httpcomponents</groupId>
          <artifactId>httpcore</artifactId>
        </exclusion>
94 95 96 97 98 99 100 101
        <exclusion>
          <!--
            during test, this jar gets loaded at the same level as remoting.jar and can cause conflicts depending on the order.
            the package is also not signed, and it creates package conflicts between the signed package from remoting.jar
          -->
          <groupId>org.jenkins-ci</groupId>
          <artifactId>SECURITY-144-compat</artifactId>
        </exclusion>
102 103 104 105
        <exclusion>
          <groupId>commons-codec</groupId>
          <artifactId>commons-codec</artifactId>
        </exclusion>
106
      </exclusions>
107
    </dependency>
108
    <dependency> <!-- TODO seems to be used only by PluginManagerTest -->
109
      <groupId>org.jenkins-ci.plugins</groupId>
110
      <artifactId>subversion</artifactId>
111
      <version>1.45</version>
112
      <scope>test</scope>
O
Oliver Gondža 已提交
113
    </dependency>
J
Jesse Glick 已提交
114 115 116
    <dependency>
      <groupId>org.jenkins-ci.plugins</groupId>
      <artifactId>matrix-auth</artifactId>
J
Jesse Glick 已提交
117
      <version>1.0.2</version>
J
Jesse Glick 已提交
118
    </dependency>
119 120 121 122
    <dependency>
      <groupId>org.jenkins-ci.plugins</groupId>
      <artifactId>antisamy-markup-formatter</artifactId>
      <version>1.0</version>
123
      <scope>test</scope>
124
    </dependency>
125 126 127
    <dependency>
      <groupId>org.jenkins-ci.plugins</groupId>
      <artifactId>matrix-project</artifactId>
128
      <version>${matrix-project.version}</version>
129
    </dependency>
130 131 132
    <dependency>
      <groupId>org.jenkins-ci.plugins</groupId>
      <artifactId>junit</artifactId>
J
Jesse Glick 已提交
133
      <version>1.2-beta-4</version>
134
      <scope>test</scope>
135
    </dependency>
136 137 138 139 140 141
    <dependency>
      <groupId>org.jenkins-ci.plugins</groupId>
      <artifactId>structs</artifactId>
      <version>1.2</version>
      <scope>test</scope>
    </dependency>
142 143 144 145 146
    <dependency>
      <groupId>org.jvnet.mock-javamail</groupId>
      <artifactId>mock-javamail</artifactId>
      <version>1.7</version>
    </dependency>
147 148
    <dependency>
      <groupId>org.hamcrest</groupId>
149
      <artifactId>hamcrest-core</artifactId>
J
Jesse Glick 已提交
150
      <version>1.3</version>
151
    </dependency>
152 153 154 155
    <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>
156 157
      <exclusions>
        <exclusion>
158 159
          <groupId>xml-apis</groupId>
          <artifactId>xml-apis</artifactId>
160 161
        </exclusion>
      </exclusions>
162
    </dependency>
163 164 165 166
    <dependency>
      <!-- for testing JNLP launch. -->
      <groupId>org.jvnet.hudson</groupId>
      <artifactId>netx</artifactId>
K
kohsuke 已提交
167
      <version>0.5-hudson-2</version>
168
    </dependency>
H
huybrechts 已提交
169 170 171 172 173
    <dependency>
      <groupId>org.easymock</groupId>
      <artifactId>easymock</artifactId>
      <version>2.4</version>
    </dependency>
174 175 176 177 178
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-core</artifactId>
      <scope>test</scope>
    </dependency>
179
    <dependency>
S
Sam Van Oort 已提交
180 181 182 183
      <groupId>org.reflections</groupId>
      <artifactId>reflections</artifactId>
      <version>0.9.9</version>
    </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
  </dependencies>
202

203 204 205 206 207 208 209 210 211
  <build>
    <plugins>
      <plugin>
        <groupId>org.kohsuke.stapler</groupId>
        <artifactId>maven-stapler-plugin</artifactId>
        <!-- version specified in grandparent pom -->
        <extensions>true</extensions>
      </plugin>
      <plugin>
212
        <groupId>org.apache.maven.plugins</groupId>
213 214 215
        <artifactId>maven-surefire-plugin</artifactId>
        <!-- version specified in grandparent pom -->
        <configuration>
B
Baptiste Mathus 已提交
216
          <argLine>${jacocoSurefireArgs} -Dfile.encoding=UTF-8 -Xmx1g</argLine>
217
          <systemPropertyVariables>
218
              <!-- use AntClassLoader that supports predictable file handle release -->
219 220 221 222
              <hudson.ClassicPluginStrategy.useAntClassLoader>true</hudson.ClassicPluginStrategy.useAntClassLoader>
              <hudson.maven.debug>${mavenDebug}</hudson.maven.debug>
              <buildDirectory>${project.build.directory}</buildDirectory>
          </systemPropertyVariables>
D
Daniel Beck 已提交
223
          <reuseForks>false</reuseForks>
J
Jesse Glick 已提交
224
          <forkCount>${concurrency}</forkCount>
225 226
        </configuration>
      </plugin>
K
Kohsuke Kawaguchi 已提交
227 228 229
      <plugin>
        <groupId>org.codehaus.gmaven</groupId>
        <artifactId>gmaven-plugin</artifactId>
230
        <!-- version specified in grandparent pom -->
K
Kohsuke Kawaguchi 已提交
231 232
        <executions>
          <execution>
233
            <id>default</id>
K
Kohsuke Kawaguchi 已提交
234 235 236 237 238 239
            <!-- compile and process annotations in Groovy test code -->
            <goals>
              <goal>generateTestStubs</goal>
              <goal>testCompile</goal>
            </goals>
          </execution>
240 241 242 243 244 245 246
        </executions>
        <dependencies>
          <dependency>
            <groupId>org.apache.ant</groupId>
            <artifactId>ant</artifactId>
            <version>1.8.0</version>
          </dependency>
247
          <!-- Usually a dependency of ant, but some people seem to have an incomplete ant POM. See JENKINS-11416 -->
248 249 250 251 252
          <dependency>
            <groupId>org.apache.ant</groupId>
            <artifactId>ant-launcher</artifactId>
            <version>1.8.0</version>
          </dependency>
253 254 255 256 257
        </dependencies>
      </plugin>
    </plugins>
  </build>

258
  <profiles>
259 260 261
    <profile>
      <id>light-test</id>
      <properties>
262
        <skipTests>true</skipTests>
263 264
      </properties>
    </profile>
265 266 267 268 269 270 271 272 273
    <profile>
      <id>all-tests</id>
      <activation>
        <property>
          <name>!test</name>
        </property>
      </activation>
      <properties>
        <maven.test.redirectTestOutputToFile>true</maven.test.redirectTestOutputToFile>
274
        <surefire.rerunFailingTestsCount>4</surefire.rerunFailingTestsCount>
275 276
      </properties>
    </profile>
277
    <profile>
278
      <!-- Obtain code coverage report. This is done by running Unit tests on our own and suppressing surefire. -->
279 280 281 282
      <id>cobertura</id>
      <build>
        <plugins>
          <plugin>
283
            <groupId>org.codehaus.gmaven</groupId>
284
            <artifactId>gmaven-plugin</artifactId>
285
            <!-- version specified in grandparent pom -->
286 287 288 289 290 291 292 293 294
            <executions>
              <!-- run unit test -->
              <execution>
                <phase>test</phase>
                <goals>
                  <goal>execute</goal>
                </goals>
                <configuration>
                  <scriptpath>
K
kohsuke 已提交
295
                    <!-- load helpers from hg core -->
296 297 298 299 300 301 302 303 304
                    <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 已提交
305
    </profile>    
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 339 340 341 342 343 344 345 346 347 348 349 350 351
    <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>
352
  </profiles>
K
kohsuke 已提交
353
</project>