1

Working with Jaspersoft Studio I notice that it allows you to generate a JAR file with all your fonts and XML files with each font variation definition.

Its great for portability reasons, but Im not able to work with that JAR on my maven based project. However, if I uncompress the JAR on my classpath it works like expected.

How are you using the JAR without extract the content?

Alex K
  • 22,315
  • 19
  • 108
  • 236

1 Answers1

1

In your pom.xml, make sure the classpath includes the font.jar:

<plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>exec-maven-plugin</artifactId>
        <version>1.6.0</version>
        <executions>
            <execution>
                <goals>
                    <goal>exec</goal>
                </goals>
            </execution>
        </executions>
        <configuration>
            <executable>java</executable>
            <mainClass>com.youself.yourproject.Main</mainClass> <!-- main-->
            <arguments>
                 <argument>-classpath</argument>
                 <argument>path/to/jar/fonts.jar</argument>  <!-- HERE -->
            </arguments>
        </configuration>
    </plugin>

So, when you run you application from maven, it will know about the fonts.jar

 mvn exec:java
bruno
  • 2,213
  • 1
  • 19
  • 31
  • 2
    suppose you generated font Jar file from JasperStudio then you can add it to your local maven repository `mvn install:install-file -Dfile=arial_unicode_ms.jar -DgroupId=jasperfont -DartifactId=arial-unicode-ms -Dversion=1.0.0 -Dpackaging=jar` and add a dependency in your maven project like below `jasperfontarial-unicode-ms1.0.0` – Vishal Patel Jun 28 '19 at 06:39