I am using maven-antrun-plugin to unpack a jar file into a folder. This jar file is generated in every build and has a variant TIMESTAMP (as seen in the following snippet). How can I unpack the jar file into folder that has the same name as the jar file? E.g. Folder should be /sample_TIMESTAMP and not /folder
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.7</version>
<executions>
<execution>
<id>unpack-jar-features</id>
<phase>install</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<echo message="unpack jar file" />
<unzip dest="/folder">
<fileset dir="/folder">
<include name="sample_TIMESTAMP.jar" />
</fileset>
</unzip>
</target>
</configuration>
</execution>
</executions>
</plugin>
To unzip into a new directory, first create the directory with
<mkdir>
and then change thedest
of<unzip>
tosample_TIMESTAMP
:You can use
<pathconvert>
to create a property with the name of the JAR file:If the
my-jar-file
<fileset>
could match multiple JAR files, use<restrict>
to limit the matching to a single file.