pom.xml 10.6 KB
Newer Older
1 2 3 4
<?xml version="1.0" encoding="UTF-8"?>
<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>
5
    <groupId>org.jenkins-ci</groupId>
K
Kohsuke Kawaguchi 已提交
6
    <artifactId>jenkins</artifactId>
7
    <version>1.26</version>
8 9
  </parent>

10
  <groupId>org.jenkins-ci.plugins</groupId>
11
  <artifactId>plugin</artifactId>
12
  <name>Jenkins plugin POM</name>
13
  <version>1.473-SNAPSHOT</version>
14 15 16 17 18 19 20
  <packaging>pom</packaging>

  <!--
    We need the following because the artifactId=plugin but directoryName=plugins, and
    Maven infers the wrong value if I don't specify it explicitly.
  -->
  <scm>
K
Kohsuke Kawaguchi 已提交
21 22 23
    <connection>scm:svn:https://svn.jenkins-ci.org/trunk/hudson/plugins/</connection>
    <developerConnection>scm:svn:https://svn.jenkins-ci.org/trunk/hudson/plugins/</developerConnection>
    <url>https://svn.jenkins-ci.org/trunk/hudson/plugins/</url>
24 25 26 27
  </scm>

  <issueManagement>
    <system>JIRA</system>
K
Kohsuke Kawaguchi 已提交
28
    <url>http://issues.jenkins-ci.org/</url>
29 30 31 32 33
  </issueManagement>

  <dependencyManagement>
    <dependencies>
      <dependency><!-- if a plugin wants to depend on the maven plugin, choose the right version automatically -->
34
        <groupId>org.jenkins-ci.main</groupId>
35
        <artifactId>maven-plugin</artifactId>
36
        <version>1.473-SNAPSHOT</version>
37 38 39 40 41 42
      </dependency>
    </dependencies>
  </dependencyManagement>

  <dependencies>
    <dependency>
43
      <groupId>org.jenkins-ci.main</groupId>
K
Kohsuke Kawaguchi 已提交
44
      <artifactId>jenkins-war</artifactId>
45
      <type>war</type>
46
      <version>1.473-SNAPSHOT</version>
47 48 49
      <scope>test</scope>
    </dependency>
    <dependency>
50
      <groupId>org.jenkins-ci.main</groupId>
K
Kohsuke Kawaguchi 已提交
51
      <artifactId>jenkins-core</artifactId>
52
      <version>1.473-SNAPSHOT</version>
53 54 55
      <scope>provided</scope>
    </dependency>
    <dependency>
56
      <groupId>org.jenkins-ci.main</groupId>
K
Kohsuke Kawaguchi 已提交
57
      <artifactId>jenkins-test-harness</artifactId>
58
      <version>1.473-SNAPSHOT</version>
59 60 61
      <scope>test</scope>
    </dependency>
    <dependency>
62
      <groupId>org.jenkins-ci.main</groupId>
63
      <artifactId>ui-samples-plugin</artifactId>
64
      <version>1.473-SNAPSHOT</version>
65 66 67 68
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
69
      <artifactId>junit-dep</artifactId>
70
      <version>4.10</version>
71 72 73 74 75
      <scope>test</scope>
    </dependency>
    <!--
      Maven is so brain-dead that when a dependency is like:

K
Kohsuke Kawaguchi 已提交
76
      plugin -(provided)-> jenkins-core -(compile)-> stapler -(provided)-> servlet-api
77 78 79 80 81 82 83 84 85 86 87 88

      Artifacts beyond the provided/provided dependency will not be made available to the plugin.
      See this in DefaultArtifactFactory.createArtifact() in the maven-artifact module.

      So for us to have servlet API in the classpath, we need to explicitly list servlet-api.
    -->
    <dependency>
      <groupId>javax.servlet</groupId>
      <artifactId>servlet-api</artifactId>
      <version>2.4</version>
      <scope>provided</scope>
    </dependency>
89 90 91 92 93 94 95 96
    <dependency>
      <!-- for JRE requirement check annotation -->
      <groupId>org.codehaus.mojo</groupId>
      <artifactId>animal-sniffer-annotations</artifactId>
      <version>1.7</version>
      <scope>provided</scope>
      <optional>true</optional><!-- no need to have this at runtime -->
    </dependency>
97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114
  </dependencies>

  <build>
    <!--
      Since new versions need to overwrite old versions, it's better
      not to have version number in the .hpi file name.
    -->
    <finalName>${project.artifactId}</finalName>
    <!--
      I don't really understand how this works, but it makes Maven recognizes
      <packaging>hpi</packaging> defined in maven-hpi-plugin.

      <extensions>true</extensions> is apparently needed to have Maven read
      the plugin's Plexus component file.
    -->
    <defaultGoal>package</defaultGoal>
    <plugins>
      <plugin>
K
Kohsuke Kawaguchi 已提交
115
        <groupId>org.jenkins-ci.tools</groupId>
116
        <artifactId>maven-hpi-plugin</artifactId>
117
        <version>1.74</version>
118 119 120 121 122 123 124 125
        <extensions>true</extensions>
        <configuration>
          <showDeprecation>true</showDeprecation>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.kohsuke.stapler</groupId>
        <artifactId>maven-stapler-plugin</artifactId>
126
        <!-- version specified in parent pom -->
127 128 129 130
        <extensions>true</extensions>
      </plugin>
      <plugin>
        <artifactId>maven-release-plugin</artifactId>
131
        <!-- version specified in parent pom -->
132
        <configuration>
133
          <goals>deploy</goals>
