jenkins/test/pom.xml

392 lines
14 KiB
XML
Raw Normal View History

2013-03-09 03:35:38 +08:00
<?xml version="1.0" encoding="UTF-8"?>
<!--
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.
-->
<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">
<modelVersion>4.0.0</modelVersion>
<parent>
2011-01-31 05:18:06 +08:00
<groupId>org.jenkins-ci.main</groupId>
<artifactId>pom</artifactId>
<version>1.645-SNAPSHOT</version>
</parent>
2011-01-31 05:27:59 +08:00
<artifactId>jenkins-test-harness</artifactId>
2011-01-31 05:18:06 +08:00
<name>Test harness for Jenkins and plugins</name>
<description>Unit test harness (src/main) and Unit tests for Jenkins core (src/test)</description>
<properties>
2013-03-09 03:35:38 +08:00
<concurrency>2</concurrency> <!-- may use e.g. 2C for 2 × (number of cores) -->
2010-12-24 21:19:10 +08:00
<mavenDebug>false</mavenDebug>
<ignore.random.failures>false</ignore.random.failures>
2014-08-11 08:58:25 +08:00
<jacocoSurefireArgs /><!-- empty by default -->
</properties>
<dependencies>
<dependency>
<!--
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.
-->
<groupId>${project.groupId}</groupId>
2011-01-31 06:26:17 +08:00
<artifactId>jenkins-war</artifactId>
<version>${project.version}</version>
<classifier>war-for-test</classifier>
<exclusions>
<exclusion>
<groupId>org.jenkins-ci.modules</groupId>
<artifactId>sshd</artifactId>
</exclusion>
</exclusions>
</dependency>
Merged revisions 16689-16697,16701-16710,16712-16714 via svnmerge from https://www.dev.java.net/svn/hudson/branches/HUDSON-3251 ........ r16689 | kohsuke | 2009-03-29 08:52:25 -0700 (Sun, 29 Mar 2009) | 1 line [HUDSON-3251] (1/18) moving maven-related source to maven-plugin ........ r16690 | kohsuke | 2009-03-29 08:57:23 -0700 (Sun, 29 Mar 2009) | 4 lines [HUDSON-3251] (3/18) moved KeptBecauseOfParent message Note I skipped (2/18) to move the logic into MavenProject.DescriptorImpl.isApplicable. ........ r16691 | kohsuke | 2009-03-29 08:58:21 -0700 (Sun, 29 Mar 2009) | 3 lines [HUDSON-3251] (4/18) removed imports and javadoc links to Maven-related classes ........ r16692 | kohsuke | 2009-03-29 08:59:49 -0700 (Sun, 29 Mar 2009) | 2 lines [HUDSON-3251] (5/18) moving maven-related functionality to maven plugin. ........ r16693 | kohsuke | 2009-03-29 09:01:11 -0700 (Sun, 29 Mar 2009) | 5 lines [HUDSON-3251] (5/18) moving maven-related functionality to maven plugin Forgot to add a newly created file. ........ r16694 | kohsuke | 2009-03-29 09:02:24 -0700 (Sun, 29 Mar 2009) | 1 line needs a copyright header on all files in the core ........ r16695 | kohsuke | 2009-03-29 09:07:03 -0700 (Sun, 29 Mar 2009) | 1 line [HUDSON-3251] (6/18) updating poms and packaging to bundle maven plugin (with a minor adjustment to revert forkMode change) ........ r16696 | kohsuke | 2009-03-29 09:17:58 -0700 (Sun, 29 Mar 2009) | 1 line [HUDSON-3251] (6/18) updating poms and packaging to bundle maven plugin (with a minor adjustment to revert forkMode change) ........ r16697 | kohsuke | 2009-03-29 09:38:23 -0700 (Sun, 29 Mar 2009) | 2 lines [HUDSON-3251] (7/18) add a hudson.bundled.plugins property that can override the default bundled plugins. ........ r16701 | kohsuke | 2009-03-29 15:14:38 -0700 (Sun, 29 Mar 2009) | 1 line [HUDSON-3251] (8/18) finding Maven jars through reflection for now. TODO: introduce a post-initialization hook ........ r16702 | kohsuke | 2009-03-29 15:20:36 -0700 (Sun, 29 Mar 2009) | 2 lines [HUDSON-3251] (10/18) use lastModified to avoid unpacking bundled plugins unnecessarily. ........ r16703 | kohsuke | 2009-03-29 15:21:15 -0700 (Sun, 29 Mar 2009) | 1 line [HUDSON-3251] (12/18) updating poms and packaging to bundle maven plugin ........ r16704 | kohsuke | 2009-03-29 15:37:32 -0700 (Sun, 29 Mar 2009) | 1 line [HUDSON-3251] (15/18) resolve plugins from the classpath in tests. Slightly reworked. ........ r16705 | kohsuke | 2009-03-29 15:38:12 -0700 (Sun, 29 Mar 2009) | 1 line [HUDSON-3251] (16/18) update hpi plugin version ........ r16706 | kohsuke | 2009-03-29 15:38:54 -0700 (Sun, 29 Mar 2009) | 1 line [HUDSON-3251] (17/18) moved createExecutedMojoCache ........ r16707 | kohsuke | 2009-03-29 15:42:38 -0700 (Sun, 29 Mar 2009) | 3 lines [HUDSON-3251] after looking at (18/18), I think the same effect can be achieved more easily by not setting this system property at all. Or am I missing something? ........ r16708 | kohsuke | 2009-03-29 15:43:30 -0700 (Sun, 29 Mar 2009) | 1 line formatting change ........ r16709 | kohsuke | 2009-03-29 15:58:16 -0700 (Sun, 29 Mar 2009) | 1 line [HUDSON-3251] ignore certain builders and publishers in Maven2 job type. This does the same thing as (2/18) in Tom's patch, but I believe this is better. Still needs to figure out how to do this for MavenModule, which doesn't have a descriptor. ........ r16710 | kohsuke | 2009-03-29 16:01:00 -0700 (Sun, 29 Mar 2009) | 1 line ignore generated files ........ r16712 | kohsuke | 2009-03-29 16:29:05 -0700 (Sun, 29 Mar 2009) | 3 lines [HUDSON-3251] revisited patch (8/18). ComputerListener is extended to support the preOnline step, so that some operations can be carried out whose failure will result in the node failing to become online. Maven-plugin uses this now to avoid the use of reflection. ........ r16713 | kohsuke | 2009-03-29 16:38:48 -0700 (Sun, 29 Mar 2009) | 1 line switching to fork because otherwise the test fails with PermGen out of space ........ r16714 | kohsuke | 2009-03-29 16:39:36 -0700 (Sun, 29 Mar 2009) | 1 line no, the next version is 1.295. ........ git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@16734 71c3de6d-444a-0410-be80-ed276b4c234a
2009-03-31 05:55:33 +08:00
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>maven-plugin</artifactId>
<version>${maven-plugin.version}</version>
<exclusions>
<exclusion>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcore</artifactId>
</exclusion>
<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>
<exclusion>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
</exclusion>
</exclusions>
Merged revisions 16689-16697,16701-16710,16712-16714 via svnmerge from https://www.dev.java.net/svn/hudson/branches/HUDSON-3251 ........ r16689 | kohsuke | 2009-03-29 08:52:25 -0700 (Sun, 29 Mar 2009) | 1 line [HUDSON-3251] (1/18) moving maven-related source to maven-plugin ........ r16690 | kohsuke | 2009-03-29 08:57:23 -0700 (Sun, 29 Mar 2009) | 4 lines [HUDSON-3251] (3/18) moved KeptBecauseOfParent message Note I skipped (2/18) to move the logic into MavenProject.DescriptorImpl.isApplicable. ........ r16691 | kohsuke | 2009-03-29 08:58:21 -0700 (Sun, 29 Mar 2009) | 3 lines [HUDSON-3251] (4/18) removed imports and javadoc links to Maven-related classes ........ r16692 | kohsuke | 2009-03-29 08:59:49 -0700 (Sun, 29 Mar 2009) | 2 lines [HUDSON-3251] (5/18) moving maven-related functionality to maven plugin. ........ r16693 | kohsuke | 2009-03-29 09:01:11 -0700 (Sun, 29 Mar 2009) | 5 lines [HUDSON-3251] (5/18) moving maven-related functionality to maven plugin Forgot to add a newly created file. ........ r16694 | kohsuke | 2009-03-29 09:02:24 -0700 (Sun, 29 Mar 2009) | 1 line needs a copyright header on all files in the core ........ r16695 | kohsuke | 2009-03-29 09:07:03 -0700 (Sun, 29 Mar 2009) | 1 line [HUDSON-3251] (6/18) updating poms and packaging to bundle maven plugin (with a minor adjustment to revert forkMode change) ........ r16696 | kohsuke | 2009-03-29 09:17:58 -0700 (Sun, 29 Mar 2009) | 1 line [HUDSON-3251] (6/18) updating poms and packaging to bundle maven plugin (with a minor adjustment to revert forkMode change) ........ r16697 | kohsuke | 2009-03-29 09:38:23 -0700 (Sun, 29 Mar 2009) | 2 lines [HUDSON-3251] (7/18) add a hudson.bundled.plugins property that can override the default bundled plugins. ........ r16701 | kohsuke | 2009-03-29 15:14:38 -0700 (Sun, 29 Mar 2009) | 1 line [HUDSON-3251] (8/18) finding Maven jars through reflection for now. TODO: introduce a post-initialization hook ........ r16702 | kohsuke | 2009-03-29 15:20:36 -0700 (Sun, 29 Mar 2009) | 2 lines [HUDSON-3251] (10/18) use lastModified to avoid unpacking bundled plugins unnecessarily. ........ r16703 | kohsuke | 2009-03-29 15:21:15 -0700 (Sun, 29 Mar 2009) | 1 line [HUDSON-3251] (12/18) updating poms and packaging to bundle maven plugin ........ r16704 | kohsuke | 2009-03-29 15:37:32 -0700 (Sun, 29 Mar 2009) | 1 line [HUDSON-3251] (15/18) resolve plugins from the classpath in tests. Slightly reworked. ........ r16705 | kohsuke | 2009-03-29 15:38:12 -0700 (Sun, 29 Mar 2009) | 1 line [HUDSON-3251] (16/18) update hpi plugin version ........ r16706 | kohsuke | 2009-03-29 15:38:54 -0700 (Sun, 29 Mar 2009) | 1 line [HUDSON-3251] (17/18) moved createExecutedMojoCache ........ r16707 | kohsuke | 2009-03-29 15:42:38 -0700 (Sun, 29 Mar 2009) | 3 lines [HUDSON-3251] after looking at (18/18), I think the same effect can be achieved more easily by not setting this system property at all. Or am I missing something? ........ r16708 | kohsuke | 2009-03-29 15:43:30 -0700 (Sun, 29 Mar 2009) | 1 line formatting change ........ r16709 | kohsuke | 2009-03-29 15:58:16 -0700 (Sun, 29 Mar 2009) | 1 line [HUDSON-3251] ignore certain builders and publishers in Maven2 job type. This does the same thing as (2/18) in Tom's patch, but I believe this is better. Still needs to figure out how to do this for MavenModule, which doesn't have a descriptor. ........ r16710 | kohsuke | 2009-03-29 16:01:00 -0700 (Sun, 29 Mar 2009) | 1 line ignore generated files ........ r16712 | kohsuke | 2009-03-29 16:29:05 -0700 (Sun, 29 Mar 2009) | 3 lines [HUDSON-3251] revisited patch (8/18). ComputerListener is extended to support the preOnline step, so that some operations can be carried out whose failure will result in the node failing to become online. Maven-plugin uses this now to avoid the use of reflection. ........ r16713 | kohsuke | 2009-03-29 16:38:48 -0700 (Sun, 29 Mar 2009) | 1 line switching to fork because otherwise the test fails with PermGen out of space ........ r16714 | kohsuke | 2009-03-29 16:39:36 -0700 (Sun, 29 Mar 2009) | 1 line no, the next version is 1.295. ........ git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@16734 71c3de6d-444a-0410-be80-ed276b4c234a
2009-03-31 05:55:33 +08:00
</dependency>
2011-09-08 22:36:06 +08:00
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>ant</artifactId>
<version>1.2</version>
2011-09-08 22:36:06 +08:00
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>subversion</artifactId>
<version>1.45</version>
</dependency>
2012-11-22 23:07:51 +08:00
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>mailer</artifactId>
<version>1.10</version>
2012-11-22 23:07:51 +08:00
</dependency>
2013-10-05 04:27:15 +08:00
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>matrix-auth</artifactId>
2013-10-05 05:06:28 +08:00
<version>1.0.2</version>
2013-10-05 04:27:15 +08:00
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>antisamy-markup-formatter</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>matrix-project</artifactId>
<version>${matrix-project.version}</version>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>junit</artifactId>
2014-11-05 04:01:03 +08:00
<version>1.2-beta-4</version>
</dependency>
<dependency>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty</artifactId>
<version>6.1.26</version>
</dependency>
<dependency>
<groupId>org.jenkins-ci</groupId>
<artifactId>test-annotations</artifactId>
<version>${test-annotations.version}</version>
<!-- in this module we need this as a compile scope, whereas in the parent it's test -->
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.jvnet.mock-javamail</groupId>
<artifactId>mock-javamail</artifactId>
<version>1.7</version>
</dependency>
<dependency>
<groupId>junit</groupId>
2013-02-28 12:00:59 +08:00
<artifactId>junit</artifactId>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-library</artifactId>
2013-02-28 12:00:59 +08:00
<version>1.3</version>
</dependency>
<dependency>
<groupId>net.sourceforge.htmlunit</groupId>
<artifactId>htmlunit</artifactId>
2015-08-25 04:07:42 +08:00
<version>2.18</version>
<exclusions>
<exclusion>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
</exclusion>
</exclusions>
</dependency>
<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>
<dependency>
<groupId>org.jvnet.hudson</groupId>
<artifactId>embedded-rhino-debugger</artifactId>
<version>1.2</version>
<exclusions>
<exclusion>
<groupId>org.jvnet.hudson</groupId>
<artifactId>htmlunit-core-js</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<!-- for testing JNLP launch. -->
<groupId>org.jvnet.hudson</groupId>
<artifactId>netx</artifactId>
<version>0.5-hudson-2</version>
</dependency>
<dependency>
<groupId>org.easymock</groupId>
<artifactId>easymock</artifactId>
<version>2.4</version>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
<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>
<dependency>
<groupId>org.codehaus.geb</groupId>
<artifactId>geb-implicit-assertions</artifactId>
<version>0.7.2</version>
</dependency>
2015-11-08 12:07:42 +08:00
<dependency>
<groupId>org.javassist</groupId>
<artifactId>javassist</artifactId>
<version>3.19.0-GA</version>
2015-11-10 22:22:22 +08:00
<scope>test</scope>
2015-11-08 12:07:42 +08:00
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-collections4</artifactId>
<version>4.0</version>
2015-11-10 22:22:22 +08:00
<scope>test</scope>
2015-11-08 12:07:42 +08:00
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.kohsuke.stapler</groupId>
<artifactId>maven-stapler-plugin</artifactId>
<!-- version specified in grandparent pom -->
<extensions>true</extensions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<!-- version specified in grandparent pom -->
<configuration>
<argLine>${jacocoSurefireArgs} -Dfile.encoding=UTF-8 -Xmx256m -XX:MaxPermSize=128m</argLine>
<systemPropertyVariables>
<!-- use AntClassLoader that supports predictable file handle release -->
<hudson.ClassicPluginStrategy.useAntClassLoader>true</hudson.ClassicPluginStrategy.useAntClassLoader>
<hudson.maven.debug>${mavenDebug}</hudson.maven.debug>
<buildDirectory>${project.build.directory}</buildDirectory>
<ignore.random.failures>${ignore.random.failures}</ignore.random.failures>
</systemPropertyVariables>
2013-03-09 03:35:38 +08:00
<reuseForks>true</reuseForks>
<forkCount>${concurrency}</forkCount>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.gmaven</groupId>
<artifactId>gmaven-plugin</artifactId>
<!-- version specified in grandparent pom -->
<executions>
<execution>
Fixing a test failure in RelativePathTest It turns out that Groovy compiler we use to compile src/test/groovy was not properly generating the 'enclosing class' information inside *.class, which was causing the load failure of the descriptors marked by @TestExtension in test code. To fix this and forestall other possible GMaven related issues, I decided to bump up the GMaven version. As it turns out, Codehaus GMaven had ceased the development of the 1.x branch, so I initially tried 2.x release line. The 2.x release line got rid of the stub generation functionality, which we badly need for annotation processing. It instead recommend using Eclipse compiler to jointly compile Java and Groovy source code together, but when I tried to compile our tests, it failed to properly handle nested classes. The compiler quality appears quite premature. I was then going back to GMaven 1.5, the last 1.x release. I took this opportunity to rebase my local patches in org.kohsuke.gmaven to the latest release, which in my mind gets justified now that the upstream has ceased the development. My local patch to GMaven is captured in GMAVEN-3 and GMAVEN-4 (see http://jira.codehaus.org/browse/GMAVEN-3 and http://jira.codehaus.org/browse/GMAVEN-4). GMAVEN-4 is claimed to be fixed, but when I tried to compile our source tree I discovered that its handling of nested types breaks the generated stub code. In the end, I managed to patch gmaven and posted 1.5-jenkins-1. The bottom line is, we can now use @TestExtension correctly with Groovy tests. Also on the upside, we can get rid of org.kohsuke.gmaven and avoid the current confusion situation of using two GMaven plugins. I'll make a follow-up change to remove org.kohsuke.gmaven from elsewhere in our POM.
2013-07-18 07:31:52 +08:00
<id>default</id>
<!-- compile and process annotations in Groovy test code -->
<goals>
<goal>generateTestStubs</goal>
<goal>testCompile</goal>
</goals>
</execution>
<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>
<!-- Usually a dependency of ant, but some people seem to have an incomplete ant POM. See JENKINS-11416 -->
<dependency>
<groupId>org.apache.ant</groupId>
<artifactId>ant-launcher</artifactId>
<version>1.8.0</version>
</dependency>
Fixing a test failure in RelativePathTest It turns out that Groovy compiler we use to compile src/test/groovy was not properly generating the 'enclosing class' information inside *.class, which was causing the load failure of the descriptors marked by @TestExtension in test code. To fix this and forestall other possible GMaven related issues, I decided to bump up the GMaven version. As it turns out, Codehaus GMaven had ceased the development of the 1.x branch, so I initially tried 2.x release line. The 2.x release line got rid of the stub generation functionality, which we badly need for annotation processing. It instead recommend using Eclipse compiler to jointly compile Java and Groovy source code together, but when I tried to compile our tests, it failed to properly handle nested classes. The compiler quality appears quite premature. I was then going back to GMaven 1.5, the last 1.x release. I took this opportunity to rebase my local patches in org.kohsuke.gmaven to the latest release, which in my mind gets justified now that the upstream has ceased the development. My local patch to GMaven is captured in GMAVEN-3 and GMAVEN-4 (see http://jira.codehaus.org/browse/GMAVEN-3 and http://jira.codehaus.org/browse/GMAVEN-4). GMAVEN-4 is claimed to be fixed, but when I tried to compile our source tree I discovered that its handling of nested types breaks the generated stub code. In the end, I managed to patch gmaven and posted 1.5-jenkins-1. The bottom line is, we can now use @TestExtension correctly with Groovy tests. Also on the upside, we can get rid of org.kohsuke.gmaven and avoid the current confusion situation of using two GMaven plugins. I'll make a follow-up change to remove org.kohsuke.gmaven from elsewhere in our POM.
2013-07-18 07:31:52 +08:00
<dependency>
<groupId>org.codehaus.gmaven.runtime</groupId>
<artifactId>gmaven-runtime-2.0</artifactId>
<version>1.5-jenkins-1</version>
</dependency>
</dependencies>
Fixing a test failure in RelativePathTest It turns out that Groovy compiler we use to compile src/test/groovy was not properly generating the 'enclosing class' information inside *.class, which was causing the load failure of the descriptors marked by @TestExtension in test code. To fix this and forestall other possible GMaven related issues, I decided to bump up the GMaven version. As it turns out, Codehaus GMaven had ceased the development of the 1.x branch, so I initially tried 2.x release line. The 2.x release line got rid of the stub generation functionality, which we badly need for annotation processing. It instead recommend using Eclipse compiler to jointly compile Java and Groovy source code together, but when I tried to compile our tests, it failed to properly handle nested classes. The compiler quality appears quite premature. I was then going back to GMaven 1.5, the last 1.x release. I took this opportunity to rebase my local patches in org.kohsuke.gmaven to the latest release, which in my mind gets justified now that the upstream has ceased the development. My local patch to GMaven is captured in GMAVEN-3 and GMAVEN-4 (see http://jira.codehaus.org/browse/GMAVEN-3 and http://jira.codehaus.org/browse/GMAVEN-4). GMAVEN-4 is claimed to be fixed, but when I tried to compile our source tree I discovered that its handling of nested types breaks the generated stub code. In the end, I managed to patch gmaven and posted 1.5-jenkins-1. The bottom line is, we can now use @TestExtension correctly with Groovy tests. Also on the upside, we can get rid of org.kohsuke.gmaven and avoid the current confusion situation of using two GMaven plugins. I'll make a follow-up change to remove org.kohsuke.gmaven from elsewhere in our POM.
2013-07-18 07:31:52 +08:00
<configuration>
<providerSelection>2.0</providerSelection>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>light-test</id>
<properties>
<skipTests>true</skipTests>
</properties>
</profile>
<profile>
<id>all-tests</id>
<activation>
<property>
<name>!test</name>
</property>
</activation>
<properties>
<maven.test.redirectTestOutputToFile>true</maven.test.redirectTestOutputToFile>
</properties>
</profile>
<profile>
<!-- Obtain code coverage report. This is done by running Unit tests on our own and suppressing surefire. -->
<id>cobertura</id>
<build>
<plugins>
<plugin>
Fixing a test failure in RelativePathTest It turns out that Groovy compiler we use to compile src/test/groovy was not properly generating the 'enclosing class' information inside *.class, which was causing the load failure of the descriptors marked by @TestExtension in test code. To fix this and forestall other possible GMaven related issues, I decided to bump up the GMaven version. As it turns out, Codehaus GMaven had ceased the development of the 1.x branch, so I initially tried 2.x release line. The 2.x release line got rid of the stub generation functionality, which we badly need for annotation processing. It instead recommend using Eclipse compiler to jointly compile Java and Groovy source code together, but when I tried to compile our tests, it failed to properly handle nested classes. The compiler quality appears quite premature. I was then going back to GMaven 1.5, the last 1.x release. I took this opportunity to rebase my local patches in org.kohsuke.gmaven to the latest release, which in my mind gets justified now that the upstream has ceased the development. My local patch to GMaven is captured in GMAVEN-3 and GMAVEN-4 (see http://jira.codehaus.org/browse/GMAVEN-3 and http://jira.codehaus.org/browse/GMAVEN-4). GMAVEN-4 is claimed to be fixed, but when I tried to compile our source tree I discovered that its handling of nested types breaks the generated stub code. In the end, I managed to patch gmaven and posted 1.5-jenkins-1. The bottom line is, we can now use @TestExtension correctly with Groovy tests. Also on the upside, we can get rid of org.kohsuke.gmaven and avoid the current confusion situation of using two GMaven plugins. I'll make a follow-up change to remove org.kohsuke.gmaven from elsewhere in our POM.
2013-07-18 07:31:52 +08:00
<groupId>org.codehaus.gmaven</groupId>
<artifactId>gmaven-plugin</artifactId>
<!-- version specified in grandparent pom -->
<executions>
<!-- run unit test -->
<execution>
<phase>test</phase>
<goals>
<goal>execute</goal>
</goals>
<configuration>
<scriptpath>
<!-- load helpers from hg core -->
<element>${project.basedir}/../core/src/build-script</element>
</scriptpath>
<source>${project.basedir}/src/build-script/unitTest.groovy</source>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
2011-03-11 04:29:16 +08:00
</profile>
<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>
</profiles>
</project>