Skip to content

Commit

Permalink
Simplify bundle generation / Add io.netty.versions.properties to all …
Browse files Browse the repository at this point in the history
…JARs

- Fixes netty#2003 properly
- Instead of using 'bundle' packaging, use 'jar' packaging.  This is
  more robust because some strict build tools fail to retrieve the
  artifacts from a Maven repository unless their packaging is not 'jar'.
- All artifacts now contain META-INF/io.netty.version.properties, which
  provides the detailed information about the build and repository.
- Removed OSGi testsuite temporarily because it gives false errors
  during split package test and examination.
- Add io.netty.util.Version for easy retrieval of version information
  • Loading branch information
trustin committed Nov 26, 2013
1 parent 10e3651 commit 807d96e
Show file tree
Hide file tree
Showing 41 changed files with 519 additions and 1,504 deletions.
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,4 @@
/reports
*/reports
.DS_Store
/common/src/main/java/io/netty/util/Version.java


140 changes: 119 additions & 21 deletions all/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@

<properties>
<quickbuild>true</quickbuild>
<generatedSourceDir>${project.build.directory}/src</generatedSourceDir>
<dependencyVersionDir>${project.build.directory}/versions</dependencyVersionDir>
</properties>

<profiles>
Expand Down Expand Up @@ -188,6 +190,17 @@
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<!-- Populate the properties whose key is groupId:artifactId:type
and whose value is the path to the artifact -->
<execution>
<id>locate-dependencies</id>
<phase>initialize</phase>
<goals>
<goal>properties</goal>
</goals>
</execution>

