pom.xml 9.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>
U
Ulli Hafner 已提交
7
    <version>1.23</version>
8 9
  </parent>

10
  <groupId>org.jenkins-ci.plugins</groupId>
11
  <artifactId>plugin</artifactId>
12
  <name>Jenkins plugin POM</name>
K
Kohsuke Kawaguchi 已提交
13
  <version>1.428-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>
K
Kohsuke Kawaguchi 已提交
36
        <version>1.428-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>
K
Kohsuke Kawaguchi 已提交
46
      <version>1.428-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>
K
Kohsuke Kawaguchi 已提交
52
      <version>1.428-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>
K
Kohsuke Kawaguchi 已提交
58
      <version>1.428-SNAPSHOT</version>
59 60 61
      <scope>test</scope>
    </dependency>
    <dependency>
62
      <groupId>org.jenkins-ci.main</groupId>
63
      <artifactId>ui-samples-plugin</artifactId>
K
Kohsuke Kawaguchi 已提交
64
      <version>1.428-SNAPSHOT</version>
65 66 67 68 69
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
70
      <version>4.8.2</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 89 90 91 92

      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>
  </dependencies>
  <!--dependencyManagement>
       <dependencies>
       <dependency>
93
       <groupId>org.jenkins-ci.main</groupId>
94
       <artifactId>maven-plugin</artifactId>
95
       <version>1.395</version>
96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115
       </dependency>
       </dependencies>
       </dependencyManagement-->

  <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 已提交
116
        <groupId>org.jenkins-ci.tools</groupId>
117
        <artifactId>maven-hpi-plugin</artifactId>
118
        <version>1.74</version>
119 120 121 122 123 124 125 126
        <extensions>true</extensions>
        <configuration>
          <showDeprecation>true</showDeprecation>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.kohsuke.stapler</groupId>
        <artifactId>maven-stapler-plugin</artifactId>
127
        <!-- version specified in parent pom -->
128 129 130 131
        <extensions>true</extensions>
      </plugin>
      <plugin>
        <artifactId>maven-release-plugin</artifactId>
132
        <!-- version specified in parent pom -->
133
        <configuration>
134
          <goals>deploy</goals>
135 136 137 138 139
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.jvnet.localizer</groupId>
        <artifactId>maven-localizer-plugin</artifactId>
140
        <!-- version specified in parent pom -->
141 142 143 144 145 146 147 148 149 150 151 152 153 154
        <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>
155
        <!-- version specified in parent pom -->
156 157
      </plugin>
      <plugin>
K
Kohsuke Kawaguchi 已提交
158
        <groupId>org.codehaus.gmaven</groupId>
159
        <artifactId>gmaven-plugin</artifactId>
160
        <!-- version specified in grandparent pom -->
161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180
        <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>
181
        <!-- version specified in grandparent pom -->
182 183 184 185 186 187 188 189 190
        <configuration>
          <systemProperties>
            <property>
              <name>hudson.udp</name>
              <value>33849</value>
            </property>
          </systemProperties>
        </configuration>
      </plugin>
191 192 193
      <plugin>
        <groupId>com.cloudbees</groupId>
        <artifactId>maven-license-plugin</artifactId>
194
        <!-- version specified in grandparent pom -->
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 229 230 231 232 233 234
        <executions>
          <execution>
            <goals>
              <goal>process</goal>
            </goals>
            <phase>compile</phase>
            <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>
235
    </plugins>
236 237 238 239 240 241 242 243 244 245 246 247 248 249 250
    <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>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278
  </build>

  <repositories>
    <repository>
      <id>m.g.o-public</id>
      <url>http://maven.glassfish.org/content/groups/public/</url>
      <releases>
        <enabled>true</enabled>
      </releases>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
    </repository>
  </repositories>

  <pluginRepositories>
    <pluginRepository>
      <id>m.g.o-public</id>
      <url>http://maven.glassfish.org/content/groups/public/</url>
      <releases>
        <enabled>true</enabled>
      </releases>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
    </pluginRepository>
  </pluginRepositories>

279 280
  <distributionManagement>
    <snapshotRepository>
281
      <id>maven.jenkins-ci.org</id>
K
Kohsuke Kawaguchi 已提交
282
      <url>http://maven.jenkins-ci.org:8081/content/repositories/snapshots</url>
283 284
    </snapshotRepository>
  </distributionManagement>
285
</project>