Jasper-report-maven-plugin icon indicating copy to clipboard operation
Jasper-report-maven-plugin copied to clipboard

How add other custom project dependency to this plugin

Open sreekanthsnair opened this issue 9 years ago • 1 comments

Our Jrxml is depends on couple of my other java project, how to refer those project in this plugin? plugin dependency won't work with process-source phase, if phase is changed to process-class then its working but compiled jasper is not becoming a part of jar

sreekanthsnair avatar Jul 08 '15 09:07 sreekanthsnair

Hey @sreekanthsnair. I don't know if I understood your question but I had to compile jasper files to a jar too.

To do this, I had to explicit add a resource on my build to path target/classes/jasper, and in the configuration section I set the output directory to this path. That's how I did this:

<build>
    <finalName>taxonomia-reports</finalName>
    <resources>
        <resource>
            <directory>src/main/resources</directory>
        </resource>
        <resource>
            <directory>target/classes/jasper</directory>
            <includes>
                <include>**/*.jasper</include>
            </includes>
        </resource>
    </resources>
    <plugins>
        <plugin>
            <groupId>com.alexnederlof</groupId>
            <artifactId>jasperreports-plugin</artifactId>
            <version>2.0</version>
            <executions>
                <execution>
                    <phase>process-sources</phase>
                    <goals>
                        <goal>jasper</goal>
                    </goals>
                </execution>
            </executions>
            <configuration>
                <compiler>net.sf.jasperreports.engine.design.JRJdtCompiler</compiler>
                <sourceDirectory>src/main/jasperreports</sourceDirectory>
                <outputDirectory>${project.build.directory}/classes/jasper</outputDirectory>
                <outputFileExt>.jasper</outputFileExt>
                <xmlValidation>true</xmlValidation>
                <verbose>false</verbose>
                <numberOfThreads>4</numberOfThreads>
                <failOnMissingSourceDirectory>true</failOnMissingSourceDirectory>
                <sourceScanner>org.codehaus.plexus.compiler.util.scan.StaleSourceScanner</sourceScanner>
                <additionalProperties>
                    <net.sf.jasperreports.awt.ignore.missing.font>true</net.sf.jasperreports.awt.ignore.missing.font>
                </additionalProperties>
            </configuration>
        </plugin>
    </plugins>
</build>

adrianoneres avatar Aug 05 '16 21:08 adrianoneres