PR: MPDIST-17
New property maven.dist.formats to allow creation of only zip or tar.gz archives. git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@413193 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
ed9e0c3b68
commit
6c89a1087a
241
dist/plugin.jelly
vendored
241
dist/plugin.jelly
vendored
@ -190,73 +190,93 @@
|
|||||||
prereqs="dist:build-setup,dist:prepare-bin-filesystem"
|
prereqs="dist:build-setup,dist:prepare-bin-filesystem"
|
||||||
description="Build the binary distribution.">
|
description="Build the binary distribution.">
|
||||||
|
|
||||||
<!-- Use LF line endings for specified files if lf filter
|
<util:tokenize var="distFormats" delim="," trim="true">${maven.dist.formats}</util:tokenize>
|
||||||
is set -->
|
|
||||||
<j:if test="${lfFilter.length() > 0}">
|
|
||||||
<ant:fixcrlf srcdir="${maven.dist.bin.archive.dir}"
|
|
||||||
eol="lf" includes="${lfFilter}"/>
|
|
||||||
</j:if>
|
|
||||||
|
|
||||||
<!-- Create a tar.gz file -->
|
<j:forEach var="distFormat" items="${distFormats}">
|
||||||
<ant:tar longfile="gnu" tarfile="${maven.dist.dir}/${maven.final.name}.tar">
|
|
||||||
<ant:tarfileset dir="${maven.dist.bin.archive.dir}"/>
|
|
||||||
</ant:tar>
|
|
||||||
|
|
||||||
<ant:gzip
|
<j:if test="${distFormat == 'tgz'}">
|
||||||
zipfile="${maven.dist.dir}/${maven.final.name}.tar.gz"
|
<!-- Use LF line endings for specified files if lf filter
|
||||||
src="${maven.dist.dir}/${maven.final.name}.tar"
|
is set -->
|
||||||
/>
|
<j:if test="${lfFilter.length() > 0}">
|
||||||
|
<ant:fixcrlf srcdir="${maven.dist.bin.archive.dir}"
|
||||||
<ant:delete file="${maven.dist.dir}/${maven.final.name}.tar"/>
|
eol="lf" includes="${lfFilter}"/>
|
||||||
|
</j:if>
|
||||||
|
|
||||||
<!-- Use CRLF line endings for specified files in zip if crlf filter
|
<!-- Create a tar.gz file -->
|
||||||
is set -->
|
<ant:tar longfile="gnu" tarfile="${maven.dist.dir}/${maven.final.name}.tar">
|
||||||
<j:if test="${crlfFilter.length() > 0}">
|
<ant:tarfileset dir="${maven.dist.bin.archive.dir}"/>
|
||||||
<ant:fixcrlf srcdir="${maven.dist.bin.archive.dir}"
|
</ant:tar>
|
||||||
eol="crlf" includes="${crlfFilter}"/>
|
|
||||||
</j:if>
|
<ant:gzip
|
||||||
|
zipfile="${maven.dist.dir}/${maven.final.name}.tar.gz"
|
||||||
|
src="${maven.dist.dir}/${maven.final.name}.tar"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<ant:delete file="${maven.dist.dir}/${maven.final.name}.tar"/>
|
||||||
|
</j:if>
|
||||||
|
|
||||||
|
<j:if test="${distFormat == 'zip'}">
|
||||||
|
<!-- Use CRLF line endings for specified files in zip if crlf filter
|
||||||
|
is set -->
|
||||||
|
<j:if test="${crlfFilter.length() > 0}">
|
||||||
|
<ant:fixcrlf srcdir="${maven.dist.bin.archive.dir}"
|
||||||
|
eol="crlf" includes="${crlfFilter}"/>
|
||||||
|
</j:if>
|
||||||
|
|
||||||
|
<!-- Create a zip file -->
|
||||||
|
<ant:zip zipfile="${maven.dist.dir}/${maven.final.name}.zip">
|
||||||
|
<ant:zipfileset dir="${maven.dist.bin.archive.dir}"/>
|
||||||
|
</ant:zip>
|
||||||
|
</j:if>
|
||||||
|
|
||||||
|
</j:forEach>
|
||||||
|
|
||||||
<!-- Create a zip file -->
|
|
||||||
<ant:zip zipfile="${maven.dist.dir}/${maven.final.name}.zip">
|
|
||||||
<ant:zipfileset dir="${maven.dist.bin.archive.dir}"/>
|
|
||||||
</ant:zip>
|
|
||||||
</goal>
|
</goal>
|
||||||
|
|
||||||
<goal
|
<goal
|
||||||
name="dist:build-src"
|
name="dist:build-src"
|
||||||
prereqs="dist:build-setup,dist:prepare-src-filesystem"
|
prereqs="dist:build-setup,dist:prepare-src-filesystem"
|
||||||
description="Build the source distribution.">
|
description="Build the source distribution.">
|
||||||
|
|
||||||
<!-- Use LF line endings for specified files in unix distros if lf filter
|
|
||||||
is set -->
|
|
||||||
<j:if test="${lfFilter.length() > 0}">
|
|
||||||
<ant:fixcrlf srcdir="${maven.dist.src.archive.dir}"
|
|
||||||
eol="lf" includes="${lfFilter}"/>
|
|
||||||
</j:if>
|
|
||||||
|
|
||||||
<!-- Create a tar.gz file -->
|
<util:tokenize var="distFormats" delim="," trim="true">${maven.dist.formats}</util:tokenize>
|
||||||
<ant:tar longfile="gnu" tarfile="${maven.dist.dir}/${maven.final.name}-src.tar">
|
|
||||||
<ant:tarfileset dir="${maven.dist.src.archive.dir}"/>
|
|
||||||
</ant:tar>
|
|
||||||
|
|
||||||
<ant:gzip
|
<j:forEach var="distFormat" items="${distFormats}">
|
||||||
zipfile="${maven.dist.dir}/${maven.final.name}-src.tar.gz"
|
|
||||||
src="${maven.dist.dir}/${maven.final.name}-src.tar"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<ant:delete file="${maven.dist.dir}/${maven.final.name}-src.tar"/>
|
|
||||||
|
|
||||||
<!-- Use CRLF line endings for text files in zip archive if crlf filter
|
<j:if test="${distFormat == 'tgz'}">
|
||||||
is set -->
|
<!-- Use LF line endings for specified files in unix distros if lf filter
|
||||||
<j:if test="${crlfFilter.length() > 0}">
|
is set -->
|
||||||
<ant:fixcrlf srcdir="${maven.dist.src.archive.dir}"
|
<j:if test="${lfFilter.length() > 0}">
|
||||||
eol="crlf" includes="${crlfFilter}"/>
|
<ant:fixcrlf srcdir="${maven.dist.src.archive.dir}"
|
||||||
</j:if>
|
eol="lf" includes="${lfFilter}"/>
|
||||||
|
</j:if>
|
||||||
|
|
||||||
<!-- Create a zip file -->
|
<!-- Create a tar.gz file -->
|
||||||
<ant:zip zipfile="${maven.dist.dir}/${maven.final.name}-src.zip">
|
<ant:tar longfile="gnu" tarfile="${maven.dist.dir}/${maven.final.name}-src.tar">
|
||||||
<ant:zipfileset dir="${maven.dist.src.archive.dir}"/>
|
<ant:tarfileset dir="${maven.dist.src.archive.dir}"/>
|
||||||
</ant:zip>
|
</ant:tar>
|
||||||
|
|
||||||
|
<ant:gzip
|
||||||
|
zipfile="${maven.dist.dir}/${maven.final.name}-src.tar.gz"
|
||||||
|
src="${maven.dist.dir}/${maven.final.name}-src.tar"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<ant:delete file="${maven.dist.dir}/${maven.final.name}-src.tar"/>
|
||||||
|
</j:if>
|
||||||
|
|
||||||
|
<j:if test="${distFormat == 'zip'}">
|
||||||
|
<!-- Use CRLF line endings for text files in zip archive if crlf filter
|
||||||
|
is set -->
|
||||||
|
<j:if test="${crlfFilter.length() > 0}">
|
||||||
|
<ant:fixcrlf srcdir="${maven.dist.src.archive.dir}"
|
||||||
|
eol="crlf" includes="${crlfFilter}"/>
|
||||||
|
</j:if>
|
||||||
|
|
||||||
|
<!-- Create a zip file -->
|
||||||
|
<ant:zip zipfile="${maven.dist.dir}/${maven.final.name}-src.zip">
|
||||||
|
<ant:zipfileset dir="${maven.dist.src.archive.dir}"/>
|
||||||
|
</ant:zip>
|
||||||
|
</j:if>
|
||||||
|
</j:forEach>
|
||||||
|
|
||||||
</goal>
|
</goal>
|
||||||
|
|
||||||
@ -494,33 +514,44 @@
|
|||||||
</classpath>
|
</classpath>
|
||||||
</javadoc>
|
</javadoc>
|
||||||
|
|
||||||
<ant:echo>
|
<util:tokenize var="distFormats" delim="," trim="true">${maven.dist.formats}</util:tokenize>
|
||||||
+---------------------------------------------+
|
|
||||||
| C R E A T I N G B I N A R Y T A R B A L L |
|
|
||||||
+---------------------------------------------+
|
|
||||||
</ant:echo>
|
|
||||||
|
|
||||||
<!-- Create a tar.gz file -->
|
<j:forEach var="distFormat" items="${distFormats}">
|
||||||
<ant:tar longfile="gnu" tarfile="${maven.dist.dir}/${maven.final.name}.tar">
|
|
||||||
<ant:tarfileset dir="${maven.dist.bin.archive.dir}"/>
|
|
||||||
</ant:tar>
|
|
||||||
<ant:gzip
|
|
||||||
zipfile="${maven.dist.dir}/${maven.final.name}.tar.gz"
|
|
||||||
src="${maven.dist.dir}/${maven.final.name}.tar"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<ant:delete file="${maven.dist.dir}/${maven.final.name}.tar"/>
|
|
||||||
|
|
||||||
<ant:echo>
|
<j:if test="${distFormat == 'tgz'}">
|
||||||
+----------------------------------------------+
|
<ant:echo>
|
||||||
| C R E A T I N G B I N A R Y Z I P F I L E |
|
+---------------------------------------------+
|
||||||
+----------------------------------------------+
|
| C R E A T I N G B I N A R Y T A R B A L L |
|
||||||
</ant:echo>
|
+---------------------------------------------+
|
||||||
|
</ant:echo>
|
||||||
|
|
||||||
|
<!-- Create a tar.gz file -->
|
||||||
|
<ant:tar longfile="gnu" tarfile="${maven.dist.dir}/${maven.final.name}.tar">
|
||||||
|
<ant:tarfileset dir="${maven.dist.bin.archive.dir}"/>
|
||||||
|
</ant:tar>
|
||||||
|
<ant:gzip
|
||||||
|
zipfile="${maven.dist.dir}/${maven.final.name}.tar.gz"
|
||||||
|
src="${maven.dist.dir}/${maven.final.name}.tar"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<ant:delete file="${maven.dist.dir}/${maven.final.name}.tar"/>
|
||||||
|
</j:if>
|
||||||
|
|
||||||
|
<j:if test="${distFormat == 'zip'}">
|
||||||
|
<ant:echo>
|
||||||
|
+----------------------------------------------+
|
||||||
|
| C R E A T I N G B I N A R Y Z I P F I L E |
|
||||||
|
+----------------------------------------------+
|
||||||
|
</ant:echo>
|
||||||
|
|
||||||
|
<!-- Create a zip file -->
|
||||||
|
<ant:zip zipfile="${maven.dist.dir}/${maven.final.name}.zip">
|
||||||
|
<ant:zipfileset dir="${maven.dist.bin.archive.dir}"/>
|
||||||
|
</ant:zip>
|
||||||
|
</j:if>
|
||||||
|
|
||||||
|
</j:forEach>
|
||||||
|
|
||||||
<!-- Create a zip file -->
|
|
||||||
<ant:zip zipfile="${maven.dist.dir}/${maven.final.name}.zip">
|
|
||||||
<ant:zipfileset dir="${maven.dist.bin.archive.dir}"/>
|
|
||||||
</ant:zip>
|
|
||||||
</goal>
|
</goal>
|
||||||
|
|
||||||
|
|
||||||
@ -562,34 +593,42 @@
|
|||||||
</ant:fileset>
|
</ant:fileset>
|
||||||
</ant:copy>
|
</ant:copy>
|
||||||
|
|
||||||
<ant:echo>
|
<util:tokenize var="distFormats" delim="," trim="true">${maven.dist.formats}</util:tokenize>
|
||||||
|
|
||||||
+---------------------------------------------+
|
<j:forEach var="distFormat" items="${distFormats}">
|
||||||
| C R E A T I N G S O U R C E T A R B A L L |
|
|
||||||
+---------------------------------------------+
|
|
||||||
</ant:echo>
|
|
||||||
|
|
||||||
<!-- Create a tar.gz file -->
|
<j:if test="${distFormat == 'tgz'}">
|
||||||
<ant:tar longfile="gnu" tarfile="${maven.dist.dir}/${maven.final.name}-src.tar">
|
<ant:echo>
|
||||||
<ant:tarfileset dir="${maven.dist.src.archive.dir}"/>
|
+---------------------------------------------+
|
||||||
</ant:tar>
|
| C R E A T I N G S O U R C E T A R B A L L |
|
||||||
<ant:gzip
|
+---------------------------------------------+
|
||||||
zipfile="${maven.dist.dir}/${maven.final.name}-src.tar.gz"
|
</ant:echo>
|
||||||
src="${maven.dist.dir}/${maven.final.name}-src.tar"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<ant:delete file="${maven.dist.dir}/${maven.final.name}-src.tar"/>
|
|
||||||
|
|
||||||
<ant:echo>
|
<!-- Create a tar.gz file -->
|
||||||
+----------------------------------------------+
|
<ant:tar longfile="gnu" tarfile="${maven.dist.dir}/${maven.final.name}-src.tar">
|
||||||
| C R E A T I N G S O U R C E Z I P F I L E |
|
<ant:tarfileset dir="${maven.dist.src.archive.dir}"/>
|
||||||
+----------------------------------------------+
|
</ant:tar>
|
||||||
</ant:echo>
|
<ant:gzip
|
||||||
|
zipfile="${maven.dist.dir}/${maven.final.name}-src.tar.gz"
|
||||||
|
src="${maven.dist.dir}/${maven.final.name}-src.tar"
|
||||||
|
/>
|
||||||
|
<ant:delete file="${maven.dist.dir}/${maven.final.name}-src.tar"/>
|
||||||
|
</j:if>
|
||||||
|
|
||||||
<!-- Create a zip file -->
|
<j:if test="${distFormat == 'zip'}">
|
||||||
<ant:zip zipfile="${maven.dist.dir}/${maven.final.name}-src.zip">
|
<ant:echo>
|
||||||
<ant:zipfileset dir="${maven.dist.src.archive.dir}"/>
|
+----------------------------------------------+
|
||||||
</ant:zip>
|
| C R E A T I N G S O U R C E Z I P F I L E |
|
||||||
|
+----------------------------------------------+
|
||||||
|
</ant:echo>
|
||||||
|
|
||||||
|
<!-- Create a zip file -->
|
||||||
|
<ant:zip zipfile="${maven.dist.dir}/${maven.final.name}-src.zip">
|
||||||
|
<ant:zipfileset dir="${maven.dist.src.archive.dir}"/>
|
||||||
|
</ant:zip>
|
||||||
|
</j:if>
|
||||||
|
|
||||||
|
</j:forEach>
|
||||||
</goal>
|
</goal>
|
||||||
|
|
||||||
<goal
|
<goal
|
||||||
|
|||||||
3
dist/plugin.properties
vendored
3
dist/plugin.properties
vendored
@ -30,4 +30,5 @@ maven.dist.dir=${maven.build.dir}/distributions
|
|||||||
maven.dist.crlf.filter=**/*.txt
|
maven.dist.crlf.filter=**/*.txt
|
||||||
maven.dist.lf.filter=
|
maven.dist.lf.filter=
|
||||||
maven.dist.bin.include.site=true
|
maven.dist.bin.include.site=true
|
||||||
maven.dist.bin.artifact.type=jar
|
maven.dist.bin.artifact.type=jar
|
||||||
|
maven.dist.formats=zip,tgz
|
||||||
1
dist/xdocs/changes.xml
vendored
1
dist/xdocs/changes.xml
vendored
@ -25,6 +25,7 @@
|
|||||||
</properties>
|
</properties>
|
||||||
<body>
|
<body>
|
||||||
<release version="1.7-SNAPSHOT" date="in SVN">
|
<release version="1.7-SNAPSHOT" date="in SVN">
|
||||||
|
<action dev="ltheussl" type="add" issue="MPDIST-17">New property maven.dist.formats to allow creation of only zip or tar.gz archives.</action>
|
||||||
<action dev="ltheussl" type="add" issue="MPDIST-26">Allow distribution of artifact types other than jar. New property maven.dist.bin.artifact.type, deprecated property maven.dist.bin.artifact.</action>
|
<action dev="ltheussl" type="add" issue="MPDIST-26">Allow distribution of artifact types other than jar. New property maven.dist.bin.artifact.type, deprecated property maven.dist.bin.artifact.</action>
|
||||||
<action dev="ltheussl" type="add" issue="MPDIST-19">New property <code>maven.dist.bin.include.site</code> to optionally include the site docs in the binary distribution.</action>
|
<action dev="ltheussl" type="add" issue="MPDIST-19">New property <code>maven.dist.bin.include.site</code> to optionally include the site docs in the binary distribution.</action>
|
||||||
<action dev="ltheussl" type="fix" issue="MPDIST-12">build-src goal does not use <code>pom.build.sourceDirectory</code>.</action>
|
<action dev="ltheussl" type="fix" issue="MPDIST-12">build-src goal does not use <code>pom.build.sourceDirectory</code>.</action>
|
||||||
|
|||||||
10
dist/xdocs/properties.xml
vendored
10
dist/xdocs/properties.xml
vendored
@ -100,7 +100,15 @@
|
|||||||
and zip distributions. This filter is applied before the crlf
|
and zip distributions. This filter is applied before the crlf
|
||||||
filter, so in zip archives, the crlf filter will take precendence
|
filter, so in zip archives, the crlf filter will take precendence
|
||||||
for files that satisfy both filters.</td>
|
for files that satisfy both filters.</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>maven.dist.formats</td>
|
||||||
|
<td>yes - default is <code>zip,tgz</code>.</td>
|
||||||
|
<td>
|
||||||
|
A comma-separated list of distribution formats to build.
|
||||||
|
Possible values are tgz and zip.
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</section>
|
</section>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user