pom.xml 12.3 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 25
<!--
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.
-->

26
<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">
27 28
  <modelVersion>4.0.0</modelVersion>

29 30
  <parent>
    <artifactId>pom</artifactId>
31
    <groupId>org.jenkins-ci.main</groupId>
32
    <version>1.577-SNAPSHOT</version>
33
  </parent>
34
  <groupId>org.jenkins-ci.main</groupId>
K
Kohsuke Kawaguchi 已提交
35
  <artifactId>jenkins-test-harness</artifactId>
36

37
  <name>Test harness for Jenkins and plugins</name>
38
  <description>
39
    Unit test harness (src/main) and Unit tests for Jenkins core (src/test)
40
  </description>
41

42
  <properties>
J
Jesse Glick 已提交
43
    <concurrency>2</concurrency> <!-- may use e.g. 2C for 2 × (number of cores) -->
S
Seiji Sogabe 已提交
44
    <mavenDebug>false</mavenDebug>
45
    <ignore.random.failures>false</ignore.random.failures>
46
    <jacocoSurefireArgs /><!-- empty by default -->
47 48
  </properties>

49 50
  <dependencies>
    <dependency>
51 52 53 54
      <!--
        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.
      -->
55
      <groupId>${project.groupId}</groupId>
K
Kohsuke Kawaguchi 已提交
56
      <artifactId>jenkins-war</artifactId>
57
      <version>${project.version}</version>
58
      <classifier>war-for-test</classifier>
59 60 61 62 63 64
      <exclusions>
        <exclusion>
          <groupId>org.jenkins-ci.modules</groupId>
          <artifactId>sshd</artifactId>
        </exclusion>
      </exclusions>
65
    </dependency>
66 67 68
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>maven-plugin</artifactId>
69
      <version>${maven-plugin.version}</version>
70
    </dependency>
71 72 73
    <dependency>
      <groupId>org.jenkins-ci.plugins</groupId>
      <artifactId>ant</artifactId>
74
      <version>1.2</version>
75
    </dependency>
76
    <dependency>
77
      <groupId>org.jenkins-ci.plugins</groupId>
78
      <artifactId>subversion</artifactId>
79
      <version>1.45</version>
80
    </dependency>
O
Oliver Gondža 已提交
81 82 83
    <dependency>
      <groupId>org.jenkins-ci.plugins</groupId>
      <artifactId>mailer</artifactId>
84
      <version>1.10</version>
O
Oliver Gondža 已提交
85
    </dependency>
J
Jesse Glick 已提交
86 87 88
    <dependency>
      <groupId>org.jenkins-ci.plugins</groupId>
      <artifactId>matrix-auth</artifactId>
J
Jesse Glick 已提交
89
      <version>1.0.2</version>
J
Jesse Glick 已提交
90
    </dependency>
91 92 93 94 95
    <dependency>
      <groupId>org.jenkins-ci.plugins</groupId>
      <artifactId>antisamy-markup-formatter</artifactId>
      <version>1.0</version>
    </dependency>
96 97 98
    <dependency>
      <groupId>org.jenkins-ci.plugins</groupId>
      <artifactId>matrix-project</artifactId>
J
Jesse Glick 已提交
99
      <version>1.0-beta-1</version>
100
    </dependency>
101 102 103
    <dependency>
      <groupId>org.mortbay.jetty</groupId>
      <artifactId>jetty</artifactId>
104
      <version>6.1.26</version>
105
    </dependency>
106
    <dependency>
107
      <groupId>org.jenkins-ci</groupId>
108
      <artifactId>test-annotations</artifactId>
109
      <version>1.1</version>
110 111
      <scope>compile</scope>
      <!-- in this module we need this as a compile scope, whereas in the parent it's test -->
112
    </dependency>
113 114 115 116 117
    <dependency>
      <groupId>org.jvnet.mock-javamail</groupId>
      <artifactId>mock-javamail</artifactId>
      <version>1.7</version>
    </dependency>
118 119
    <dependency>
      <groupId>junit</groupId>
J
Jesse Glick 已提交
120
      <artifactId>junit</artifactId>
121 122 123 124
    </dependency>
    <dependency>
      <groupId>org.hamcrest</groupId>
      <artifactId>hamcrest-library</artifactId>
J
Jesse Glick 已提交
125
      <version>1.3</version>
126
    </dependency>
127
    <dependency>
128
      <groupId>org.jenkins-ci</groupId>
129
      <artifactId>htmlunit</artifactId>
130
      <version>2.6-jenkins-6</version>
131
      <exclusions>
