티스토리 뷰

이클립스를 통해 Maven 프로젝트 수행시 다음과 에러가 나면서 에러표시가 사라지지 않는 경우가 생긴다.

 

이건 자식 프로젝트의 pom.xml 설정이다.

 

결론부터 미리 말하자면 위와 같은 오류가 발생했을때는 조치를 안해도 된다. 그냥 오류창에서 오류를 지워주면 된다. 이건 이클립스 m2e 플러그인의 문제이고 실제 오류는 아니라고 한다. 이렇게 오류가 난걸 못고치고는 안되겠다 싶은 사람은 다음과 같이 조치를 해주자. 

 

부모 프로젝트의 pom.xml 에 pluginManagement를 설정하고 자식 프로젝트 pom.xml 에서는 이걸 상속받아서 사용을 해보라고 가이드가 되어 있다. pluginManagement는 부모의 pom.xml 에 plugin을 설정해놓고 자식이 손쉽게 사용할 수 있도록 해주는 용도로 사용된다.

 

부모 pom.xml 에 pluginManagement 작성 (따라하지 말것! 후회함)

<pluginManagement>
  <plugins>
    <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-dependency-plugin</artifactId>
      <executions>
        <execution>
          <id>copy-dependencies</id>
          <phase>install</phase>
          <goals>
            <goal>copy-dependencies</goal>
          </goals>
          <configuration>
            <outputDirectory>${project.build.directory}/lib</outputDirectory>
          </configuration>
        </execution>
      </executions>
    </plugin>
  </plugins>
</pluginManagement>

자식 pom.xml 은 다음과 같이 수정

<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-dependency-plugin</artifactId>
</plugin>

이렇게 하고 저장을 누르면 빌드가 되고 두구두구두구두구

 

오류가 사라졌다. 하지만 굳이.. 이렇게 할 이유는 없을것 같다.

 

그냥 오류를 지워주자! 

 

끝!

 

 

댓글
최근에 올라온 글
최근에 달린 댓글
«   2024/05   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31