Jasper Reports的Maven存储库是什么?

时间:2011-05-24 17:13:14

标签: maven-2 maven jasper-reports

在哪里可以找到最新版本的Jasper Reports的Maven存储库?我已经尝试过在主站点,但似乎回购不是最新的。

4 个答案:

答案 0 :(得分:27)

这是最新版本:

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

还有一个非常好的插件可以自动将jrxml文件编译为jasper。只需将以下内容放入您的pom中,并将您的jrxml文件放在src / main / jasperreports中

<project>

<properties>
    <jasperReport.version>5.2.0</jasperReport.version>
</properties>

  ...
  <dependencies>
    <dependency>
      <groupId>net.sf.jasperreports</groupId>
      <artifactId>jasperreports</artifactId>
      <version>${jasperReport.version}</version>
    </dependency>
  </dependencies>
  <build>
  ...
  <plugins>
    ...
    <plugin>
      <groupId>org.codehaus.mojo</groupId>
      <artifactId>jasperreports-maven-plugin</artifactId>
      <executions>
        <execution>
          <goals>
            <goal>compile-reports</goal>
          </goals>
        </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>${jasperReport.version}</version>
        </dependency>
      </dependencies>
    </plugin>
   </plugins>
 </build>
</project>

来源:http://www.mojohaus.org/jasperreports-maven-plugin/usage.html

答案 1 :(得分:8)

您可以在以下存储库中找到工件:

http://repository.jboss.org/nexus/content/groups/public-jboss/net/sf/jasperreports/jasperreports/

http://mirrors.ibiblio.org/maven2/net/sf/jasperreports/jasperreports/

http://repo1.maven.org/maven2/net/sf/jasperreports/jasperreports/

当然,其他存储库也包含这些工件。

顺便说一下,如果你使用jasper报告

<groupId>net.sf.jasperreports</groupId>
<artifactId>jasperreports</artifactId>
<version>6.2.0</version>

并且你是一个代理或在商业环境中使用Maven Enterprise Repository会给你一些麻烦,因为它定义了自己的存储库列表,这几乎是不行的。我引用了pom的代码:

<repositories>
    <repository>
        <id>jasperreports</id>
        <url>http://jasperreports.sourceforge.net/maven2</url>
    </repository>
    <repository>
        <id>jaspersoft-third-party</id>
        <url>http://jaspersoft.artifactoryonline.com/jaspersoft/third-party-ce-artifacts/</url>
    </repository>
</repositories>

您的maven客户端将尝试直接访问这些存储库。 要避免此事,请查看此票证How do you configure maven to ignore repositories specified in POM files?

答案 2 :(得分:2)

在Maven中心,最新版本是4.0.1: http://repo2.maven.org/maven2/net/sf/jasperreports/jasperreports/

注意groupid net.sf.jasperreports

答案 3 :(得分:1)

面对与v5.1.0相同的问题并使用它来运行:

    <dependency> <!-- needed by jasperreports to build-->
            <groupId>com.lowagie</groupId>
            <artifactId>itext</artifactId>
            <version>2.1.7</version>
    </dependency>

    <dependency> <!-- refered from http://mojo.codehaus.org/jasperreports-maven-plugin/usage.html -->
        <groupId>net.sf.jasperreports</groupId>
            <artifactId>jasperreports</artifactId>
            <version>5.1.0</version>
        </dependency>


<plugins>
...
<plugin>
  <groupId>org.codehaus.mojo</groupId>
  <artifactId>jasperreports-maven-plugin</artifactId>
  <executions>
    <execution>
      <goals>
        <goal>compile-reports</goal>
      </goals>
    </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>
  </dependencies>
</plugin>