pom.xml 13.1 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>
J
Jesse Glick 已提交
7
    <version>1.30</version>
8
    <relativePath />
9 10
  </parent>

11
  <groupId>org.jenkins-ci.plugins</groupId>
12
  <artifactId>plugin</artifactId>
13
  <name>Jenkins plugin POM</name>
14
  <version>1.506-SNAPSHOT</version>
15 16 17 18 19 20 21
  <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 已提交
22 23 24
    <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>
25 26 27 28
  </scm>

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

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

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

K
Kohsuke Kawaguchi 已提交
71
      plugin -(provided)-> jenkins-core -(compile)-> stapler -(provided)-> servlet-api
72 73 74 75 76 77 78 79 80 81 82 83

      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>
84 85 86 87
    <dependency>
      <!-- for JRE requirement check annotation -->
      <groupId>org.codehaus.mojo</groupId>
      <artifactId>animal-sniffer-annotations</artifactId>
88
      <version>1.9</version>
89 90 91
      <scope>provided</scope>
      <optional>true</optional><!-- no need to have this at runtime -->
    </dependency>
92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109
  </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 已提交
110
        <groupId>org.jenkins-ci.tools</groupId>
111 112 113 114
        <artifactId>maven-hpi-plugin</artifactId>
        <extensions>true</extensions>
        <configuration>
          <showDeprecation>true</showDeprecation>
115
          <contextPath>/jenkins</contextPath>
116 117 118 119 120
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.kohsuke.stapler</groupId>
        <artifactId>maven-stapler-plugin</artifactId>
121
        <!-- version specified in parent pom -->
122 123 124 125
        <extensions>true</extensions>
      </plugin>
      <plugin>
        <artifactId>maven-release-plugin</artifactId>
126
        <!-- version specified in parent pom -->
127
        <configuration>
128
          <goals>deploy</goals>
129 130 131 132 133
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.jvnet.localizer</groupId>
        <artifactId>maven-localizer-plugin</artifactId>
134
        <!-- version specified in parent pom -->
135 136 137 138 139 140 141 142 143 144 145 146 147 148
        <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>
149
        <!-- version specified in parent pom -->
150 151
      </plugin>
      <plugin>
K
Kohsuke Kawaguchi 已提交
152
        <groupId>org.codehaus.gmaven</groupId>
153
        <artifactId>gmaven-plugin</artifactId>
154
        <!-- version specified in grandparent pom -->
155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174
        <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>
175
        <!-- version specified in grandparent pom -->
176 177 178 179 180 181 182 183 184
        <configuration>
          <systemProperties>
            <property>
              <name>hudson.udp</name>
              <value>33849</value>
            </property>
          </systemProperties>
        </configuration>
      </plugin>
185 186 187
      <plugin>
        <groupId>com.cloudbees</groupId>
        <artifactId>maven-license-plugin</artifactId>
188
        <!-- version specified in grandparent pom -->
189 190 191 192 193
        <executions>
          <execution>
            <goals>
              <goal>process</goal>
            </goals>
194
            <phase>prepare-package</phase>
195 196 197 198 199 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
            <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>
229
    </plugins>
230 231 232 233 234 235 236 237 238 239 240
    <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>
241 242 243 244
            <additionalProjectnatures>
              <!-- enable Groovy nature by default for DSLD support  -->
              <projectnature>org.eclipse.jdt.groovy.core.groovyNature</projectnature>
            </additionalProjectnatures>
245 246
          </configuration>
        </plugin>
247 248 249 250 251 252 253 254 255
        <!--
            This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.
            the plugins mention here are the ones we do not have direct control over, but are used for a jenkins plugin - all other
            will be changed to in there source to support eclipse soon (hpi, license, localizer, access-modifier). 
            see also: http://wiki.eclipse.org/M2E_compatible_maven_plugins
        -->
        <plugin>
            <groupId>org.eclipse.m2e</groupId>
            <artifactId>lifecycle-mapping</artifactId>
I
imod 已提交
256
            <version>1.0.0</version>
257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276
            <configuration>
                <lifecycleMappingMetadata>
                    <pluginExecutions>
                        <pluginExecution>
                            <pluginExecutionFilter>
                                <groupId>org.apache.maven.plugins</groupId>
                                <artifactId>maven-enforcer-plugin</artifactId>
                                <versionRange>[1.0,)</versionRange>
                                <goals>
                                    <goal>display-info</goal>
                                </goals>
                            </pluginExecutionFilter>
                            <action>
                                <ignore />
                            </action>
                        </pluginExecution>
                        <pluginExecution>
                            <pluginExecutionFilter>
                                <groupId>org.codehaus.gmaven</groupId>
                                <artifactId>gmaven-plugin</artifactId>
277
                                <versionRange>[1.0,)</versionRange>
278 279 280 281 282 283 284 285 286 287 288 289 290
                                <goals>
                                    <goal>testCompile</goal>
                                    <goal>generateTestStubs</goal>
                                </goals>
                            </pluginExecutionFilter>
                            <action>
                                <ignore />
                            </action>
                        </pluginExecution>
                    </pluginExecutions>
                </lifecycleMappingMetadata>
            </configuration>
        </plugin>        
291 292 293 294
        <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>
295
          <version>1.9</version>
296 297 298 299 300 301 302 303
          <executions>
            <execution>
              <goals>
                <goal>check</goal>
              </goals>
              <phase>test</phase>
            </execution>
          </executions>
304 305 306 307 308 309 310 311
          <configuration>
            <!-- outside <execution> so that we can run 'animal-sniffer:check' from the top without breaking anything  -->
            <signature>
              <groupId>org.codehaus.mojo.signature</groupId>
              <artifactId>java15</artifactId>
              <version>1.0</version>
            </signature>
          </configuration>
312
        </plugin>
313 314
      </plugins>
    </pluginManagement>
315 316 317 318 319 320 321
    <extensions>
      <extension>
        <groupId>org.kohsuke</groupId>
        <artifactId>wagon-gitsite</artifactId>
        <version>0.3.5</version>
      </extension>
    </extensions>
322 323 324 325
  </build>

  <repositories>
    <repository>
326 327
      <id>repo.jenkins-ci.org</id>
      <url>http://repo.jenkins-ci.org/public/</url>
328 329 330 331 332 333 334 335 336 337 338
      <releases>
        <enabled>true</enabled>
      </releases>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
    </repository>
  </repositories>

  <pluginRepositories>
    <pluginRepository>
339 340
      <id>repo.jenkins-ci.org</id>
      <url>http://repo.jenkins-ci.org/public/</url>
341 342 343 344 345 346 347 348 349
      <releases>
        <enabled>true</enabled>
      </releases>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
    </pluginRepository>
  </pluginRepositories>

350
  <distributionManagement>
351 352 353 354
    <site>
      <id>github-pages</id>
      <url>gitsite:git@github.com/jenkinsci/maven-site.git:plugin-parent</url>
    </site>
355
    <snapshotRepository>
356
      <id>maven.jenkins-ci.org</id>
K
Kohsuke Kawaguchi 已提交
357
      <url>http://maven.jenkins-ci.org:8081/content/repositories/snapshots</url>
358 359
    </snapshotRepository>
  </distributionManagement>
360
</project>