pom.xml 11.4 KB
Newer Older
1
<?xml version="1.0"?>
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.488-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>
43
    <concurrency>2</concurrency> <!-- -1 means # of processors in the system -->
S
Seiji Sogabe 已提交
44
    <mavenDebug>false</mavenDebug>
45 46
  </properties>

47 48
  <dependencies>
    <dependency>
49 50 51 52
      <!--
        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.
      -->
53
      <groupId>${project.groupId}</groupId>
K
Kohsuke Kawaguchi 已提交
54
      <artifactId>jenkins-war</artifactId>
55
      <version>${project.version}</version>
56
      <classifier>war-for-test</classifier>
57 58 59 60 61 62
      <exclusions>
        <exclusion>
          <groupId>org.jenkins-ci.modules</groupId>
          <artifactId>sshd</artifactId>
        </exclusion>
      </exclusions>
63
    </dependency>
64 65 66 67 68
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>maven-plugin</artifactId>
      <version>${project.version}</version>
    </dependency>
69 70 71
    <dependency>
      <groupId>org.jenkins-ci.plugins</groupId>
      <artifactId>ant</artifactId>
K
Kohsuke Kawaguchi 已提交
72
      <version>1.1</version>
73
    </dependency>
74
    <dependency>
75
      <groupId>org.jenkins-ci.plugins</groupId>
76
      <artifactId>subversion</artifactId>
77
      <version>1.26</version>
78
    </dependency>
79 80 81
    <dependency>
      <groupId>org.mortbay.jetty</groupId>
      <artifactId>jetty</artifactId>
82
      <version>6.1.26</version>
83
    </dependency>
84 85 86 87
    <dependency>
      <groupId>org.jvnet.hudson</groupId>
      <artifactId>test-annotations</artifactId>
      <version>1.0</version>
88 89
      <scope>compile</scope>
      <!-- in this module we need this as a compile scope, whereas in the parent it's test -->
90
    </dependency>
91 92 93 94 95
    <dependency>
      <groupId>org.jvnet.mock-javamail</groupId>
      <artifactId>mock-javamail</artifactId>
      <version>1.7</version>
    </dependency>
96 97
    <dependency>
      <groupId>junit</groupId>
98 99 100 101 102
      <artifactId>junit-dep</artifactId>
    </dependency>
    <dependency>
      <groupId>org.hamcrest</groupId>
      <artifactId>hamcrest-library</artifactId>
103
    </dependency>
104
    <dependency>
105
      <groupId>org.jenkins-ci</groupId>
106
      <artifactId>htmlunit</artifactId>
107
      <version>2.6-jenkins-6</version>
108
      <exclusions>
109 110 111 112 113
        <exclusion>
          <!--  hides JDK DOM classes in Eclipse -->
          <groupId>xml-apis</groupId>
          <artifactId>xml-apis</artifactId>
        </exclusion>
114
      </exclusions>
115
    </dependency>
116 117 118 119 120
    <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 已提交
121

122 123 124
    <dependency>
      <groupId>org.jvnet.hudson</groupId>
      <artifactId>embedded-rhino-debugger</artifactId>
125
      <version>1.2</version>
126
    </dependency>
127 128 129 130
    <dependency>
      <!-- for testing JNLP launch. -->
      <groupId>org.jvnet.hudson</groupId>
      <artifactId>netx</artifactId>
K
kohsuke 已提交
131
      <version>0.5-hudson-2</version>
132
    </dependency>
H
huybrechts 已提交
133 134 135 136 137
    <dependency>
      <groupId>org.easymock</groupId>
      <artifactId>easymock</artifactId>
      <version>2.4</version>
    </dependency>
138 139 140 141 142
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-core</artifactId>
      <scope>test</scope>
    </dependency>
143
  </dependencies>
144

145 146
  <build>
    <plugins>
147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <executions>
          <execution>
            <phase>generate-sources</phase>
            <goals>
              <goal>add-test-source</goal>
            </goals>
            <configuration>
              <sources>
                <source>${project.basedir}/src/test/junit4</source>
              </sources>
            </configuration>
          </execution>
        </executions>
      </plugin>
