首页 文章

为什么maven插件在添加spring依赖项时会显示错误

提问于
浏览
0

我试图创建一个maven项目并稍后添加spring boot依赖项,但我不断收到maven插件的错误亮点 . 以下是截图:Maven Projects screenshot from intellij

我的POM文件内容:

<?xml version="1.0" encoding="UTF-8"?>

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

<groupId>org.springframework</groupId>
<artifactId>gs-producing-web-service</artifactId>
<version>0.1.0</version>

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>1.5.10.RELEASE</version>
</parent>

<properties>
    <java.version>1.8</java.version>
</properties>
<repositories>
    <repository>
        <id>java.net</id>
        <url>http://repo.maven.apache.org/maven2/</url>
    </repository>
</repositories>
<dependencies>
    <!-- tag::springws[] -->
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web-services</artifactId>
    </dependency>
    <dependency>
        <groupId>wsdl4j</groupId>
        <artifactId>wsdl4j</artifactId>
    </dependency>
    <!-- end::springws[] -->
    <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>

        <!-- tag::xsd[] -->
        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>jaxb2-maven-plugin</artifactId>
            <version>1.6</version>
            <executions>
                <execution>
                    <id>xjc</id>
                    <goals>
                        <goal>xjc</goal>
                    </goals>
                </execution>
            </executions>
            <configuration>
                <schemaDirectory>${project.basedir}/src/main/resources/</schemaDirectory>
                <outputDirectory>${project.basedir}/src/main/java</outputDirectory>
                <clearOutputDir>false</clearOutputDir>
            </configuration>
        </plugin>
        <!-- end::xsd[] -->
    </plugins>
</build>

1 回答

  • 0

    可能您刚刚在pom.xml文件中添加了依赖项,但它们不在您的本地maven存储库中 . 为此,您需要构建/重建项目 . 成功构建项目后,这些依赖项将添加到本地存储库,并且不会显示这些错误 .

    你已经成功建成了吗?如果仍有错误,则可能是其他问题 .

相关问题