134 135 136 137 138
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.jvnet.localizer</groupId>
        <artifactId>maven-localizer-plugin</artifactId>
139
        <!-- version specified in parent pom -->
140 141 142 143 144 145 146 147 148 149 150 151 152 153
        <executions>
          <execution>
            <goals>
              <goal>generate</goal>
            </goals>
            <configuration>
              <fileMask>Messages.properties</fileMask>
              <outputDirectory>target/generated-sources/localizer</outputDirectory>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-javadoc-plugin</artifactId>
154
        <!-- version specified in parent pom -->
155 156
      </plugin>
      <plugin>
K
Kohsuke Kawaguchi 已提交
157
        <groupId>org.codehaus.gmaven</groupId>
158
        <artifactId>gmaven-plugin</artifactId>
159
        <!-- version specified in grandparent pom -->
160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179
        <executions>
          <execution>
            <id>test-in-groovy</id>
            <!-- allow tests written in Groovy -->
            <goals>
              <goal>generateTestStubs</goal>
              <goal>testCompile</goal>
            </goals>
          </execution>
        </executions>
        <dependencies>
          <dependency>
            <groupId>ant</groupId>
            <artifactId>ant</artifactId>
            <version>1.6.5</version>
          </dependency>
        </dependencies>
      </plugin>
      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
180
        <!-- version specified in grandparent pom -->
181 182 183 184 185 186 187 188 189
        <configuration>
          <systemProperties>
            <property>
              <name>hudson.udp</name>
              <value>33849</value>
            </property>
          </systemProperties>
        </configuration>
      </plugin>
190 191 192
      <plugin>
        <groupId>com.cloudbees</groupId>
        <artifactId>maven-license-plugin</artifactId>
193
        <!-- version specified in grandparent pom -->
194 195 196 197 198
        <executions>
          <execution>
            <goals>
              <goal>process</goal>
            </goals>
199
            <phase>prepare-package</phase>
200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233
            <configuration>
              <!--requireCompleteLicenseInfo>true</requireCompleteLicenseInfo-->
              <generateLicenseXml>target/${project.artifactId}/WEB-INF/licenses.xml</generateLicenseXml>
              <inlineScript><![CDATA[
                filter {
                    def plugins = [] as Set
                    
                    // collect all Jenkins plugins
                    models.entrySet().each { e ->
                        if (e.value.packaging=="hpi")
                            plugins.add(e.key.id)
                    }
                    
                    // filter out dependencies that don't belong to this plugin
                    models.entrySet().removeAll(models.entrySet().findAll { e ->
                        def a = e.key;
                        
                        if (a.dependencyTrail.size()>0 && plugins.contains(a.dependencyTrail[1]))
                            return true; // ignore transitive dependencies through other plugins

                        // if the dependency goes through jenkins core, we don't need to bundle it in the war
                        // because jenkins-core comes in the <provided> scope, I think this is a bug in Maven that it puts such
                        // dependencies into the artifact list.
                        if (a.dependencyTrail.find { trail -> trail.contains(":hudson-core:") || trail.contains(":jenkins-core:") })
                            return true;
                            
                        return false;
                    })
                }              
              ]]></inlineScript>
            </configuration>
          </execution>
        </executions>
      </plugin>
234
    </plugins>
235 236 237 238 239 240 241 242 243 244 245
    <pluginManagement>
      <plugins>
        <plugin>
          <!--
            Because Eclipse lacks JSR-269 support, put the output
            to a different directory
          -->
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-eclipse-plugin</artifactId>
          <configuration>
            <buildOutputDirectory>target/eclipse-classes</buildOutputDirectory>
246 247 248 249
            <additionalProjectnatures>
              <!-- enable Groovy nature by default for DSLD support  -->
              <projectnature>org.eclipse.jdt.groovy.core.groovyNature</projectnature>
            </additionalProjectnatures>
250 251
          </configuration>
        </plugin>
252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272
        <plugin>
          <!-- make sure our code doesn't have 1.6 dependencies except where we know it -->
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>animal-sniffer-maven-plugin</artifactId>
          <version>1.7</version>
          <executions>
            <execution>
              <goals>
                <goal>check</goal>
              </goals>
              <phase>test</phase>
              <configuration>
                <signature>
                  <groupId>org.codehaus.mojo.signature</groupId>
                  <artifactId>java15</artifactId>
                  <version>1.0</version>
                </signature>
              </configuration>
            </execution>
          </executions>
        </plugin>
273 274
      </plugins>
    </pluginManagement>
275 276 277 278
  </build>

  <repositories>
    <repository>
279 280
      <id>repo.jenkins-ci.org</id>
      <url>http://repo.jenkins-ci.org/public/</url>
281 282 283 284 285 286 287 288 289 290 291
      <releases>
        <enabled>true</enabled>
      </releases>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
    </repository>
  </repositories>

  <pluginRepositories>
    <pluginRepository>
292 293
      <id>repo.jenkins-ci.org</id>
      <url>http://repo.jenkins-ci.org/public/</url>
294 295 296 297 298 299 300 301 302
      <releases>
        <enabled>true</enabled>
      </releases>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
    </pluginRepository>
  </pluginRepositories>

303 304
  <distributionManagement>
    <snapshotRepository>
305
      <id>maven.jenkins-ci.org</id>
K
Kohsuke Kawaguchi 已提交
306
      <url>http://maven.jenkins-ci.org:8081/content/repositories/snapshots</url>
307 308
    </snapshotRepository>
  </distributionManagement>
309
</project>