132 133 134 135 136
        <exclusion>
          <!--  hides JDK DOM classes in Eclipse -->
          <groupId>xml-apis</groupId>
          <artifactId>xml-apis</artifactId>
        </exclusion>
137
      </exclusions>
138
    </dependency>
139 140 141 142 143
    <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>
K
kohsuke 已提交
144

145 146 147
    <dependency>
      <groupId>org.jvnet.hudson</groupId>
      <artifactId>embedded-rhino-debugger</artifactId>
148
      <version>1.2</version>
149
    </dependency>
150 151 152 153
    <dependency>
      <!-- for testing JNLP launch. -->
      <groupId>org.jvnet.hudson</groupId>
      <artifactId>netx</artifactId>
K
kohsuke 已提交
154
      <version>0.5-hudson-2</version>
155
    </dependency>
H
huybrechts 已提交
156 157 158 159 160
    <dependency>
      <groupId>org.easymock</groupId>
      <artifactId>easymock</artifactId>
      <version>2.4</version>
    </dependency>
161 162 163 164 165
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-core</artifactId>
      <scope>test</scope>
    </dependency>
166 167 168 169 170 171 172 173 174 175
    <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>
176 177 178 179 180
    <dependency>
      <groupId>org.codehaus.geb</groupId>
      <artifactId>geb-implicit-assertions</artifactId>
      <version>0.7.2</version>
    </dependency>
181
  </dependencies>
182

183 184 185 186 187 188 189 190 191
  <build>
    <plugins>
      <plugin>
        <groupId>org.kohsuke.stapler</groupId>
        <artifactId>maven-stapler-plugin</artifactId>
        <!-- version specified in grandparent pom -->
        <extensions>true</extensions>
      </plugin>
      <plugin>
192
        <groupId>org.apache.maven.plugins</groupId>
193 194 195
        <artifactId>maven-surefire-plugin</artifactId>
        <!-- version specified in grandparent pom -->
        <configuration>
196
          <argLine>${jacocoSurefireArgs} -Dfile.encoding=UTF-8 -Xmx256m -XX:MaxPermSize=128m</argLine>
197
          <systemPropertyVariables>
198
              <!-- use AntClassLoader that supports predictable file handle release -->
199 200 201
              <hudson.ClassicPluginStrategy.useAntClassLoader>true</hudson.ClassicPluginStrategy.useAntClassLoader>
              <hudson.maven.debug>${mavenDebug}</hudson.maven.debug>
              <buildDirectory>${project.build.directory}</buildDirectory>
202
              <ignore.random.failures>${ignore.random.failures}</ignore.random.failures>
203
          </systemPropertyVariables>
J
Jesse Glick 已提交
204 205
          <reuseForks>true</reuseForks>
          <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 228 229 230 231 232 233 234 235 236 237
          <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>
238
          <!-- Usually a dependency of ant, but some people seem to have an incomplete ant POM. See JENKINS-11416 -->
239 240 241 242 243
          <dependency>
            <groupId>org.apache.ant</groupId>
            <artifactId>ant-launcher</artifactId>
            <version>1.8.0</version>
          </dependency>
244 245 246 247 248 249

          <dependency>
            <groupId>org.codehaus.gmaven.runtime</groupId>
            <artifactId>gmaven-runtime-2.0</artifactId>
            <version>1.5-jenkins-1</version>
          </dependency>
250
        </dependencies>
251 252 253
        <configuration>
          <providerSelection>2.0</providerSelection>
        </configuration>
254 255 256 257
      </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 274 275
    <profile>
      <id>all-tests</id>
      <activation>
        <property>
          <name>!test</name>
        </property>
      </activation>
      <properties>
        <maven.test.redirectTestOutputToFile>true</maven.test.redirectTestOutputToFile>
      </properties>
    </profile>
276 277 278 279 280 281 282 283
    <profile>
      <!--
        Obtain code coverage report. This is done by running Unit tests on our own and suppressing surefire.
      -->
      <id>cobertura</id>
      <build>
        <plugins>
          <plugin>
284
            <groupId>org.codehaus.gmaven</groupId>
285
            <artifactId>gmaven-plugin</artifactId>
286
            <!-- version specified in grandparent pom -->
287 288 289 290 291 292 293 294 295
            <executions>
              <!-- run unit test -->
              <execution>
                <phase>test</phase>
                <goals>
                  <goal>execute</goal>
                </goals>
                <configuration>
                  <scriptpath>
K
kohsuke 已提交
296
                    <!-- load helpers from hg core -->
297 298 299 300 301 302 303 304 305
                    <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 已提交
306
    </profile>    
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 352
    <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>
353
  </profiles>
K
kohsuke 已提交
354
</project>