pom.xml 13.8 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>1.644</version>
32
  </parent>
33

K
Kohsuke Kawaguchi 已提交
34
  <artifactId>jenkins-test-harness</artifactId>
35

36
  <name>Test harness for Jenkins and plugins</name>
37
  <description>Unit test harness (src/main) and Unit tests for Jenkins core (src/test)</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
    <ignore.random.failures>false</ignore.random.failures>
43
    <jacocoSurefireArgs /><!-- empty by default -->
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>maven-plugin</artifactId>
66
      <version>${maven-plugin.version}</version>
67 68 69 70 71 72 73 74 75
      <exclusions>
        <exclusion>
          <groupId>org.apache.httpcomponents</groupId>
          <artifactId>httpclient</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.apache.httpcomponents</groupId>
          <artifactId>httpcore</artifactId>
        </exclusion>
76 77 78 79 80 81 82 83
        <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>
84 85 86 87
        <exclusion>
          <groupId>commons-codec</groupId>
          <artifactId>commons-codec</artifactId>
        </exclusion>
88
      </exclusions>
89
    </dependency>
90 91 92
    <dependency>
      <groupId>org.jenkins-ci.plugins</groupId>
      <artifactId>ant</artifactId>
93
      <version>1.2</version>
94
    </dependency>
95
    <dependency>
96
      <groupId>org.jenkins-ci.plugins</groupId>
97
      <artifactId>subversion</artifactId>
98
      <version>1.45</version>
99
    </dependency>
O
Oliver Gondža 已提交
100 101 102
    <dependency>
      <groupId>org.jenkins-ci.plugins</groupId>
      <artifactId>mailer</artifactId>
103
      <version>1.10</version>
O
Oliver Gondža 已提交
104
    </dependency>
J
Jesse Glick 已提交
105 106 107
    <dependency>
      <groupId>org.jenkins-ci.plugins</groupId>
      <artifactId>matrix-auth</artifactId>
J
Jesse Glick 已提交
108
      <version>1.0.2</version>
J
Jesse Glick 已提交
109
    </dependency>
110 111 112 113 114
    <dependency>
      <groupId>org.jenkins-ci.plugins</groupId>
      <artifactId>antisamy-markup-formatter</artifactId>
      <version>1.0</version>
    </dependency>
115 116 117
    <dependency>
      <groupId>org.jenkins-ci.plugins</groupId>
      <artifactId>matrix-project</artifactId>
118
      <version>${matrix-project.version}</version>
119
    </dependency>
120 121 122
    <dependency>
      <groupId>org.jenkins-ci.plugins</groupId>
      <artifactId>junit</artifactId>
J
Jesse Glick 已提交
123
      <version>1.2-beta-4</version>
124
    </dependency>
125 126 127
    <dependency>
      <groupId>org.mortbay.jetty</groupId>
      <artifactId>jetty</artifactId>
128
      <version>6.1.26</version>
129
    </dependency>
130
    <dependency>
131
      <groupId>org.jenkins-ci</groupId>
132
      <artifactId>test-annotations</artifactId>
K
Kanstantsin Shautsou 已提交
133
      <version>${test-annotations.version}</version>
134
      <!-- in this module we need this as a compile scope, whereas in the parent it's test -->
K
Kanstantsin Shautsou 已提交
135
      <scope>compile</scope>
136
    </dependency>
137 138 139 140 141
    <dependency>
      <groupId>org.jvnet.mock-javamail</groupId>
      <artifactId>mock-javamail</artifactId>
      <version>1.7</version>
    </dependency>
142 143
    <dependency>
      <groupId>junit</groupId>
J
Jesse Glick 已提交
144
      <artifactId>junit</artifactId>
145 146 147 148
    </dependency>
    <dependency>
      <groupId>org.hamcrest</groupId>
      <artifactId>hamcrest-library</artifactId>
J
Jesse Glick 已提交
149
      <version>1.3</version>
150
    </dependency>
151
    <dependency>
152
      <groupId>net.sourceforge.htmlunit</groupId>
153
      <artifactId>htmlunit</artifactId>
T
tfennelly 已提交
154
      <version>2.18</version>
155
      <exclusions>
156 157 158 159
        <exclusion>
          <groupId>commons-codec</groupId>
          <artifactId>commons-codec</artifactId>
        </exclusion>
160
      </exclusions>
161
    </dependency>
162 163 164 165 166
    <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>
    </dependency>
167 168 169
    <dependency>
      <groupId>org.jvnet.hudson</groupId>
      <artifactId>embedded-rhino-debugger</artifactId>
170
      <version>1.2</version>
171 172 173 174 175 176
      <exclusions>
        <exclusion>
          <groupId>org.jvnet.hudson</groupId>
          <artifactId>htmlunit-core-js</artifactId>
        </exclusion>
      </exclusions>
177
    </dependency>
178 179 180 181
    <dependency>
      <!-- for testing JNLP launch. -->
      <groupId>org.jvnet.hudson</groupId>
      <artifactId>netx</artifactId>
K
kohsuke 已提交
182
      <version>0.5-hudson-2</version>
183
    </dependency>
H
huybrechts 已提交
184 185 186 187 188
    <dependency>
      <groupId>org.easymock</groupId>
      <artifactId>easymock</artifactId>
      <version>2.4</version>
    </dependency>
189 190 191 192 193
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-core</artifactId>
      <scope>test</scope>
    </dependency>