164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206
      <plugin>
        <groupId>org.kohsuke.stapler</groupId>
        <artifactId>maven-stapler-plugin</artifactId>
        <!-- version specified in grandparent pom -->
        <extensions>true</extensions>
      </plugin>
      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <!-- version specified in grandparent pom -->
        <configuration>
          <skip>true</skip>
          <!-- tests now run by maven-junit-plugin -->
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.kohsuke.gmaven</groupId>
        <artifactId>gmaven-plugin</artifactId>
        <!-- version specified in grandparent pom -->
        <executions>
          <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>
          <execution>
            <id>test-in-groovy</id>
            <!-- allow tests written in Groovy -->
            <goals>
              <goal>testCompile</goal>
            </goals>
          </execution>
        </executions>
        <dependencies>
          <dependency>
            <groupId>org.apache.ant</groupId>
            <artifactId>ant</artifactId>
            <version>1.8.0</version>
          </dependency>
207
          <!-- Usually a dependency of ant, but some people seem to have an incomplete ant POM. See JENKINS-11416 -->
208 209 210 211 212
          <dependency>
            <groupId>org.apache.ant</groupId>
            <artifactId>ant-launcher</artifactId>
            <version>1.8.0</version>
          </dependency>
213 214 215 216 217
        </dependencies>
      </plugin>
    </plugins>
  </build>

218
  <profiles>
219 220 221

    <profile>
      <id>run-test-harness</id>
222 223 224 225 226
      <activation>
        <property>
          <name>!skip-test-harness</name>
        </property>
      </activation>
227 228
      <build>
        <plugins>
229 230 231 232 233 234 235 236
          <plugin>
            <!-- JUnit4 test is failed with maven-junit-plugin-->
            <artifactId>maven-surefire-plugin</artifactId>
            <!-- version specified in grandparent pom -->
            <configuration>
              <skip>false</skip>
              <includes>
                <include>**/UseRecipesWithJenkinsRuleTest.java</include>
237
                <include>hudson/model/CauseTest.java</include>
238
                <include>hudson/model/UpdateSiteTest.java</include>
239
                <include>hudson/triggers/TriggerStartTest.java</include>
240 241 242
              </includes>
            </configuration>
          </plugin>
243 244 245 246
          <plugin>
            <!-- see http://maven-junit-plugin.kenai.com/ for more info -->
            <groupId>org.kohsuke</groupId>
            <artifactId>maven-junit-plugin</artifactId>
247
            <!-- version specified in grandparent pom -->
248 249 250 251 252 253 254 255
            <executions>
              <execution>
                <goals>
                  <goal>test</goal>
                </goals>
                <configuration>
                  <fork>true</fork>
                  <concurrency>${concurrency}</concurrency>
256
                  <argLine>-Dfile.encoding=UTF-8 -XX:MaxPermSize=128m</argLine>
257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275
                  <timeout>300</timeout>
                  <systemProperties>
                    <property>
                      <!-- use AntClassLoader that supports predictable file handle release -->
                      <name>hudson.ClassicPluginStrategy.useAntClassLoader</name>
                      <value>true</value>
                    </property>
                    <property>
                      <name>hudson.maven.debug</name>
                      <value>${mavenDebug}</value>
                    </property>
                    <property>
                      <name>java.io.tmpdir</name>
                      <value>${project.build.directory}</value>
                    </property>
                    <property>
                      <name>buildDirectory</name>
                      <value>${project.build.directory}</value>
                    </property>
276 277 278 279
                    <property>
                      <name>java.awt.headless</name>
                      <value>true</value>
                    </property>
280
                  </systemProperties>
281 282
                  <excludes>
                    <exclude>org/jvnet/hudson/main/UseRecipesWithJenkinsRuleTest.class</exclude>
283
                    <exclude>hudson/model/CauseTest.class</exclude>
284
                    <exclude>hudson/model/UpdateSiteTest.class</exclude>
285
                    <exclude>hudson/triggers/TriggerStartTest.class</exclude>
286
                  </excludes>
287 288 289 290 291 292 293 294 295
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>

    </profile>

296 297 298
    <profile>
      <id>light-test</id>
      <properties>
299
        <skipTests>true</skipTests>
300 301
      </properties>
    </profile>
302 303 304 305 306 307 308 309 310 311
    <profile>
      <!--
        Obtain code coverage report. This is done by running Unit tests on our own and suppressing surefire.
      -->
      <id>cobertura</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.kohsuke.gmaven</groupId>
            <artifactId>gmaven-plugin</artifactId>
312
            <!-- version specified in grandparent pom -->
313 314 315 316 317 318 319 320 321
            <executions>
              <!-- run unit test -->
              <execution>
                <phase>test</phase>
                <goals>
                  <goal>execute</goal>
                </goals>
                <configuration>
                  <scriptpath>
K
kohsuke 已提交
322
                    <!-- load helpers from hg core -->
323 324 325 326 327 328 329 330 331
                    <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 已提交
332
    </profile>    
333
  </profiles>
K
kohsuke 已提交
334
</project>