smned
smned

Reputation: 683

Why does maven plugins show error when spring dependency is added

I was trying to create a maven project and add spring boot dependencies later, but i kept getting error highlights on maven plugins. Here below is the screenshot: Maven Projects screenshot from intellij

And my POM file contents:

<?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>

Upvotes: 0

Views: 1591

Answers (1)

Mamun Kayum
Mamun Kayum

Reputation: 161

May be you have just added the dependencies in your pom.xml file but they are not in your local maven repository. For this purpose you have build/rebuild the project. Once you successfully build the project those dependencies will add to your local repository and will not show these error.

Have you built successfully already? If still there are errors, then might be other issue.

Upvotes: 0

Related Questions