Maven本地依赖性身份验证错误

时间:2017-08-07 12:17:03

标签: maven netbeans jsf-2

我有一个使用JSF的{​​{1}}应用,我在其中创建了Primefaces用于演示文稿的自定义主题。主题放在Primefaces文件中,我已将其添加为本地JAR依赖项。

经过几个月的不接触代码,我今天做了一些小改动。在尝试构建应用程序时,我收到一条错误消息:

  

无法读取nivis2的工件描述符:nivis2:jar:2:无法传输工件......等等。

尝试在Maven中展示Artifact details时,我会收到更多信息:

  

解决项目工件时出错:无法传输工件   nivis2:nivis2:pom:2来自PrimeFaces-maven-lib   (http://repository.primefaces.org/):对等体未经过身份验证   project nivis2:nivis2:jar:2

POM:

NetBeans

目录:

enter image description here

<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>com.nivis</groupId> <artifactId>idre_mk2</artifactId> <version>1.0-SNAPSHOT</version> <packaging>war</packaging> <name>idre_mk2</name> <properties> <endorsed.dir>${project.build.directory}/endorsed</endorsed.dir> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> </properties> <dependencies> <dependency> <groupId>commons-configuration</groupId> <artifactId>commons-configuration</artifactId> <version>1.10</version> </dependency> <dependency> <groupId>org.primefaces</groupId> <artifactId>primefaces</artifactId> <version>5.2</version> </dependency> <dependency> <groupId>nivis2</groupId> <artifactId>nivis2</artifactId> <version>2</version> </dependency> <dependency> <groupId>javax</groupId> <artifactId>javaee-web-api</artifactId> <version>7.0</version> <scope>provided</scope> </dependency> <dependency> <groupId>org.jsoup</groupId> <artifactId>jsoup</artifactId> <version>1.7.2</version> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-api</artifactId> <version>1.7.12</version> </dependency> <dependency> <groupId>javax.mail</groupId> <artifactId>javax.mail-api</artifactId> <version>1.5.4</version> </dependency> <!-- Shiro dependencies: --> <dependency> <groupId>org.apache.shiro</groupId> <artifactId>shiro-core</artifactId> <version>1.2.4</version> </dependency> <dependency> <groupId>org.apache.shiro</groupId> <artifactId>shiro-web</artifactId> <version>1.2.4</version> <!--<classifier>sources</classifier>--> </dependency> <dependency> <groupId>commons-logging</groupId> <artifactId>commons-logging</artifactId> <version>1.2</version> </dependency> <dependency> <groupId>commons-beanutils</groupId> <artifactId>commons-beanutils</artifactId> <version>1.9.2</version> </dependency> <dependency> <groupId>org.omnifaces</groupId> <artifactId>omnifaces</artifactId> <version>2.1</version> <!--<classifier>sources</classifier>--> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.1</version> <configuration> <source>1.7</source> <target>1.7</target> <compilerArguments> <endorseddirs>${endorsed.dir}</endorseddirs> </compilerArguments> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <version>2.3</version> <configuration> <failOnMissingWebXml>false</failOnMissingWebXml> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-dependency-plugin</artifactId> <version>2.6</version> <executions> <execution> <phase>validate</phase> <goals> <goal>copy</goal> </goals> <configuration> <outputDirectory>${endorsed.dir}</outputDirectory> <silent>true</silent> <artifactItems> <artifactItem> <groupId>javax</groupId> <artifactId>javaee-endorsed-api</artifactId> <version>7.0</version> <type>jar</type> </artifactItem> </artifactItems> </configuration> </execution> </executions> </plugin> </plugins> </build> <repositories> <repository> <url>http://repository.primefaces.org/</url> <id>PrimeFaces-maven-lib</id> <layout>default</layout> <name>Repository for library PrimeFaces-maven-lib</name> </repository> </repositories> </project> 文件包含以下信息:

nivis2-2.pom.lastUpdated

我还没有真正改变任何内容,而且我不确定如何解释错误消息 - 它是否尝试将我的JAR文件复制到外部#NOTE: This is an internal implementation file, its format can be changed without prior notice. #Mon Aug 07 13:49:13 CEST 2017 default-http\://repository.primefaces.org/.lastUpdated=1502106553736 http\://repo.maven.apache.org/maven2/.lastUpdated=1502105030633 http\://repository.primefaces.org/.error=Could not transfer artifact nivis2\:nivis2\:pom\:2 from/to PrimeFaces-maven-lib (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 存储库?为什么现在突然间呢?

不管。我只需要能够使用自定义Primefaces主题,也许还有比这更好的方法吗?

2 个答案:

答案 0 :(得分:0)

你正在执行哪个maven目标? 如果您运行mvn clean deploy,请改为使用mvn clean install

安装目标将构建的工件放在用户主目录下.m2文件夹下的本地存储库中,部署目标用于将工件部署到远程存储库。

答案 1 :(得分:0)

谢谢大家的帮助。我最终通过安装最新版本的Netbeans并重新创建POM来实现它。我不知道这个问题中的哪一个或两者首先解决了这个问题,或者究竟是什么导致了它,但现在它可以解决了。

再次感谢你花时间研究我的问题。