Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9110713
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T03:20:05+00:00 2026-06-17T03:20:05+00:00

I have a report project that gets compiled, packaged, and included in a war.

  • 0

I have a report project that gets compiled, packaged, and included in a war. I use the jasperreports-maven-plugin to compile the JasperReports templates in the report project. I have an issue with a circular dependency where one of the templates requires a scriptlet class in the same project, but the scriptlet class does not get compiled before the reports and I get a ClassNotFound exception during compilation. Is there a way to compile the class first before the templates or some other workaround besides declaring a system dependency to a previously compiled version of the jar?

Here is my pom:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<artifactId>report</artifactId>

<name>report</name>
<url>http://maven.apache.org</url>

<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<build>
    <plugins>
        <plugin>
            <artifactId>maven-dependency-plugin</artifactId>
            <executions>
                <execution>
                    <configuration>
                        <artifactItems>
                            <artifactItem>
                                <groupId>net.sf.jasperreports</groupId>
                                <artifactId>jasperreports-fonts</artifactId>
                                <type>jar</type>
                                <overWrite>true</overWrite>
                            </artifactItem>
                            <artifactItem>
                                <groupId>net.sf.jasperreports</groupId>
                                <artifactId>jasperreports</artifactId>
                                <type>jar</type>
                                <overWrite>true</overWrite>
                            </artifactItem>
                            <artifactItem>
                                <groupId>ar.com.fdvs</groupId>
                                <artifactId>DynamicJasper</artifactId>
                                <type>jar</type>
                                <overWrite>true</overWrite>
                            </artifactItem>
                        </artifactItems>
                    </configuration>
                </execution>
            </executions>
        </plugin>
        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>jasperreports-maven-plugin</artifactId>
            <executions>
                <execution>
                    <goals>
                        <goal>compile-reports</goal>
                    </goals>
                </execution>
            </executions>
            <configuration>

                <outputDirectory>${project.build.directory}/generated-jasper</outputDirectory>
                <sourceDirectory>src/main/resources/com/example/report/</sourceDirectory>
                <compiler>net.sf.jasperreports.compilers.JRGroovyCompiler</compiler>
            </configuration>

            <dependencies>
                <dependency>
                    <groupId>net.sf.jasperreports</groupId>
                    <artifactId>jasperreports</artifactId>
                    <version>4.0.1</version>
                </dependency>
                <dependency>
                    <groupId>org.codehaus.groovy</groupId>
                    <artifactId>groovy-all</artifactId>
                    <version>1.8.5</version>
                </dependency>
                <dependency>
                    <groupId>log4j</groupId>
                    <artifactId>log4j</artifactId>
                    <version>1.2.16</version>
                </dependency>

                <!-- use this if you have a report dependency at compile time -->
                <!-- 
                <dependency>
                    <groupId>com.example.usedforcompilingjasperreports</groupId>
                    <artifactId>compilejasperreports</artifactId>
                    <scope>system</scope>
                    <version>0.0.1</version>
                    <systemPath>${basedir}/src/main/resources/com/example/report/lib/report-${version}.jar</systemPath>
                </dependency>
                -->
            </dependencies>
        </plugin>
    </plugins>
    <resources>
        <resource>
            <directory>src/main/resources</directory>
        </resource>
    </resources>
    <pluginManagement>
        <plugins>
            <!--This plugin's configuration is used to store Eclipse m2e settings 
                only. It has no influence on the Maven build itself. -->
            <plugin>
                <groupId>org.eclipse.m2e</groupId>
                <artifactId>lifecycle-mapping</artifactId>
                <version>1.0.0</version>
                <configuration>
                    <lifecycleMappingMetadata>
                        <pluginExecutions>
                            <pluginExecution>
                                <pluginExecutionFilter>
                                    <groupId>
                                        org.codehaus.mojo
                                    </groupId>
                                    <artifactId>
                                        jasperreports-maven-plugin
                                    </artifactId>
                                    <versionRange>
                                        [1.0-beta-2,)
                                    </versionRange>
                                    <goals>
                                        <goal>compile-reports</goal>
                                    </goals>
                                </pluginExecutionFilter>
                                <action>
                                    <ignore></ignore>
                                </action>
                            </pluginExecution>
                        </pluginExecutions>
                    </lifecycleMappingMetadata>
                </configuration>
            </plugin>
        </plugins>
    </pluginManagement>
