IText Integration Libraries

Seam iText Integration seems to use older version of iText jars, is it possible to use latest jQuery version 5.0.0 as part of maven dependencies. Has anyone done this before?

http://repository.jboss.org/maven2/org/jboss/seam/jboss-seam-pdf/2.2.0.GA/jboss-seam-pdf-2.2.0.GA.pom http: //repository.jboss .org / maven2 / com / lowagie / itext / 2.1.2 / itext-2.1.2.pom

The following dependency is using the 2.1.2 version of iText, not sure how to get it to use the latest 5.0.2 iText.

        <dependency>
            <groupId>org.jboss.seam</groupId>
            <artifactId>jboss-seam-pdf</artifactId>
            <version>${jboss-seam.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>org.jboss.seam</groupId>
                    <artifactId>jboss-seam</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.jboss.seam</groupId>
                    <artifactId>jboss-seam-ui</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

      

+2


a source to share


1 answer


The following dependency is using the 2.1.2 version of iText, not sure how to get it to use the latest 5.0.2 iText.

First, it has the following dependencies (skipping exceptions, refer to the root POM for full details): jboss-seam-pdf-2.2.0.GA.jar

org.jboss.seam:root:2.2.0.GA.pom

<dependency>
  <groupId>com.lowagie</groupId>
  <artifactId>itext</artifactId>
  <version>2.1.2</version>
  ...
</dependency>
<dependency>
  <groupId>com.lowagie</groupId>
  <artifactId>itext-rtf</artifactId>
  <version>2.1.2</version>
  ...
</dependency>

      

Second, the only itext 5.0.2 artifact found is the one mentioned in this thread (and available in the repository http://maven.itextpdf.com/ ):

<dependency>
  <groupId>com.itextpdf</groupId>
  <artifactId>itextpdf</artifactId>
  <version>5.0.2</version>
</dependency>

      



As we can see, it has different groupId

and artifactId

than previous itext dependencies, so we cannot use dependencyManagement

Maven <here> to force this version (assuming this artifact replaces the previous one, I am not aware of that). So this leaves us with exclusions

. Something like that:

<project>
  ...
  <properties>
    <jboss-seam.version>2.2.0.GA</jboss-seam.version>
  </properties>
  <repositories>
    <repository>
      <id>itext</id>
      <url>http://maven.itextpdf.com</url>
    </repository>
    <repository>
      <id>jboss</id>
      <url>http://repository.jboss.org/maven2</url>
    </repository>
  </repositories>
  <dependencies>
    ...
    <dependency>
      <groupId>org.jboss.seam</groupId>
      <artifactId>jboss-seam-pdf</artifactId>
      <version>${jboss-seam.version}</version>
      <exclusions>
        <exclusion>
          <groupId>org.jboss.seam</groupId>
          <artifactId>jboss-seam</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.jboss.seam</groupId>
          <artifactId>jboss-seam-ui</artifactId>
        </exclusion>
        <exclusion>
          <groupId>com.lowagie</groupId>
          <artifactId>itext</artifactId>
        </exclusion>
        <exclusion>
          <groupId>com.lowagie</groupId>
          <artifactId>itext-rtf</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>com.itextpdf</groupId>
      <artifactId>itextpdf</artifactId>
      <version>5.0.2</version>
    </dependency>
  </dependencies>
</project>

      

With this, the POM dependency tree becomes:

$ mvn dependency: tree
...
[INFO] [dependency: tree {execution: default-cli}]
[INFO] com.statckoverflow: Q2793234: jar: 1.0-SNAPSHOT
[INFO] + - junit: junit: jar: 3.8.1: test
[INFO] + - org.jboss.seam: jboss-seam-pdf: jar: 2.2.0.GA: compile
[INFO] | \ - com.sun.facelets: jsf-facelets: jar: 1.1.15.B1: compile
[INFO] \ - com.itextpdf: itextpdf: jar: 5.0.2: compile
...

I'm not saying this will work at runtime, I'm just giving you the option to replace the dependency with Maven.

+4


a source







All Articles