PageRenderTime 57ms CodeModel.GetById 49ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 0ms

/hudson-war/pom.xml

http://github.com/hudson/hudson
XML | 387 lines | 305 code | 23 blank | 59 comment | 0 complexity | 6d74ed0dfbf009ccef4072c0ccfcad13 MD5 | raw file
  1
  2<!--
  3The MIT License
  4
  5Copyright (c) 2004-2011, Oracle Corporation, Kohsuke Kawaguchi, Stephen Connolly,
  6Tom Huybrechts, Yahoo! Inc., Anton Kozak, Nikita Levyankov
  7
  8Permission is hereby granted, free of charge, to any person obtaining a copy
  9of this software and associated documentation files (the "Software"), to deal
 10in the Software without restriction, including without limitation the rights
 11to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 12copies of the Software, and to permit persons to whom the Software is
 13furnished to do so, subject to the following conditions:
 14
 15The above copyright notice and this permission notice shall be included in
 16all copies or substantial portions of the Software.
 17
 18THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 19IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 20FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 21AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 22LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 23OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 24THE SOFTWARE.
 25-->
 26
 27<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">
 28  <modelVersion>4.0.0</modelVersion>
 29  <parent>
 30    <groupId>org.jvnet.hudson.main</groupId>
 31    <artifactId>hudson</artifactId>
 32    <version>2.2.2-SNAPSHOT</version>
 33    <relativePath>../pom.xml</relativePath>
 34  </parent>
 35  
 36  <artifactId>hudson-war</artifactId>
 37  <packaging>war</packaging>
 38  <name>Hudson :: Webapp</name>
 39
 40  <description>
 41    Creates a war file. Also includes additional static web resources, such as images, CSS, JavaScript, and
 42    some HTML files.
 43  </description>
 44
 45  <properties>
 46    <HUDSON_HOME>${basedir}/work</HUDSON_HOME>
 47    <contextPath>/</contextPath><!-- context path during test -->
 48    <port>8080</port><!-- HTTP listener port -->
 49  </properties>
 50
 51  <build>
 52    <finalName>hudson</finalName>
 53
 54    <plugins>
 55      <plugin>
 56        <groupId>org.apache.maven.plugins</groupId>
 57        <artifactId>maven-war-plugin</artifactId>
 58        <configuration>
 59          <filteringDeploymentDescriptors>true</filteringDeploymentDescriptors>
 60          <webResources>
 61            <resource>
 62              <directory>${project.build.directory}/generated-resources</directory>
 63            </resource>
 64          </webResources>
 65          <!-- for putting Main-Class into war -->
 66          <archive>
 67            <manifest>
 68              <mainClass>Main</mainClass>
 69            </manifest>
 70            <manifestEntries>
 71              <Implementation-Version>${project.version}</Implementation-Version>
 72              <Hudson-Version>${project.version}</Hudson-Version>
 73            </manifestEntries>
 74          </archive>
 75        </configuration>
 76      </plugin>
 77
 78      <plugin>
 79        <groupId>org.apache.maven.plugins</groupId>
 80        <artifactId>maven-dependency-plugin</artifactId>
 81        <executions>
 82          <execution>
 83            <phase>generate-resources</phase>
 84            <goals>
 85              <goal>list</goal>
 86            </goals>
 87            <!-- used by org.jvnet.hudson:executable-war to find JNA and Akuma versions -->
 88            <configuration>
 89              <outputFile>${basedir}/target/classes/dependencies.txt</outputFile>
 90            </configuration>
 91          </execution>
 92        </executions>
 93      </plugin>
 94      <plugin>
 95        <groupId>org.apache.maven.plugins</groupId>
 96        <artifactId>maven-antrun-plugin</artifactId>
 97        <executions>
 98          <execution>
 99            <id>fixDependenciesTxt</id>
