Solucionado (ver solução)
Solucionado
(ver solução)
5
respostas

Livraria + maven

Olá, Passei meu projeto Livraria para o Maven assim como foi mostrado na aula, mas surgiu esse erro!

[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building Livraria Alura 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] Downloading: http://repository.primefaces.org/org/primefaces/themes/all-themes/1.0.10/all-themes-1.0.10.pom
[INFO] Downloading: https://repo.maven.apache.org/maven2/org/primefaces/themes/all-themes/1.0.10/all-themes-1.0.10.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 7.846 s
[INFO] Finished at: 2017-08-16T01:22:23-03:00
[INFO] Final Memory: 10M/80M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project livraria-maven: Could not resolve dependencies for project br.com.caelum:livraria-maven:war:0.0.1-SNAPSHOT: Failed to collect dependencies at org.primefaces.themes:all-themes:jar:1.0.10: Failed to read artifact descriptor for org.primefaces.themes:all-themes:jar:1.0.10: Could not transfer artifact org.primefaces.themes:all-themes:pom:1.0.10 from/to prime-repo (http://repository.primefaces.org): sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException

Parece que o maven não consegue encontrar o Theme do primeface, já tentei de farias formas mas não consegui, poderiam me ajudar?

Segue meu POM.xml ao qual peguei já pronto do curso.

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>br.com.caelum</groupId>
    <artifactId>livraria-maven</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <packaging>war</packaging>
    <name>Livraria Alura</name>
    <properties>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
    </properties>
    <dependencies>
        <dependency>
            <groupId>org.jboss.weld.servlet</groupId>
            <artifactId>weld-servlet</artifactId>
            <version>2.3.3.Final</version>
        </dependency>
        <dependency>
            <groupId>javax.validation</groupId>
            <artifactId>validation-api</artifactId>
            <version>1.1.0.Final</version>
        </dependency>
        <dependency>
            <groupId>org.primefaces</groupId>
            <artifactId>primefaces</artifactId>
            <version>5.3</version>
        </dependency>
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <version>5.1.38</version>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-entitymanager</artifactId>
            <version>5.1.0.Final</version>
        </dependency>
        <dependency>
            <groupId>com.sun.faces</groupId>
            <artifactId>jsf-api</artifactId>
            <version>2.2.13</version>
        </dependency>
        <dependency>
            <groupId>com.sun.faces</groupId>
            <artifactId>jsf-impl</artifactId>
            <version>2.2.13</version>
        </dependency>
        <dependency>
            <groupId>org.primefaces.themes</groupId>
            <artifactId>all-themes</artifactId>
            <version>1.0.10</version>
        </dependency>
    </dependencies>
    <repositories>
        <repository>
            <id>prime-repo</id>
            <name>PrimeFaces Maven Repository</name>
            <url>http://repository.primefaces.org</url>
            <layout>default</layout>
        </repository>
    </repositories>
</project>
5 respostas

Oi Felipe, tudo bem?

O erro acontece porque quando as dependencias estavam sendo baixadas, alguma(s) deve(m) ter sido corrompida(s). Uma possível solução é ir na pasta .m2 e deletar tudo que ela tem. Depois disso clicar com o botão esquerdo no projeto e atualizar pelo Maven. Dessa forma você força o maven a baixar tudo de novo.

Veja se isso resolve o seu problema =)

solução!

Felipe,

pelo que vi na internet, parece que você deverá atualizar se jdk para o 1.8.0_131-XXX , veja

https://stackoverflow.com/questions/42783796/sun-security-validator-validatorexception-dependency-failing/42809816

Samir e Jefferson, eu fiz os dois procedimentos, atualizei o JDK para ultima versão e deletei tudo da pasta .m2 pra depois dar update pelo maven, mas agora quando tento gerar o package, esta dando outro erro.

[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building Templarios232 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[WARNING] The POM for org.primefaces.themes:all-themes:jar:1.0.8 is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.797 s
[INFO] Finished at: 2017-08-16T13:16:55-03:00
[INFO] Final Memory: 7M/113M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project Templarios232: Could not resolve dependencies for project br.com.escola:Templarios232:war:0.0.1-SNAPSHOT: Failure to find org.primefaces.themes:all-themes:jar:1.0.8 in https://repository.jboss.org/nexus/content/groups/public/ was cached in the local repository, resolution will not be reattempted until the update interval of JBoss Repository has elapsed or updates are forced -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException

Felipe, você mudou o nome do projeto??

Era livraria, ok ?? Agora é Templarios232 ??

E não tem a versão 1.0.8 do all-themes. Só tem a partir da 1.0.9

https://repository.primefaces.org/org/primefaces/themes/all-themes/

Olá Jefferson, é que eu troquei de projeto mesmo, mas referente ao erro, eu atualizei o JDK na minha maquina e as dependecias baixaram normalmente, agradeço!