使用Spring和Eclipse构建Web应用程序的问题

时间:2017-10-26 04:49:21

标签: spring eclipse maven

我需要帮助解决Spring和Eclipse的问题。我试过解决其他一些问题,但这个问题很奇怪,我无法解决。

我正在尝试使用Spring和Eclipse构建一个Web应用程序,但它在pom.xml文件中显示错误。我附上了pom.xml文件。

  

未能从http://repo.maven.apache.org/maven2转移org.apache.maven.plugins:maven-surefire-plugin:pom:2.18.1    缓存在本地存储库中,在中心的更新间隔过去之前,不会重新尝试解析    更新是强制的。原始错误:无法传输工件org.apache.maven.plugins:maven-surefire-plugin:pom:2.18.1    从/到中心(http://repo.maven.apache.org/maven2):null到http://repo.maven.apache.org/maven2/org/apache/maven/    插件/行家-万无一失-插件/ 2.18.1 /行家-万无一失-插件-2.18.1.pom"

The attached file

这是我的pom的全部内容;

http://maven.apache.org/xsd/maven-4.0.0.xsd">     4.0.0

<groupId>com.userFront</groupId>
<artifactId>userFront</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>

<name>UserFront</name>
<description>User Frontend for Online Banking Project</description>

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>1.5.8.RELEASE</version>
    <relativePath/> <!-- lookup parent from repository -->
</parent>

<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    <java.version>1.8</java.version>
</properties>

<dependencies>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
    </dependency>

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-test</artifactId>
        <scope>test</scope>
    </dependency>
</dependencies>

<build>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
        </plugin>
    </plugins>
    <pluginManagement>
        <plugins>
            <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
            <plugin>
                <groupId>org.eclipse.m2e</groupId>
                <artifactId>lifecycle-mapping</artifactId>
                <version>1.0.0</version>
                <configuration>
                    <lifecycleMappingMetadata>
                        <pluginExecutions>
                            <pluginExecution>
                                <pluginExecutionFilter>
                                    <groupId>
                                        org.apache.maven.plugins
                                    </groupId>
                                    <artifactId>
                                        maven-compiler-plugin
                                    </artifactId>
                                    <versionRange>
                                        [3.1,)
                                    </versionRange>
                                    <goals>
                                        <goal>testCompile</goal>
                                    </goals>
                                </pluginExecutionFilter>
                                <action>
                                    <ignore></ignore>
                                </action>
                            </pluginExecution>
                        </pluginExecutions>
                    </lifecycleMappingMetadata>
                </configuration>
            </plugin>
        </plugins>
    </pluginManagement>
</build>

2 个答案:

答案 0 :(得分:0)

右键单击您的项目。选择Maven ==&gt;更新项目==&gt;选中(启用复选框)强制更新快照/发布。

答案 1 :(得分:0)

您只需按照以下步骤操作:

右键单击您的项目:运行(As) - &gt; Maven清洁

右键单击您的项目:运行(As) - &gt; Maven安装

与此question

相同