pom.xml 7.9 KB
Newer Older
1 2 3 4 5
<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>
6
    <version>1.81-SNAPSHOT</version>
7 8 9 10 11
    <relativePath>../pom.xml</relativePath>
  </parent>
  
  <artifactId>remoting</artifactId>
  <packaging>jar</packaging>
12
  <name>Hudson remoting layer</name>
13 14 15
  
  <profiles>
    <profile>
16
      <id>jdk15</id>
17 18 19
      <activation>
        <activeByDefault>true</activeByDefault>
      </activation>
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
      <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>
45
    </profile>
46
    <!-- run retrotranslator only for releases -->
47
    <profile>
48
      <id>jdk14</id>
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74
      <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>

75 76 77 78 79 80 81 82 83 84 85 86 87 88
  <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>
K
kohsuke 已提交
89
      <plugin>
K
kohsuke 已提交
90 91 92
        <!--
          create uberjar for jdk14.
        -->
K
kohsuke 已提交
93
        <artifactId>maven-assembly-plugin</artifactId>
K
kohsuke 已提交
94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115
        <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>
              <descriptors>
                <descriptor>assembly-uberjar-14.xml</descriptor>
              </descriptors>
              <archive>
                <manifest>
                  <mainClass>hudson.remoting.Launcher</mainClass>
                </manifest>
              </archive>
            </configuration>
          </execution>
        </executions>
K
kohsuke 已提交
116
      </plugin>
117 118 119 120 121 122 123 124 125 126
      <!--
        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>
K
kohsuke 已提交
127
            <phase>process-classes</phase><!-- do this earlier than the package phase so that the assembly plugin can create uberjars for 14 classes -->
128 129
            <configuration>
              <tasks>
130 131
                <taskdef name="retrotranslator" classpathref="maven.test.classpath" classname="net.sf.retrotranslator.transformer.RetrotranslatorTask" />
                <mkdir dir="target/classes14" />
K
kohsuke 已提交
132
                <retrotranslator destdir="target/classes14"><!-- verify="true" detects false-positive errors against some references to remoting-->
133
                  <src path="target/classes" />
134
                </retrotranslator>
K
kohsuke 已提交
135 136
                <jar basedir="target/classes14" destfile="target/${artifactId}-${version}-jdk14.jar">
                  <manifest>
137
                    <attribute name="Main-Class" value="hudson.remoting.Launcher" />
K
kohsuke 已提交
138 139
                  </manifest>
                </jar>
140 141 142 143 144
                <!-- 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}" />
145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177
              </tasks>
            </configuration>
            <goals>
              <goal>run</goal>
            </goals>
          </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>
K
kohsuke 已提交
178 179 180 181 182 183 184 185 186
      <plugin>
        <artifactId>maven-jar-plugin</artifactId>
        <configuration>
          <archive>
            <manifest>
              <mainClass>hudson.remoting.Launcher</mainClass>
            </manifest>
          </archive>
        </configuration>
187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204
        <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>
K
kohsuke 已提交
205
      </plugin>
206 207 208
    </plugins>
  </build>

209 210 211 212 213 214
  <dependencies>
    <dependency>
      <groupId>net.sf.retrotranslator</groupId>
      <artifactId>retrotranslator-runtime</artifactId>
      <version>1.0.8</version>
    </dependency>
215 216 217 218 219 220 221 222 223 224
    <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>
225 226 227 228 229 230 231 232 233 234 235 236 237 238 239
    <!-- 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>