<!-- Unpack all source files -->
<execution>
<id>unpack-sources</id>
<phase>prepare-package</phase>
Expand All @@ -198,9 +211,11 @@
<classifier>sources</classifier>
<includes>io/netty/**</includes>
<includeGroupIds>${project.groupId}</includeGroupIds>
<outputDirectory>${project.build.directory}/src</outputDirectory>
<outputDirectory>${generatedSourceDir}</outputDirectory>
</configuration>
</execution>

<!-- Unpack all class files -->
<execution>
<id>unpack-jars</id>
<phase>prepare-package</phase>
Expand All @@ -215,6 +230,64 @@
</execution>
</executions>
</plugin>

<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<!-- Instead of generating a new version property file, merge others' version property files into one. -->
<execution>
<id>write-version-properties</id>
<phase>none</phase>
</execution>
<execution>
<id>merge-version-properties</id>
<phase>prepare-package</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<taskdef resource="net/sf/antcontrib/antlib.xml" />
<propertyselector
property="versions"
match="^(${project.groupId}:(?!netty-example)[^:]+:jar)$" select="\1"/>
<for list="${versions}" param="x">
<sequential>
<unzip src="${@{x}}" dest="${dependencyVersionsDir}">
<patternset>
<include name="META-INF/${project.groupId}.versions.properties"/>
</patternset>
</unzip>
<concat destfile="${project.build.outputDirectory}/META-INF/${project.groupId}.versions.properties"
append="true">
<path path="${dependencyVersionsDir}/META-INF/${project.groupId}.versions.properties"/>
</concat>
</sequential>
</for>
<delete dir="${dependencyVersionsDir}" quiet="true"/>
</target>
</configuration>
</execution>

<!-- Clean everything once finished so that IDE doesn't find the unpacked files. -->
<execution>
<id>clean-source-directory</id>
<phase>package</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<delete dir="${generatedSourceDir}" quiet="true" />
<delete dir="${dependencyVersionDir}" quiet="true" />
<delete dir="${project.build.outputDirectory}" quiet="true" />
</target>
</configuration>
</execution>
</executions>
</plugin>

<!-- Include the directory where the source files were unpacked -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
Expand All @@ -227,13 +300,50 @@
</goals>
<configuration>
<sources>
<source>target/src</source>
<source>${generatedSourceDir}</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>

<!-- Disable OSGi bundle manifest generation -->
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<executions>
<execution>
<id>generate-manifest</id>
<phase>none</phase>
</execution>
</executions>
</plugin>
<!-- Override the default JAR configuration -->
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<id>default-jar</id>
<phase>none</phase>
</execution>
<execution>
<id>all-in-one-jar</id>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<archive>
<manifest>
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
</manifest>
<index>true</index>
</archive>
</configuration>
</execution>
</executions>
</plugin>

<!-- Disable animal sniffer -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
Expand All @@ -245,6 +355,7 @@
</execution>
</executions>
</plugin>

<!-- Disable checkstyle -->
<plugin>
<artifactId>maven-checkstyle-plugin</artifactId>
Expand All @@ -255,6 +366,7 @@
</execution>
</executions>
</plugin>

<!-- Disable all plugin executions configured by jar packaging -->
<plugin>
<artifactId>maven-resources-plugin</artifactId>
Expand Down Expand Up @@ -291,6 +403,8 @@
</execution>
</executions>
</plugin>

<!-- Generate Xref -->
<plugin>
<artifactId>maven-jxr-plugin</artifactId>
<executions>
Expand Down Expand Up @@ -318,6 +432,8 @@
</dependency>
</dependencies>
</plugin>

<!-- Generate Javadoc -->
<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
<executions>
Expand All @@ -333,7 +449,7 @@
<excludePackageNames>*.internal,*.example</excludePackageNames>
<docfilessubdirs>true</docfilessubdirs>
<outputDirectory>${project.build.directory}/api</outputDirectory>
<overview>${basedir}/src/javadoc/overview.html</overview>
<overview>${project.basedir}/src/javadoc/overview.html</overview>
<doctitle>Netty API Reference (${project.version})</doctitle>
<windowtitle>Netty API Reference (${project.version})</windowtitle>
<detectJavaApiLink>false</detectJavaApiLink>
Expand All @@ -354,24 +470,6 @@
<locale>en_US</locale>
</configuration>
</plugin>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>clean-source-directory</id>
<phase>package</phase>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
<configuration>
<target>
<delete dir="${project.build.directory}/src" quiet="true" />
<delete dir="${project.build.directory}/classes" quiet="true" />
</target>
</configuration>
</plugin>
</plugins>
</build>
</project>
Expand Down
3 changes: 1 addition & 2 deletions buffer/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
</parent>

<artifactId>netty-buffer</artifactId>
<packaging>bundle</packaging>
<packaging>jar</packaging>

<name>Netty/Buffer</name>

Expand All @@ -35,5 +35,4 @@
<version>${project.version}</version>
</dependency>
</dependencies>

</project>
4 changes: 1 addition & 3 deletions codec-http/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
</parent>

<artifactId>netty-codec-http</artifactId>
<packaging>bundle</packaging>
<packaging>jar</packaging>

<name>Netty/Codec/HTTP</name>

Expand All @@ -45,7 +45,5 @@
<optional>true</optional>
</dependency>
</dependencies>


</project>

3 changes: 1 addition & 2 deletions codec-memcache/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
</parent>

<artifactId>netty-codec-memcache</artifactId>
<packaging>bundle</packaging>
<packaging>jar</packaging>

<name>Netty/Codec/Memcache</name>

Expand All @@ -40,6 +40,5 @@
<version>${project.version}</version>
</dependency>
</dependencies>

</project>

3 changes: 2 additions & 1 deletion codec-socks/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
</parent>

<artifactId>netty-codec-socks</artifactId>
<packaging>bundle</packaging>
<packaging>jar</packaging>

<name>Netty/Codec/Socks</name>

Expand All @@ -41,3 +41,4 @@
</dependency>
</dependencies>
</project>

3 changes: 1 addition & 2 deletions codec/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
</parent>

<artifactId>netty-codec</artifactId>
<packaging>bundle</packaging>
<packaging>jar</packaging>

<name>Netty/Codec</name>

Expand Down Expand Up @@ -62,6 +62,5 @@
<scope>test</scope>
</dependency>
</dependencies>

</project>

Loading

0 comments on commit 807d96e

Please sign in to comment.