194 195 196 197 198 199 200 201 202 203
    <dependency>
      <groupId>org.netbeans.modules</groupId>
      <artifactId>org-netbeans-insane</artifactId>
      <version>RELEASE72</version>
    </dependency>
    <dependency>
      <groupId>com.github.stephenc.findbugs</groupId>
      <artifactId>findbugs-annotations</artifactId>
      <version>1.3.9-1</version>
    </dependency>
204 205 206 207 208
    <dependency>
      <groupId>org.codehaus.geb</groupId>
      <artifactId>geb-implicit-assertions</artifactId>
      <version>0.7.2</version>
    </dependency>
O
Oleg Nenashev 已提交
209 210 211 212
    <dependency>
      <groupId>org.javassist</groupId>
      <artifactId>javassist</artifactId>
      <version>3.19.0-GA</version>
213
      <scope>test</scope>
O
Oleg Nenashev 已提交
214 215 216 217 218
    </dependency>
    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-collections4</artifactId>
      <version>4.0</version>
219
      <scope>test</scope>
O
Oleg Nenashev 已提交
220
    </dependency>
221
  </dependencies>
222

223 224 225 226 227 228 229 230 231
  <build>
    <plugins>
      <plugin>
        <groupId>org.kohsuke.stapler</groupId>
        <artifactId>maven-stapler-plugin</artifactId>
        <!-- version specified in grandparent pom -->
        <extensions>true</extensions>
      </plugin>
      <plugin>
232
        <groupId>org.apache.maven.plugins</groupId>
233 234 235
        <artifactId>maven-surefire-plugin</artifactId>
        <!-- version specified in grandparent pom -->
        <configuration>
236
          <argLine>${jacocoSurefireArgs} -Dfile.encoding=UTF-8 -Xmx256m -XX:MaxPermSize=128m</argLine>
237
          <systemPropertyVariables>
238
              <!-- use AntClassLoader that supports predictable file handle release -->
239 240 241
              <hudson.ClassicPluginStrategy.useAntClassLoader>true</hudson.ClassicPluginStrategy.useAntClassLoader>
              <hudson.maven.debug>${mavenDebug}</hudson.maven.debug>
              <buildDirectory>${project.build.directory}</buildDirectory>
242
              <ignore.random.failures>${ignore.random.failures}</ignore.random.failures>
243
          </systemPropertyVariables>
J
Jesse Glick 已提交
244 245
          <reuseForks>true</reuseForks>
          <forkCount>${concurrency}</forkCount>
246 247
        </configuration>
      </plugin>
K
Kohsuke Kawaguchi 已提交
248 249 250
      <plugin>
        <groupId>org.codehaus.gmaven</groupId>
        <artifactId>gmaven-plugin</artifactId>
251
        <!-- version specified in grandparent pom -->
K
Kohsuke Kawaguchi 已提交
252 253
        <executions>
          <execution>
254
            <id>default</id>
K
Kohsuke Kawaguchi 已提交
255 256 257 258 259 260
            <!-- compile and process annotations in Groovy test code -->
            <goals>
              <goal>generateTestStubs</goal>
              <goal>testCompile</goal>
            </goals>
          </execution>
261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277
          <execution>
            <id>preset-packager</id>
            <phase>process-resources</phase>
            <goals>
              <goal>execute</goal>
            </goals>
            <configuration>
              <source>${pom.basedir}/src/main/preset-data/package.groovy</source>
            </configuration>
          </execution>
        </executions>
        <dependencies>
          <dependency>
            <groupId>org.apache.ant</groupId>
            <artifactId>ant</artifactId>
            <version>1.8.0</version>
          </dependency>
278
          <!-- Usually a dependency of ant, but some people seem to have an incomplete ant POM. See JENKINS-11416 -->
279 280 281 282 283
          <dependency>
            <groupId>org.apache.ant</groupId>
            <artifactId>ant-launcher</artifactId>
            <version>1.8.0</version>
          </dependency>
284 285 286 287 288
          <dependency>
            <groupId>org.codehaus.gmaven.runtime</groupId>
            <artifactId>gmaven-runtime-2.0</artifactId>
            <version>1.5-jenkins-1</version>
          </dependency>
289
        </dependencies>
290 291 292
        <configuration>
          <providerSelection>2.0</providerSelection>
        </configuration>
293 294 295 296
      </plugin>
    </plugins>
  </build>

297
  <profiles>
298 299 300
    <profile>
      <id>light-test</id>
      <properties>
301
        <skipTests>true</skipTests>
302 303
      </properties>
    </profile>
304 305 306 307 308 309 310 311 312 313 314
    <profile>
      <id>all-tests</id>
      <activation>
        <property>
          <name>!test</name>
        </property>
      </activation>
      <properties>
        <maven.test.redirectTestOutputToFile>true</maven.test.redirectTestOutputToFile>
      </properties>
    </profile>
315
    <profile>
316
      <!-- Obtain code coverage report. This is done by running Unit tests on our own and suppressing surefire. -->
317 318 319 320
      <id>cobertura</id>
      <build>
        <plugins>
          <plugin>
321
            <groupId>org.codehaus.gmaven</groupId>
322
            <artifactId>gmaven-plugin</artifactId>
323
            <!-- version specified in grandparent pom -->
324 325 326 327 328 329 330 331 332
            <executions>
              <!-- run unit test -->
              <execution>
                <phase>test</phase>
                <goals>
                  <goal>execute</goal>
                </goals>
                <configuration>
                  <scriptpath>
K
kohsuke 已提交
333
                    <!-- load helpers from hg core -->
334 335 336 337 338 339 340 341 342
                    <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 已提交
343
    </profile>    
344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389
    <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>
390
  </profiles>
K
kohsuke 已提交
391
</project>