JSF dependency conflict with Maven

Asked

Viewed 511 times

0

I created a Maven project in Eclipse with JSF 2, project has been evolving well, running on Tomcat 8 smoothly and that’s where I started implementing the reports so I put the dependencies for Jasper as code below, from there Tomcat does not go up, I understand that this is conflict of my dependencies and that I need to delete so I already searched the documentation and I saw videos on the subject but I was not successful.

In this project use Spring Security, Hibernate etc....

    <dependency>
        <groupId>net.sf.jasperreports</groupId>
        <artifactId>jasperreports</artifactId>
        <version>6.0.3</version>
        <scope>compile</scope>
    </dependency>

    <dependency>
        <groupId>net.sf.jasperreports</groupId>
        <artifactId>jasperreports-fonts</artifactId>
        <version>6.0.0</version>
        <scope>compile</scope>
    </dependency>

I’ve looked at the hierarchy of pom ( what is not easy mine ), Here follows my complete dependencies without putting Jasper and then the project goes up without problems if someone can give a hint of how I can proceed thank.

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

    <!-- Java -->
    <java.version>1.8</java.version>

    <!-- Primefaces -->
    <primefaces.version>6.0</primefaces.version>

    <!-- Hibernate / JPA -->
    <hibernate.version>4.3.10.Final</hibernate.version>

    <!-- Validator -->
    <validator.version>5.2.3.Final</validator.version>        

    <!-- Weld - Implementação do CDI -->
    <weld.version>2.3.5.Final</weld.version>

    <!-- JSF Version -->
    <javax.faces.version>2.2.10</javax.faces.version>

</properties>

<repositories>
    <repository>
        <id>prime-repo</id>
        <name>PrimeFaces Maven Repository</name>
        <url>http://repository.primefaces.org</url>
        <layout>default</layout>
    </repository>
</repositories>