</build>
<dependencies>
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>3.8.1</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-context</artifactId>
        <version>3.0.6.RELEASE</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-beans</artifactId>
        <version>3.0.6.RELEASE</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>com.example</groupId>
        <artifactId>persistence</artifactId>
        <version>${project.version}</version>
    </dependency>
    <dependency>
        <groupId>log4j</groupId>
        <artifactId>log4j</artifactId>
        <version>1.2.16</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>ar.com.fdvs</groupId>
        <artifactId>DynamicJasper</artifactId>
        <version>3.1.9</version>
    </dependency>
    <dependency>
        <groupId>com.lowagie</groupId>
        <artifactId>itext</artifactId>
        <version>2.1.7</version>
    </dependency>
    <dependency>
        <groupId>net.sf.jasperreports</groupId>
        <artifactId>jasperreports</artifactId>
        <version>4.0.1</version>
    </dependency>
    <dependency>
        <groupId>net.sf.jasperreports</groupId>
        <artifactId>jasperreports-fonts</artifactId>
        <version>4.0.1</version>
    </dependency>
    <dependency>
        <groupId>commons-lang</groupId>
        <artifactId>commons-lang</artifactId>
        <version>2.6</version>
    </dependency>
    <dependency>
        <!-- not used but necessary to avoid an unexpected compiletion exception 
            An exception has occurred in the compiler (1.6.0_04). Please file a bug at 
            the Java Developer Connection (http://java.sun.com/webapps/bugreport) after 
            checking the Bug Parade for duplicates. Include your program and the following 
            diagnostic in your report. Thank you. com.sun.tools.javac.code.Symbol$CompletionFailure: 
            class file for javax.persistence.CascadeType not found -->
        <groupId>org.hibernate</groupId>
        <artifactId>ejb3-persistence</artifactId>
        <version>1.0.1.GA</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>servlet-api</artifactId>
        <version>2.5</version>
    </dependency>
    <dependency>
        <groupId>javax.faces</groupId>
        <artifactId>jsf-api</artifactId>
        <version>2.1</version>
    </dependency>
    <dependency>
        <groupId>commons-io</groupId>
        <artifactId>commons-io</artifactId>
        <version>2.1</version>
    </dependency>
    <dependency>
        <groupId>org.apache.poi</groupId>
        <artifactId>poi</artifactId>
        <version>3.7</version>
    </dependency>
    <dependency>
        <groupId>jfree</groupId>
        <artifactId>jfreechart</artifactId>
        <version>1.0.12</version>
    </dependency>
    <dependency>
        <groupId>jfree</groupId>
        <artifactId>jcommon</artifactId>
        <version>1.0.15</version>
    </dependency>
    <dependency>
        <groupId>com.force.api</groupId>
        <artifactId>force-wsc</artifactId>
        <version>22.0.0</version>
    </dependency>
    <dependency>
        <groupId>com.sforce.soap</groupId>
        <artifactId>salesforce-webservices</artifactId>
        <version>1.1.0</version>
    </dependency>
</dependencies>
<parent>
    <groupId>com.example</groupId>
    <artifactId>assemble</artifactId>
    <version>2.2.0-SNAPSHOT</version>
    <relativePath>../assemble/pom.xml</relativePath>
</parent>
</project>

Thank you,

Tom

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T03:20:06+00:00Added an answer on June 17, 2026 at 3:20 am

    This might be a tad late, but I think you could try to bind the execution of the jasperreports-maven-plugin to a later maven build phase.

    By default it runs at the generate-resources phase, at which time the java classes have not yet been compiled.

    Check out the paragraph below the code box on this page.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an existing report (Crystal Report) in my Visual Studio project that is
I have a SQL Server report project in VS 2005 that won't preview one
We have a report designer project which uses Active Reports. We want to use
I have a VS2008 Web Application project that is being pre-compiled without being updatable.
in my Java project I have a lot of JasperReports reports with complex SQL
I have created SSRS project in BIDS and I want to use the reports
I have a report that is getting info from bsis, bsas, bsid, bsad, vbrk,
I have a report that is inside of a multiview. The first view is
We're using NHibernate in a project that gets data out of the database and
I have a project that uses Python (2.* flavors) extensively and I am wondering

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.