-1

I'm trying to package a text based file into .tar using maven. To achieve this I used an assembly plugin and it worked, but along with the file tar a jar is also being generated. How can I avoid that?

<assembly
    xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
    <id>all</id>
    <formats>
        <format>tar</format>
    </formats>
    <includeBaseDirectory>false</includeBaseDirectory>
    <fileSets>
        <fileSet>
            <directory>configuration</directory>
            <fileMode>0444</fileMode>
        </fileSet>
    </fileSets>
</assembly>
Rkumar
  • 19
  • 7

1 Answers1

0

You can change the packaging of your project. I guess current packaging is jar, and thus the creation of a jar. You may use pom and configure the assembly plugin to attach its result (the tar) to your build.

You could also configure the jar plugin, to skip the creation of empty jar (if it is your case).

  <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-jar-plugin</artifactId>
    <version>3.0.2</version>
    <configuration>
      <skipIfEmpty>true</skipIfEmpty>
    </configuration>
  </plugin>
YMomb
  • 2,366
  • 1
  • 27
  • 36
  • Thanks for your response. But, it didn't work and also when I try to specify the packaging it gives me error in the pom and build fails. My requirement is to package a text based file into tar file and I am using a pom file with a format.xml file while contains the assembly info. – Rkumar Dec 21 '16 at 21:28
  • Packaging should be pom – YMomb Dec 22 '16 at 11:17