Translate

[Maven] 'groupId' is missing. 에러 발생문제



mvn install 또는 mvn clean install 할 시 다음과 같이 나온다.


lucifer@lucifer-Vostro-V13:~/test/maven/simple-parent$ mvn clean install
[INFO] Scanning for projects...
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]   
[ERROR]   The project [unknown-group-id]:simple-parent:1.0 (/home/lucifer/test/maven/simple-parent/pom.xml) has 1 error
[ERROR]     'groupId' is missing. @ line 2, column 99
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
lucifer@lucifer-Vostro-V13:~/test/maven/simple-parent$







문제

메이븐 코디네이트의 정보중 groupId 가 빠져 있어서 문제가 되었다.



pom.xml 에는 프로젝트의 유일한 ID와 의존성 또는 메이븐 POM의 플러그인으로 사용할 수 있는 식별자들의 정보인 메이븐 코디네이트가 있어야 한다.

1. 메이븐 코디네이트는 종종 groupId:artifactId:packaging:version 과 같은 형식으로 콜론을 구분자로 사용하여 표기한다.

2. 메이븐 코디네이트는 groupId, artifactId, version, packaging 으로 구성되어 있다.
    (드믈게 classifier 라는 코디네이트를 5번째 코디네이트로 사용한다.)

3. 필수속성(groupId, artifactId, version)
    - packaging 은 jar 가 디폴트






다음과 같이 groupId 를 추가해 줬다.

<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/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <artifactId>simple-parent</artifactId>
  <groupId>org.sonatype.mavenbook.ch06</groupId>
  <packaging>pom</packaging>
  <version>1.0</version>
  <name>Chapter 6 Simple Parent Project</name>
 
  <modules>
    <module>simple-weather</module>
    <module>simple-webapp</module>
  </modules>

  <build>
    <pluginManagement>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <source>1.5</source>
          <target>1.5</target>
        </configuration>
      </plugin>
    </plugins>
    </pluginManagement>
  </build>

  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>3.8.1</version>
      <scope>test</scope>
    </dependency>
  </dependencies>
</project>


댓글