<dependencies>

    <dependency>
        <groupId>org.primefaces</groupId>
        <artifactId>primefaces</artifactId>
        <version>${primefaces.version}</version>
        <scope>compile</scope>
    </dependency>

    <dependency>
        <groupId>org.primefaces.themes</groupId>
        <artifactId>bootstrap</artifactId>
        <version>1.0.10</version>
        <scope>compile</scope>
    </dependency>

    <dependency>
        <groupId>org.primefaces.themes</groupId>
        <artifactId>bluesky</artifactId>
        <version>1.0.10</version>
        <scope>compile</scope>
    </dependency>

    <!-- Usado para geração de arquivos Excel -->
    <dependency>
        <groupId>org.apache.poi</groupId>
        <artifactId>poi</artifactId>
        <version>3.11</version>
        <scope>compile</scope>
    </dependency>

    <dependency>
        <groupId>org.glassfish</groupId>
        <artifactId>javax.faces</artifactId>
        <version>${javax.faces.version}</version>
        <scope>compile</scope>
    </dependency>

    <dependency>
        <groupId>org.jboss.weld.servlet</groupId>
        <artifactId>weld-servlet</artifactId>
        <version>${weld.version}</version>
        <scope>compile</scope>
    </dependency>

    <!-- Weld depende do Jandex -->
    <dependency>
        <groupId>org.jboss</groupId>
        <artifactId>jandex</artifactId>
        <version>2.0.2.Final</version>
        <scope>compile</scope>
    </dependency>

    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-validator</artifactId>
        <version>${validator.version}</version>
        <scope>compile</scope>
        <exclusions>
            <exclusion>
                <groupId>org.jboss.logging</groupId>
                <artifactId>jboss-logging</artifactId>
            </exclusion>
        </exclusions>
    </dependency>

    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-core</artifactId>
        <version>${hibernate.version}</version>
        <scope>compile</scope>
    </dependency>


    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-entitymanager</artifactId>
        <version>${hibernate.version}</version>
        <scope>compile</scope>
    </dependency>

    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>javax.servlet-api</artifactId>
        <version>3.1.0</version>
        <scope>provided</scope>
    </dependency>

    <!-- Spring Security (autenticação e autorização) -->
    <dependency>
        <groupId>org.springframework.security</groupId>
        <artifactId>spring-security-core</artifactId>
        <version>3.2.5.RELEASE</version>
    </dependency>
    <dependency>
        <groupId>org.springframework.security</groupId>
        <artifactId>spring-security-web</artifactId>
        <version>3.2.5.RELEASE</version>
    </dependency>
    <dependency>
        <groupId>org.springframework.security</groupId>
        <artifactId>spring-security-config</artifactId>
        <version>3.2.5.RELEASE</version>
    </dependency>

    <!-- Database dependencies -->

    <!-- PostgresSQL dependencies -->
    <dependency>
        <groupId>commons-dbcp</groupId>
        <artifactId>commons-dbcp</artifactId>
        <version>1.3</version>
        <exclusions>
            <exclusion>
                <groupId>commons-logging</groupId>
                <artifactId>commons-logging</artifactId>
            </exclusion>
            <exclusion>
                <groupId>xml-apis</groupId>
                <artifactId>xml-apis</artifactId>
            </exclusion>
        </exclusions>
    </dependency>

    <dependency>
        <groupId>postgresql</groupId>
        <artifactId>postgresql</artifactId>
        <version>9.1-901.jdbc4</version>
        <scope>provided</scope>
    </dependency>

    <!-- retrofit -->
    <dependency>
        <groupId>com.squareup.retrofit</groupId>
        <artifactId>retrofit</artifactId>
        <version>1.9.0</version>
    </dependency>

    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.11</version>
        <scope>test</scope>
    </dependency>

    <!-- SLF4J <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-log4j12</artifactId> 
        <version>1.7.7</version> </dependency> -->
    <!-- Commons Logging (abstrai a implementação de logging) -->
    <dependency>
        <groupId>commons-logging</groupId>
        <artifactId>commons-logging</artifactId>
        <version>1.1.3</version>
        <scope>compile</scope>
    </dependency>

    <!-- Commons Lang (utilidades) -->
    <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-lang3</artifactId>
        <version>3.1</version>
        <scope>compile</scope>
    </dependency>

    <!-- Log4J -->
    <dependency>
        <groupId>log4j</groupId>
        <artifactId>log4j</artifactId>
        <version>1.2.17</version>
        <scope>compile</scope>
    </dependency>


    <!-- omnifaces -->
    <dependency>
        <groupId>org.omnifaces</groupId>
        <artifactId>omnifaces</artifactId>
        <version>1.14</version>
    </dependency>

    <dependency>
        <groupId>org.easymock</groupId>
        <artifactId>easymock</artifactId>
        <version>3.4</version>
        <scope>test</scope>
    </dependency>

    <!--google gson -->
    <dependency>
        <groupId>com.google.code.gson</groupId>
        <artifactId>gson</artifactId>
        <version>2.6.2</version>
    </dependency>

    <dependency>
        <groupId>commons-io</groupId>
        <artifactId>commons-io</artifactId>
        <version>2.4</version>
        <scope>compile</scope>
    </dependency>


</dependencies>

1 answer

1

Use the tag exclusions Maven. If you are using Eclipse as an IDE.

For example: in the tab Dependency Hierarchy you can see all tree-shaped dependencies.

If any dependency appears more than once give preference to the most current and "delete" the obsolete.

    <dependency>
        <groupId>com.group.name</groupId>
        <artifactId>project</artifactId>
        <version>1.0.0</version>
        <exclusions>
            <exclusion>
                <groupId>com.anothergroup.name</groupId>
                <artifactId>projeto-em-conflito</artifactId>
                <version>1.0.0</version>
            </exclusion>
        </exclusions>
    </dependency>

Browser other questions tagged

You are not signed in. Login or sign up in order to post.