jasperreport 5.0.1需要添加哪些依赖项? [英] What dependencies need to be added for jasperreport 5.0.1?

查看:69
本文介绍了jasperreport 5.0.1需要添加哪些依赖项?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将jasper报告版本从 4.5.0升级到了5.1.0 .当我安装我的插件时,它会抛出错误,例如缺少某些依赖项.我想用Maven配置JasperReports 5.1.0.

I upgraded jasper report version from 4.5.0 to 5.1.0. When i install my plugin it throws error like some dependency missing. I would like to configure JasperReports 5.1.0 with Maven.

Execution default of goal org.codehaus.mojo:jasperreports-maven-plugin:1.0-beta-2:compile-reports failed: Plugin org.codehaus.mojo:jasperreports-maven-plugin:1.0-beta-2 or one of its dependencies could not be resolved: Failure to find com.lowagie:itext:jar:2.1.7.js2

我有两个查询.

1)我想知道所有依赖项是什么,我必须添加pom 以使用jasper报告5.1.0.

1) I want to know what are all the dependency that I have to add in pom to use jasper report 5.1.0.

2)我正在使用下面的插件将我的jrxml文件编译为jasper文件.我在这个插件中看到了这个问题.这个插件可能是什么问题.我应该添加任何镜像吗?

2) I am using below plugin to compile my jrxml files to jasper files. I see that issue in this plugin. What could be the issue in this plugin. Should I have to add any mirror ?

<groupId>org.codehaus.mojo</groupId>
<artifactId>jasperreports-maven-plugin</artifactId>
<version>1.0-beta-2</version>

我完整的pom是,除了jasper报告外,可能还有其他依赖项,我将其用于内部目的.

My complete pom is, There may be extra dependencies other that jasper report, I am using it for my internal purpose.

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

  <groupId>com.test.plugins</groupId>
  <artifactId>report-test-plugin</artifactId>
  <version>2.2.1.1001-SNAPSHOT</version>
  <packaging>jar</packaging>

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

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>

  <dependencies>
        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-plugin-api</artifactId>
            <version>2.0.1</version>
        </dependency>

        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-project</artifactId>
            <version>2.0.1</version>
        </dependency>

        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-artifact</artifactId>
            <version>${maven-artifact.version}</version>
        </dependency>

        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-artifact-manager</artifactId>
            <version>${maven-artifact-manager.version}</version>
        </dependency>

        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-model</artifactId>
            <version>${maven-model.version}</version>
        </dependency>

        <dependency>
            <groupId>org.codehaus.plexus</groupId>
            <artifactId>plexus-utils</artifactId>
            <version>${plexus-utils.version}</version>
        </dependency>

        <dependency>
            <groupId>org.apache.maven.wagon</groupId>
            <artifactId>wagon-provider-api</artifactId>
            <version>${wagon-provider-api.version}</version>
        </dependency>

        <dependency>
            <groupId>dom4j</groupId>
            <artifactId>dom4j</artifactId>
            <version>${dom4j.version}</version>
        </dependency>

        <dependency>
            <groupId>org.apache.maven.shared</groupId>
            <artifactId>maven-plugin-testing-harness</artifactId>
            <version>1.0-beta-1</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>jmock</groupId>
            <artifactId>jmock</artifactId>
            <version>${jmock.version}</version>
            <scope>test</scope>
        </dependency>


        <dependency>
            <groupId>commons-configuration</groupId>
            <artifactId>commons-configuration</artifactId>
            <version>${commons-configuration.version}</version>
        </dependency>

        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
            <version>2.1</version>
        </dependency>

        <dependency>
            <groupId>org.json</groupId>
            <artifactId>json</artifactId>
            <version>${json.version}</version>
        </dependency>

        <!--  itext -->
        <dependency>
            <groupId>com.itextpdf</groupId>
            <artifactId>itextpdf</artifactId>
            <version>5.1.2</version>
        </dependency>

        <dependency>
            <groupId>com.itextpdf</groupId>
            <artifactId>itext-xtra</artifactId>
            <version>5.1.2</version>
        </dependency>

        <dependency>
            <groupId>com.itextpdf.tool</groupId>
            <artifactId>xmlworker</artifactId>
            <version>1.1.0</version>
        </dependency>

        <dependency>
            <groupId>org.xhtmlrenderer</groupId>
            <artifactId>core-renderer</artifactId>
            <version>R8</version>
        </dependency>

        <dependency>
            <groupId>com.fasterxml</groupId>
            <artifactId>classmate</artifactId>
            <version>0.5.4</version>
        </dependency>

        <dependency>
            <groupId>net.sourceforge.htmlcleaner</groupId>
            <artifactId>htmlcleaner</artifactId>
            <version>2.2</version>
        </dependency>

        <dependency>
            <groupId>net.sf.jasperreports</groupId>
            <artifactId>jasperreports</artifactId>
            <version>5.1.0</version>
        </dependency>

        <dependency>
            <groupId>com.lowagie</groupId>
            <artifactId>itext</artifactId>
            <version>2.1.7</version>
        </dependency>


        <dependency>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>jasperreports-maven-plugin</artifactId>
            <version>1.0-beta-2</version>
            <exclusions>
                 <exclusion>
                    <artifactId>plexus-container-default</artifactId>
                    <groupId>org.codehaus.plexus</groupId>
                </exclusion>
                <exclusion>
                    <groupId>jasperreports</groupId>
                    <artifactId>jasperreports</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
          <groupId>junit</groupId>
          <artifactId>junit</artifactId>
          <version>4.9</version>
        </dependency>

  </dependencies>

     <build>
        <plugins>
            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-compiler-plugin</artifactId>
              <version>3.1</version>
              <executions>
                    <execution>
                        <phase>validate</phase>
                        <goals>
                            <goal>compile</goal>
                        </goals>
                        <configuration>
                            <source>1.6</source>
                            <target>1.6</target>
                        </configuration>
                    </execution>
                   </executions>
        </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>jasperreports-maven-plugin</artifactId>
                <version>1.0-beta-2</version>
                <executions>
                    <execution>
                        <phase>validate</phase>
                        <inherited>false</inherited>
                        <goals>
                            <goal>compile-reports</goal>
                        </goals>
                        <configuration>
