pom.xml 6.5 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.69-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 90 91 92 93 94 95 96 97 98 99 100 101 102 103
      <plugin>
        <artifactId>maven-assembly-plugin</artifactId>
        <configuration>
          <finalName>slave-${version}</finalName>
          <!--appendAssemblyId>false</appendAssemblyId-->
          <descriptors>
            <descriptor>assembly-uberjar.xml</descriptor>
          </descriptors>
          <archive>
            <manifest>
              <mainClass>hudson.remoting.Launcher</mainClass>
            </manifest>
          </archive>
        </configuration>
      </plugin>
104 105 106 107 108 109 110 111 112 113 114 115 116 117
      <!--
        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>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-antrun-plugin</artifactId>
        <executions>
          <execution>
            <id>create14jar</id>
            <phase>package</phase>
            <configuration>
              <tasks>
118 119
                <taskdef name="retrotranslator" classpathref="maven.test.classpath" classname="net.sf.retrotranslator.transformer.RetrotranslatorTask" />
                <mkdir dir="target/classes14" />
K
kohsuke 已提交
120
                <retrotranslator destdir="target/classes14"><!-- verify="true" detects false-positive errors against some references to remoting-->
121
                  <src path="target/classes" />
122
                </retrotranslator>
K
kohsuke 已提交
123 124 125 126 127
                <jar basedir="target/classes14" destfile="target/${artifactId}-${version}-jdk14.jar">
                  <manifest>
                    <attribute name="Main-Class" value="hudson.remoting.Launcher"/>
                  </manifest>
                </jar>
128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160
              </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 已提交
161 162 163 164 165 166 167 168 169 170
      <plugin>
        <artifactId>maven-jar-plugin</artifactId>
        <configuration>
          <archive>
            <manifest>
              <mainClass>hudson.remoting.Launcher</mainClass>
            </manifest>
          </archive>
        </configuration>
      </plugin>
171 172 173
    </plugins>
  </build>

174 175 176 177 178 179
  <dependencies>
    <dependency>
      <groupId>net.sf.retrotranslator</groupId>
      <artifactId>retrotranslator-runtime</artifactId>
      <version>1.0.8</version>
    </dependency>
180 181 182 183 184 185 186 187 188 189
    <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>
190 191 192 193 194 195 196 197 198 199 200 201 202 203 204
    <!-- 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>