pom.xml中的spring boot启动错误

时间:2018-03-02 17:19:39

标签: spring-boot

我在Eclipse Oxygen创建了一个带有java 8的STS的春季启动项目。 我在pom属性中遇到错误。

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

在错误中显示在pom中的父属性的eclipse中

生命周期configuration: org.apache.maven.plugins:maven-compiler-plugin:3.1:testCompile (execution: default-testCompile, phase: test-compile)

未涵盖插件执行
  

CoreException:无法为插件执行default-compile获取参数compilerId的值:TypeNotPresentException:输入org.apache.maven.plugin.compiler.CompilerMojo不存在

     

CoreException:无法获取插件执行参数compilerId的值default-testCompile:TypeNotPresentException:类型org.apache.maven.plugin.compiler.TestCompilerMojo不存在

如何修复上述问题并运行我的项目。 请指导。

Pom as:

<?xml version="1.0" encoding="UTF-8"?>
<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.bootexmp</groupId>
    <artifactId>springBootExampl</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <packaging>jar</packaging>

    <name>springBootExampl</name>
    <description>Demo project for Spring Boot</description>

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>1.5.10.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>

        <!-- https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-compiler-plugin -->
        <dependency>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.1</version>
        </dependency>

    </dependencies>

    <build>

    <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-antrun-plugin</artifactId>
                    <versionRange>[1.8,)</versionRange>
                    <goals>
                      <goal>run</goal>
                    </goals>
                  </pluginExecutionFilter>
                  <action>
                    <ignore />
                  </action>
                </pluginExecution>
              </pluginExecutions>
            </lifecycleMappingMetadata>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
         <!-- <plugin>
            <artifactId>maven-antrun-plugin</artifactId> -->
            <!-- <version>1.8</version>
 -->          <!--   <executions>
               <execution>
                  <id>CopyPropertyFiles</id>
                  <phase>generate-resources</phase>
                  <goals>
                     <goal>run</goal>
                  </goals>
                  <configuration>
                     <target>
                        <copy todir="${basedir}/src/main/resources" overwrite="true">
                           <fileset id="envpropfiles" dir="${basedir}/src/main/resources/properties">
                              <include name="${env}-*.properties" />
                           </fileset> -->
                          <!--  <mapper type="regexp" from="(.*)-(.*\.properties)" to="]  -->
                       <!--  </copy>
                     </target>
                  </configuration>
               </execution>
            </executions>
         </plugin> -->
        <!--  </plugins>
        <plugins> -->

            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>

            <!--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.codehaus.gmaven</groupId>
                                <artifactId>gmaven-plugin</artifactId>
                                <versionRange>[1.5,)</versionRange>
                                <goals>
                                    <goal>testCompile</goal>
                                    <goal>compile</goal>
                                </goals>
                            </pluginExecutionFilter>
                                <action> 
                                    <ignore></ignore>
                                </action>
                            </pluginExecution>
                            <pluginExecution>
      <pluginExecutionFilter>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <goals>
          <goal>list</goal>
        </goals>
        <versionRange>[0.0,)</versionRange>
      </pluginExecutionFilter>
      <action>
        <ignore />
      </action>
    </pluginExecution>
                        </pluginExecutions>
                    </lifecycleMappingMetadata>
                </configuration>
            </plugin>  -->


        </plugins>


    </build>


</project>

0 个答案:

没有答案