Spring MVC项目上的“缺少工件”和“无法读取工件描述符”错误 - java

我在Spring MVC项目中遇到多个“缺少工件”和“无法读取工件描述符”的错误,例如:

Missing artifact com.google.guava:guava:jar:20.0
Failed to read artifact descriptor for com.brooksandrus:swfheader:jar:1.0

我想知道:

他们到底是什么意思
如何解决它们

我对这些错误的看法:

另外,我正在公司防火墙后面运行项目这一事实可能与maven clean install失败并出现以下错误有关:PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
实际上,这是通过在cacerts文件中安装每个必需的证书解决的。

我已经尝试过的

更新已选中“强制更新快照”的Maven项目。
删除整个.m2文件夹,然后尝试进行Maven更新。
按照this SO solution在cacerts文件上添加证书,然后重新运行前两个步骤。这实际上是我解决此错误unable to find valid certification path to requested target的方式,尽管它并没有解决我提到的有关“缺少工件”和“无法读取工件描述符”的主要问题。

这些方法均未对问题产生任何影响。

另一个重要的事实是,除了所有这些错误之外,Tomcat可以成功启动,并且项目可以正常运行。

这是pom文件的示例部分。

<?xml version="1.0" encoding="UTF-8"?>
<project
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
    xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <modelVersion>4.0.0</modelVersion>
    <groupId>gr.xxxxxx</groupId>
    <artifactId>xxxxxx</artifactId>
    <version>2.2.7</version>
    <packaging>war</packaging>
    <name>xxxxxx</name>
    <description>xxxxxx</description>
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <spring.version>4.3.23.RELEASE</spring.version>
        <spring.security.version>4.2.12.RELEASE</spring.security.version>
        <hibernate.version>4.1.4.Final</hibernate.version>
        <build.plugins.plugin.version.compiler>3.3</build.plugins.plugin.version.compiler>
        <build.plugins.plugin.version.javadoc>2.10.3</build.plugins.plugin.version.javadoc>
        <junit.version>4.11</junit.version>
        <hamcrest.version>1.3</hamcrest.version>
        <tika.version>1.7</tika.version>
        <mockito.version>1.10.19</mockito.version>
        <doclava.version>1.0.6</doclava.version>
        <adwords.version>4.7.0</adwords.version>
        <hikari.version>3.3.1</hikari.version>
        <mariadb.version>2.4.2</mariadb.version>        
        <thymeleaf.version>3.0.11.RELEASE</thymeleaf.version>
        <stagemonitor.version>0.88.10</stagemonitor.version>
        <javamelody.version>1.79.0</javamelody.version>
        <dynamicreports.version>5.0.0</dynamicreports.version>
        <timestamp>${maven.build.timestamp}</timestamp>
        <maven.build.timestamp.format>dd/MM/yyyy HH:mm</maven.build.timestamp.format>
    </properties>
    <repositories>
        <repository>
            <id>jsqlparser-snapshots</id>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
            <url>https://oss.sonatype.org/content/groups/public/</url>
        </repository>
        <repository>
            <id>mulesoft-releases</id>
            <name>MuleSoft Releases Repository</name>
            <url>http://repository.mulesoft.org/releases/</url>
            <layout>default</layout>
        </repository>

任何有关如何处理此问题的想法都将受到赞赏。

参考方案

首先,从命令行运行mvn始终是一个好主意。它可以将问题与IDE隔离开,并在maven解决工件时显示日志。

另外,您可以添加-X CLI option产生更多的调试输出,并且应该看到一些有用的错误:

mvn clean install -X

Spring Boot删除Web应用程序的Whitelabel错误页面 - java

我有一个spring boot Web应用程序,正在将它作为war文件部署在tomcat中。我不希望用户显示白色标签错误页面。我对此有所进步,但需要将其重新定向到错误页面。下面的代码是/ error白色标签错误页面是自定义错误消息。但是我希望将其重定向到我的Web应用程序资源中模板文件夹下的error.jsp或error.html。我尝试将@RestCont…

Spring Boot索引未加载 - java

我有一个Spring Boot应用程序。我没有使用@EnableWebMvc,并且我的资源在src/main/resources/static文件夹中。当我尝试加载localhost:8080/ui/时,它只是下载一个随机文件(类型:八位字节流)。如果我直接使用/ui/index.html则可以。我也在使用WebSecurityConfigurerAdapt…

Spring MVC拦截器映射问题 - java

我有这段XML:<mvc:interceptors> <mvc:interceptor> <mvc:mapping path="/statics/**" /> <bean class="com.company.website.servlet.StaticsHandlerIntercept…

Heroku Spring Boot Web服务始终返回404,但不在本地主机上 - java

我已经开发了一个Web服务,正在尝试将其部署到Heroku。看来成功了,尽管每当我尝试调用我的URL之一时,我都会得到一个404。我知道这意味着资源不可用,但在localhost上运行良好。Heroku部署的输出是标准的Spring引导,但缺少以下内容:2016-05-23 22:29:22.145 INFO 15785 --- [ main] s.w.s.…

在Maven中创建模块 - java

我创建了这个maven子项目,它将包含项目的域对象: <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-start…