提交 5ebab261 编写于 作者: K kohsuke

I did some serious POM hacking so that we can preserve JDK1.4 compatibility at...

I did some serious POM hacking so that we can preserve JDK1.4 compatibility at what we generate. But this is a real mess.
I'm really starting to wonder maybe it's time to drop JDK 1.4, especially now that JDK6 is released.


git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@1348 71c3de6d-444a-0410-be80-ed276b4c234a
上级 5d3e48f6
......@@ -51,6 +51,60 @@
</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>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>create14jar</id>
<phase>package</phase>
<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">
<src path="target/classes"/>
</retrotranslator>
<jar basedir="target/classes14" destfile="target/${artifactId}-${version}-jdk14.jar" />
</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>
</plugins>
</build>
......@@ -60,12 +114,45 @@
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<dependencies>
<dependency>
<groupId>org.jvnet.hudson.main</groupId>
<artifactId>remoting</artifactId>
<version>${version}</version>
</dependency>
</dependencies>
</profile>
<!-- run retrotranslator only during the release -->
<profile>
<id>release</id>
<build>
<plugins>
<!--
To build the remoting and core modules both retrotranslated
(and still while writing the core code with generics),
it is necessary to build both in one compilation. So in
the release mode, we add the remoting source tree as a part
of the core.
Instead, in the debug profile we depends on the separately built remoting module,
so that IDEs won't get confused with "duplicate code"
-->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<configuration>
<sources>
<source>../remoting/src/main/java</source>
</sources>
</configuration>
<executions>
<execution>
<goals>
<goal>add-source</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- run retrotranslator only during the release, so that debug build gets faster -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>retrotranslator-maven-plugin</artifactId>
......@@ -95,16 +182,21 @@
</profiles>
<dependencies>
<!--dependency>
<groupId>org.jvnet.hudson.main</groupId>
<artifactId>remoting</artifactId>
<version>${version}</version>
</dependency-->
<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>
<dependency>
<groupId>org.kohsuke.stapler</groupId>
<artifactId>stapler</artifactId>
......
......@@ -16,7 +16,7 @@
<description>The module that constitutes the main hudson.war</description>
<modules>
<!--module>remoting</module-->
<module>remoting</module>
<module>core</module>
<module>war</module>
</modules>
......
......@@ -3,13 +3,13 @@
<parent>
<groupId>org.jvnet.hudson.main</groupId>
<artifactId>pom</artifactId>
<version>1.67-SNAPSHOT</version>
<version>1.68-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>remoting</artifactId>
<packaging>jar</packaging>
<name>Remoting layer for Hudson</name>
<name>Hudson remoting layer</name>
<profiles>
<profile>
......
......@@ -64,12 +64,19 @@
</build>
<dependencies>
<dependency>
<groupId>org.jvnet.hudson.main</groupId>
<artifactId>remoting</artifactId>
<version>${version}</version>
<classifier>jdk14</classifier>
</dependency>
<dependency>
<groupId>org.jvnet.hudson.main</groupId>
<artifactId>hudson-core</artifactId>
<version>${version}</version>
<!-- jars that are not needed in war -->
<classifier>jdk14</classifier>
<exclusions>
<!-- jars that are not needed in war -->
<exclusion>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
......@@ -138,6 +145,11 @@
<groupId>pull-parser</groupId>
<artifactId>pull-parser</artifactId>
</exclusion>
<!-- we want jdk14 version, but core depends on jdk1.5 version -->
<exclusion>
<groupId>org.jvnet.hudson.main</groupId>
<artifactId>remoting</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册