What are the Maven repositories for Jasper Reports? [closed]

北慕城南 提交于 2021-02-06 09:40:08

问题


Where can I find the Maven repositories for the latest versions of Jasper Reports? I've tried in the main site but it seems that the repo isn't up to date.


回答1:


This is the latest version:

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

There is also a pretty nice plugin to compile jrxml files to jasper automatically. Just put the following in your pom and your jrxml files in 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>

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




回答2:


You find the artifacts in the following repositories:

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/

Surely other repositories contain those artifacts too.

By the way, if you use the jasper reports

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

and you are behind a proxy or use in a commercial environment a Maven Enterprise Repository it will give you some troubles, as it defines its own list of repositories, which is almost a no-go. I quote the code of the 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>

Your maven client will try to access those repositories directly. To avoid this matter have a look at this ticket How do you configure maven to ignore repositories specified in POM files?




回答3:


In Maven central the latest version is 4.0.1: http://repo2.maven.org/maven2/net/sf/jasperreports/jasperreports/

Note the groupid net.sf.jasperreports




回答4:


Faced same issue with v5.1.0 and got it working using:

    <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>



来源:https://stackoverflow.com/questions/6114232/what-are-the-maven-repositories-for-jasper-reports

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!