0

I can generate jar file with all dependencies by following this post here.

The problem is the jasper reports dependencies, when I package the jar it overrides the property file of Jasper reports dependencies, the jasperreports-extension.property. I noticed because both jasperreports and jasperreports-fonts has the same file but with different content.

    <!-- https://mvnrepository.com/artifact/net.sf.jasperreports/jasperreports -->
    <dependency>
        <groupId>net.sf.jasperreports</groupId>
        <artifactId>jasperreports</artifactId>
        <version>5.6.1</version>
    </dependency>
    <!-- https://mvnrepository.com/artifact/net.sf.jasperreports/jasperreports-fonts -->
    <dependency>
        <groupId>net.sf.jasperreports</groupId>
        <artifactId>jasperreports-fonts</artifactId>
        <version>5.6.1</version>
    </dependency>

so, which ever comes first, it's the only one written on generated jar.

How can I generate a jar that will only append the content of the second file if there's a same filename in property files?

Community
  • 1
  • 1
yesterdaysfoe
  • 768
  • 3
  • 7
  • 23
  • Try to use [Apache Maven Shade Plugin](http://maven.apache.org/plugins/maven-shade-plugin/index.html). Sample is here: [Selecting Contents for Uber JAR](http://maven.apache.org/plugins/maven-shade-plugin/examples/includes-excludes.html) – Alex K Jan 10 '17 at 07:50
  • For the meantime, I introduced a `jasperreports-extension.property` file in resources and copied all the contents of both property file there. – yesterdaysfoe Jan 12 '17 at 06:51

0 Answers0