Skip to content
This repository has been archived by the owner on Jun 14, 2019. It is now read-only.

Apache Maven Shade Plugin adapter for Apache Ant

Notifications You must be signed in to change notification settings

lyubomyr-shaydariv/ant-shade-task

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 

Repository files navigation

What is it?

ant-shade-task is a wrapper of Apache Maven Shade Plugin (or maven-shade-plugin) for Ant.

Requirements

  • Use: Java 8 and Apache Ant.
  • Build: Java 8 and Apache Maven.

How to use

  • Build with mvn clean package.
  • Pick ant-shade-task-0.1-SNAPSHOT.jar or ant-shade-task-0.1-SNAPSHOT-jar-with-dependencies.jar from the target directory and copy it to elsewhere.
  • Register the picked up JAR file in build.xml:
<taskdef
	classpath="ant-shade-task-0.1-SNAPSHOT-jar-with-dependencies.jar"
	resource="org/apache/tools/ant/taskdefs/shade.properties"
/>
<shade jar="foo-bar.jar" uberJar="foo-bar-shaded.jar">
	<relocation pattern="org.codehaus.plexus.util" shadedPattern="org.shaded.plexus.util">
		<exclude value="org.codehaus.plexus.util.xml.Xpp3Dom"/>
		<exclude value="org.codehaus.plexus.util.xml.pull.*"/>
	</relocation>
</shade>

The snippet above is an Ant adaptation of the following Maven Shade Plugin configuration snippet:

<relocations>
	<relocation>
	<pattern>org.codehaus.plexus.util</pattern>
		<shadedPattern>org.shaded.plexus.util</shadedPattern>
		<excludes>
			<exclude>org.codehaus.plexus.util.xml.Xpp3Dom</exclude>
			<exclude>org.codehaus.plexus.util.xml.pull.*</exclude>
		</excludes>
	</relocation>
</relocations>

What's supported

  • Only <relocations> are exposed through the <shade> task so far.

Version history

Nothing tagged yet.

Known issues

  • ant-shade-task-0.1-SNAPSHOT.jar does not include any dependencies and the dependencies should be picked up either manually or using ant-shade-task-0.1-SNAPSHOT-jar-with-dependencies.jar that's currently large (about 8.7MB).
  • Not a part of the standard Apache Ant taskdef library, but occupies the org.apache.tools.ant.taskdefs.Shade class, and probably should be moved to another non-Apache package.

About

Apache Maven Shade Plugin adapter for Apache Ant

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages