Files
jenkins/remoting/pom.xml
T

252 lines
8.5 KiB
XML

<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>
<groupId>org.jvnet.hudson.main</groupId>
<artifactId>pom</artifactId>
<version>1.91-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>remoting</artifactId>
<packaging>jar</packaging>
<name>Hudson remoting layer</name>
<profiles>
<profile>
<id>jdk15</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<build>
<plugins>
<!--
Have Maven recognize test directory only for JDK1.5.
They are written against the remoting module in their
untranslated form, so they won't run on 1.4.
-->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<configuration>
<sources>
<source>src/test/java</source>
</sources>
</configuration>
<executions>
<execution>
<goals>
<goal>add-test-source</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<!-- run retrotranslator only for releases -->
<profile>
<id>jdk14</id>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>retrotranslator-maven-plugin</artifactId>
<executions>
<execution>
<phase>process-classes</phase>
<goals>
<goal>translate</goal>
</goals>
<configuration>
<includes>
<include>
<directory>target/classes</directory>
</include>
</includes>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<build>
<plugins>
<!--
I haven't figured out how to run those tests from Maven
(the problem is that when I fork another process
I need to somehow compute the right classpath), so
excluded from Maven run for now.
-->
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<!--
create uberjar for jdk14.
-->
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<id>uberjar</id>
<phase>package</phase>
<goals>
<!--
Work around for http://jira.codehaus.org/browse/MASSEMBLY-97 as the goal should be attached.
-->
<goal>single</goal>
</goals>
<configuration>
<finalName>remoting-${version}</finalName>
<descriptors>
<descriptor>assembly-uberjar-14.xml</descriptor>
</descriptors>
<archive>
<manifest>
<mainClass>hudson.remoting.Launcher</mainClass>
</manifest>
</archive>
</configuration>
</execution>
</executions>
</plugin>
<!--
Generate retrotranslated 1.4 jar "on the side". I tried various approaches like
"profile" (like http://testng.googlecode.com/svn/trunk/pom.xml), but in the
end using Ant seems to be the easiest.
-->
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>create14jar</id>
<phase>process-classes</phase><!-- do this earlier than the package phase so that the assembly plugin can create uberjars for 14 classes -->
<configuration>
<tasks>
<taskdef name="retrotranslator" classpathref="maven.test.classpath" classname="net.sf.retrotranslator.transformer.RetrotranslatorTask" />
<mkdir dir="target/classes14" />
<retrotranslator destdir="target/classes14"><!-- verify="true" detects false-positive errors against some references to remoting-->
<src path="target/classes" />
</retrotranslator>
<jar basedir="target/classes14" destfile="target/${artifactId}-${version}-jdk14.jar">
<manifest>
<attribute name="Main-Class" value="hudson.remoting.Launcher" />
</manifest>
</jar>
<!-- see ../jnlp-agent/pom.xml for details -->
<signjar jar="target/${artifactId}-${version}-jdk14.jar" alias="${hudson.sign.alias}" keystore="${hudson.sign.keystore}" storepass="${hudson.sign.storepass}" />
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
<!-- sign uberjar, which is used as slave.jar in the release profile -->
<execution>
<id>signUberjar</id>
<phase>verify</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
<!-- see ../jnlp-agent/pom.xml for details -->
<signjar jar="target/${artifactId}-${version}-jdk14-jar-with-dependencies.jar" alias="${hudson.sign.alias}" keystore="${hudson.sign.keystore}" storepass="${hudson.sign.storepass}" />
</tasks>
</configuration>
</execution>
</executions>
</plugin>
<!--
Attach the generated 1.4 jar to the build so that it gets deployed to the repo.
-->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<executions>
<execution>
<id>attach-artifacts</id>
<phase>package</phase>
<goals>
<goal>attach-artifact</goal>
</goals>
<configuration>
<artifacts>
<artifact>
<file>target/${artifactId}-${version}-jdk14.jar</file>
<type>jar</type>
<classifier>jdk14</classifier>
</artifact>
</artifacts>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>2.1</version>
<configuration>
<archive>
<manifest>
<mainClass>hudson.remoting.Launcher</mainClass>
</manifest>
</archive>
</configuration>
<executions>
<execution>
<goals>
<goal>sign</goal>
</goals>
<configuration>
<!--
during the development, debug profile defined in ../pom.xml will cause
the jars to be signed by a self-certified dummy public key.
For release, you should define the real values in ~/.m2/settings.xml
-->
<alias>${hudson.sign.alias}</alias>
<storepass>${hudson.sign.storepass}</storepass>
<keystore>${hudson.sign.keystore}</keystore>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>net.sf.retrotranslator</groupId>
<artifactId>retrotranslator-runtime</artifactId>
<version>1.0.8</version>
</dependency>
<dependency>
<!--
marked as test dependency so that I can still use it in the antrun plugin but
it won't show up as a public dependency
-->
<groupId>net.sf.retrotranslator</groupId>
<artifactId>retrotranslator-transformer</artifactId>
<version>1.0.8</version>
<scope>test</scope>
</dependency>
<!-- test dependencies -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>asm</groupId>
<artifactId>asm-all</artifactId>
<version>2.2.3</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>