100            <phase>generate-resources</phase>
101            <goals>
102              <goal>run</goal>
103            </goals>
104            <configuration>
105              <tasks>
106                <!-- fix Akuma groupId so it can still be found by pre-split org.jvnet.hudson:executable-war:1.17 -->
107                <replace file="${basedir}/target/classes/dependencies.txt" token="org.kohsuke:akuma" value="com.sun.akuma:akuma" />
108              </tasks>
109            </configuration>
110          </execution>
111        </executions>
112      </plugin>
113
114      <plugin>
115        <groupId>org.jvnet.maven-antrun-extended-plugin</groupId>
116        <artifactId>maven-antrun-extended-plugin</artifactId>
117        <executions>
118          <execution>
119            <id>package</id>
120            <phase>package</phase>
121            <goals>
122              <goal>run</goal>
123            </goals>
124            <configuration>
125              <tasks>
126                <!-- deploy the war as a jar, so that the tests can pull this into the classpath -->
127                <attachArtifact file="target/hudson.war" classifier="war-for-test" type="jar" />
128              </tasks>
129            </configuration>
130          </execution>
131          <execution>
132            <id>resgen</id>
133            <phase>generate-resources</phase>
134            <goals>
135              <goal>run</goal>
136            </goals>
137            <configuration>
138              <verifyArtifact>false</verifyArtifact>
139              <tasks>
140                <mkdir dir="target/generated-resources" />
141
142                <!-- put executable war header -->
143                <resolveArtifact groupId="org.jvnet.hudson" artifactId="executable-war" version="1.17" type="jar" property="executable-war.jar" />
144                <unjar src="${executable-war.jar}" dest="target/generated-resources">
145                  <patternset>
146                    <include name="**/*.class" />
147                  </patternset>
148                </unjar>
149
150                <!-- dependencies that goes to unusual locations -->
151                <resolveArtifact artifactId="hudson-remoting" tofile="${basedir}/target/generated-resources/WEB-INF/remoting.jar" />
152                <resolveArtifact artifactId="hudson-remoting" tofile="${basedir}/target/generated-resources/WEB-INF/slave.jar" />
153                <resolveArtifact groupId="${project.groupId}" artifactId="hudson-cli" classifier="jar-with-dependencies" version="${project.version}" type="jar" tofile="${basedir}/target/generated-resources/WEB-INF/hudson-cli.jar" />
154                <resolveArtifact groupId="org.jvnet.hudson.winstone" artifactId="winstone" version="0.9.10-hudson-24" type="jar" tofile="${basedir}/target/generated-resources/winstone.jar" />
155                
156                <!-- bundled plugins -->
157                <resolveArtifact type="hpi" groupId="${project.groupId}" artifactId="rest-plugin" version="2.1.2" tofile="${basedir}/target/generated-resources/WEB-INF/plugins/rest-plugin.hpi" />
158                <resolveArtifact type="hpi" groupId="${project.groupId}" artifactId="maven3-plugin" version="2.2.0" tofile="${basedir}/target/generated-resources/WEB-INF/plugins/maven3-plugin.hpi" />
159                <resolveArtifact type="hpi" groupId="${project.groupId}" artifactId="maven3-snapshots" version="2.2.0" tofile="${basedir}/target/generated-resources/WEB-INF/plugins/maven3-snapshots.hpi" />
160                <resolveArtifact type="hpi" groupId="org.hudsonci.plugins" artifactId="maven-plugin" version="2.2.1" tofile="${basedir}/target/generated-resources/WEB-INF/plugins/maven-plugin.hpi" />
161                <resolveArtifact type="hpi" groupId="org.hudsonci.plugins" artifactId="ssh-slaves" version="2.1.1" tofile="${basedir}/target/generated-resources/WEB-INF/plugins/ssh-slaves.hpi" />
162                <resolveArtifact type="hpi" groupId="org.hudsonci.plugins" artifactId="subversion" version="2.3.2" tofile="${basedir}/target/generated-resources/WEB-INF/plugins/subversion.hpi" />
163                <resolveArtifact type="hpi" groupId="org.hudsonci.plugins" artifactId="cvs" version="2.2.0" tofile="${basedir}/target/generated-resources/WEB-INF/plugins/cvs.hpi" />
164                <resolveArtifact type="hpi" groupId="org.hudsonci.plugins" artifactId="git" version="2.2.0" tofile="${basedir}/target/generated-resources/WEB-INF/plugins/git.hpi" />
165              </tasks>
166            </configuration>
167          </execution>
168        </executions>
169      </plugin>
170
171      <plugin>
172        <groupId>org.jvnet.hudson.tools</groupId>
173        <artifactId>maven-hudson-dev-plugin</artifactId>
174        <configuration>
175          <contextPath>${contextPath}</contextPath>
176          <connectors>
177            <connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
178                <port>${port}</port>
179            </connector>
180          </connectors>
181          <!--
182            read directly from core module's output directory,
183            so that changes are picked up right away without running mvn.
184          -->
185          <classesDirectory>../hudson-core/target/classes</classesDirectory>
186          <!-- use the test classpath for loading resources, since this takes priority -->
187          <testClassesDirectory>../hudson-core/src/main/resources</testClassesDirectory>
188          <useTestClasspath>true</useTestClasspath>
189          <!--
190            Reload webapp when you hit ENTER. (See JETTY-282 for more)
191          -->
192          <consoleForceReload>true</consoleForceReload>
193          <userRealms>
194            <userRealm implementation="org.mortbay.jetty.security.HashUserRealm">
195              <name>default</name>
196              <config>${basedir}/src/realm.properties</config>
197            </userRealm>
198          </userRealms>
199          <systemProperties>
200            <systemProperty>
201              <name>HUDSON_HOME</name>
202              <value>${HUDSON_HOME}</value>
203            </systemProperty>
204            <systemProperty>
205              <!-- always reload views during debugging -->
206              <name>stapler.jelly.noCache</name>
207              <value>true</value>
208            </systemProperty>
209            <systemProperty>
210              <!-- show the stapler evaluation during execution -->
211              <name>stapler.trace</name>
212              <value>true</value>
213            </systemProperty>
214            <systemProperty>
215              <!-- always reload scripts during debugging -->
216              <name>hudson.script.noCache</name>
217              <value>true</value>
218            </systemProperty>
219            <systemProperty>
220              <!-- load view resources from the source directly, again for real time change -->
221              <name>stapler.resourcePath</name>
222              <value>
223                  ../hudson-core/src/main/resources
224              </value>
225            </systemProperty>
226            <systemProperty>
227              <!-- stat collection pointless -->
228              <name>hudson.model.UsageStatistics.disabled</name>
229              <value>true</value>
230            </systemProperty>
231            <systemProperty>
232              <name>hudson.Main.development</name>
233              <value>true</value>
234            </systemProperty>
235            <systemProperty>
236              <!-- this adds 3 sec to the shutdown, and most likely pointless, too -->
237              <name>hudson.DNSMultiCast.disabled</name>
238              <value>true</value>
239            </systemProperty>
240          </systemProperties>
241        </configuration>
242      </plugin>
243    </plugins>
244  </build>
245
246  <dependencies>
247    <dependency>
248      <groupId>javax.servlet</groupId>
249      <artifactId>servlet-api</artifactId>
250      <scope>provided</scope>
251    </dependency>
252
253    <dependency>
254      <groupId>org.jvnet.hudson.main</groupId>
255      <artifactId>hudson-core</artifactId>
256      <exclusions>
257        <!--
258          jars that are not needed in war. most of the exclusions should happen in the core, to make IDEs happy, not here.
259        -->
260        <exclusion>
261          <groupId>javax.servlet</groupId>
262          <artifactId>servlet-api</artifactId>
263        </exclusion>
264        <exclusion>
265          <groupId>javax.servlet</groupId>
266          <artifactId>jsp-api</artifactId>
267        </exclusion>
268      </exclusions>
269    </dependency>
270
271    <dependency>
272      <groupId>org.jvnet.hudson.main</groupId>
273      <artifactId>hudson-inject</artifactId>
274    </dependency>
275
276    <dependency>
277      <groupId>org.jvnet.hudson.main</groupId>
278      <artifactId>hudson-service</artifactId>
279    </dependency>
280
281    <dependency>
282      <groupId>org.jvnet.hudson.main</groupId>
283      <artifactId>hudson-remoting</artifactId>
284    </dependency>
285
286    <!-- declare in reactor, so "mvn install -pl war -am" will work -->
287    <dependency>
288      <groupId>org.jvnet.hudson.main</groupId>
289      <artifactId>rest-plugin</artifactId>
290      <version>2.1.2</version>
291      <scope>provided</scope>
292    </dependency>
293    <dependency>
294      <groupId>org.jvnet.hudson.main</groupId>
295      <artifactId>maven3-plugin</artifactId>
296      <version>2.2.0</version>
297      <scope>provided</scope>
298    </dependency>
299    <dependency>
300      <groupId>org.jvnet.hudson.main</groupId>
301      <artifactId>maven3-snapshots</artifactId>
302      <version>2.2.0</version>
303      <scope>provided</scope>
304    </dependency>
305    <!-- REMOVE when the legacy maven-plugin isn't a bundled plugin -->
306    <dependency>
307      <groupId>org.jvnet.hudson.main</groupId>
308      <artifactId>maven-plugin</artifactId>
309      <version>2.2.0</version>
310      <scope>provided</scope>
311    </dependency>
312
313    <dependency>
314      <groupId>org.jvnet.hudson.main</groupId>
315      <artifactId>hudson-cli</artifactId>
316      <classifier>jar-with-dependencies</classifier>
317      <scope>provided</scope>
318    </dependency>
319
320    <dependency>
321      <groupId>org.slf4j</groupId>
322      <artifactId>slf4j-jdk14</artifactId>
323    </dependency>
324  </dependencies>
325
326  <profiles>
327    <profile>
328      <!-- profile for creating Hudson IPS package -->
329      <id>ips</id>
330      <build>
331        <plugins>
332          <plugin>
333            <groupId>org.jvnet.updatecenter2</groupId>
334            <artifactId>maven-makepkgs-plugin</artifactId>
335            <version>0.3</version>
336            <executions>
337              <execution>
338                <goals>
339                  <goal>package</goal>
340                </goals>
341              </execution>
342            </executions>
343            <configuration>
344              <python>python2.5</python>
345              <proto>../ips/proto.py</proto>
346              <attach>false</attach>
347            </configuration>
348          </plugin>
349        </plugins>
350      </build>
351    </profile>
352
353    <profile>
354      <!-- sign war -->
355      <id>sign</id>
356      <build>
357        <plugins>
358          <plugin>
359            <groupId>org.apache.maven.plugins</groupId>
360            <artifactId>maven-antrun-plugin</artifactId>
361            <executions>
362              <!-- sign the war -->
363              <execution>
364                <id>signWar</id>
365                <phase>verify</phase>
366                <goals>
367                  <goal>run</goal>
368                </goals>
369                <configuration>
370                  <tasks>
371                    <!--
372                      during the development, debug profile defined in ../pom.xml will cause
373                      the jars to be signed by a self-certified dummy public key.
374
375                      For release, you should define the real values in ~/.m2/settings.xml
376                    -->
377                    <signjar jar="target/hudson.war" alias="${hudson.sign.alias}" keystore="${hudson.sign.keystore}" storepass="${hudson.sign.storepass}" />
378                  </tasks>
379                </configuration>
380              </execution>
381            </executions>
382          </plugin>
383        </plugins>
384      </build>
385    </profile>
386  </profiles>
387</project>