spring-boot-maven-plugin not found 해결 방법

ASHAPPYASIKNOW·2021년 10월 20일
5

SPRING BOOT

목록 보기
2/3
post-thumbnail

pom.xml 파일 확인

<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.7.2</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>
    ... 중략
    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>   
                <configuration>
                    <excludes>
                        <exclude>
                            <groupId>org.projectlombok</groupId>
                            <artifactId>lombok</artifactId>
                        </exclude>
                    </excludes>
                </configuration>
            </plugin>            
        </plugins>
    </build>
</project>

spring-boot-maven-plugin 버전 확인

Spring Boot Maven Plugin Repository Site

Spring-boot 버전 확인

<artifactId>spring-boot-maven-plugin</artifactId>

부분에서 spring-boot-maven-plugin not found가 표시되는 경우에 spring-bootversion을 넣어주면 해결된다.

	... 중략
	<parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.7.2</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>
    ... 중략

spring-boot 에서는 기본적으로 parent 속성을 상속받기 때문에 version이 2.7.2 임을 확인할 수 있다.

문제 해결

직접 version을 적는 경우

<version>2.7.2</version>

    ... 중략
    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <version>2.7.2</version>
                ... 중략
            </plugin>            
        </plugins>
    </build>
    ... 중략

spring-boot의 version을 참조하는 경우

<version>${parent.version}</version>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <version>${parent.version}</version>
                ... 중략
            </plugin>            
        </plugins>
    </build>

결과


REFERENCES

Spring Boot Maven Plugin Repository Site

profile
36.9 It's good time to start something new

0개의 댓글