<!--                             define where is your jrxml file -->
                            <sourceDirectory>src\\main\\resources</sourceDirectory>
                            <sourceFileExt>.jrxml</sourceFileExt>
                            <compiler>net.sf.jasperreports.engine.design.JRJavacCompiler</compiler>
<!--                             define where is the jasper file will be generated -->
                            <outputDirectory>src\\main\\resources</outputDirectory>
                        </configuration>
                    </execution>
                </executions>
                <dependencies>
<!--                     Note this must be repeated here to pick up correct xml validation -->

                    <dependency>
                        <groupId>net.sf.jasperreports</groupId>
                        <artifactId>jasperreports</artifactId>
                        <version>5.1.0</version>
                    </dependency>

                    <dependency>
                        <groupId>log4j</groupId>
                        <artifactId>log4j</artifactId>
                        <version>1.2.16</version>
                    </dependency>

                </dependencies>
            </plugin>

        </plugins>
    </build>

</project>

推荐答案

对于使用JasperReports 5.x maven依赖项时遇到类似问题的任何人:

For anyone having similar issues when using the JasperReports 5.x maven dependencies:

碧玉小伙经营着公共Maven存储库他们在哪里发布针对其第三方依赖项的错误修复程序.这些固定版本并不总是存在于公共Maven仓库中.因此,当您在依赖项方面遇到问题时,请尝试添加存储库 http://jasperreports.sourceforge.net/maven2.

The jasper guys run a public maven repository where they publish bug fixes to their third party dependencies. These fixed versions are not always present in the public maven repo. So when you have problems with dependencies try to add the repository http://jasperreports.sourceforge.net/maven2.

这篇关于jasperreport 5.0.1需要添加哪些依赖项?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