Maven : 확인할 수없는 상위 POM
1 쉘 프로젝트와 4 하위 모듈로 maven 프로젝트 설정이 있습니다. 쉘을 만들려고 할 때. 나는 얻다:
[INFO] Scanning for projects...
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project module1:1.0_A0 (C:\module1\pom.xml) has 1 error
[ERROR] Non-resolvable parent POM: Failure to find shell:pom:1.0_A0 in http://nyhub1.ny.ssmb.com:8081/nexus/content/repositories/JBoss/ was cached in the local repository, resolution will not be reattempted until the update interval of jboss has elapsed or updates are forced and 'parent.relativePath' points at wrong local POM @ line 5, column 11 -> [Help 2]
고독한 모듈을 만들려고하면 동일한 오류가 발생합니다. module1 만 해당 모듈로 교체합니다.
그들 모두에게 그들의 poms에서 부모를 언급하게하십시오.
<parent>
<artifactId>shell</artifactId>
<groupId>converter</groupId>
<version>1.0_A0</version>
</parent>
다음은 shell pom의 관련 부분입니다.
<groupId>converter</groupId>
<artifactId>shell</artifactId>
<version>1.0_A0</version>
<packaging>pom</packaging>
<name>shell</name>
<modules>
<module>module1</module>
<module>module2</module>
<module>module3</module>
<module>module4</module>
</modules>
참고 용입니다.
Maven의 기쁨.
모듈의 상대 경로를 ../pom.xml에 넣으면 해결되었습니다.
parent
요소는이 relativePath
상위의 디렉토리를 가리 키도록해야한다는 요소를. 기본값은..
올바른 settings.xml
파일을 ~/.m2/
디렉토리 에 넣어서 수정할 수도 있습니다 .
대체 이유는 상위 아티팩트가에서 액세스 할 수없는 pom.xml
저장소 (일반적으로 개인 저장소) 에서 온 것일 수도 있습니다 . 해결책은 다음 위치에 해당 저장소를 제공하는 것이 었습니다 pom.xml
.
<repositories>
<repository>
<id>internal-repo</id>
<name>internal repository</name>
<url>https://my/private/repo</url>
<layout>default</layout>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
제 경우에는 Eclipse로 인해 문제가 훨씬 더 복잡했습니다. 저장소는 특수 프로필 ( <profiles><profile><id>activate-private-repo</id><repositories>...
) 에서만 활성화 되었고 Eclipse의 Maven GUI에서는 Ctrl+Alt+P
바로 가기를 통해이 프로필을 설정할 수 없었습니다 .
해결책은 임시로 프로필 외부에 저장소를 선언하고 (무조건) Alt+F5
Maven 업데이트 프로젝트를 시작 하고, 프로필을 활성화하고, 저장소 선언을 프로필에 다시 넣는 것입니다. 이것은 Maven 버그가 아니라 Eclipse 버그입니다.
<relativePath />
pom의 부모가 다음과 같이 보이도록 추가하십시오 .
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.4.RELEASE</version>
<relativePath />
</parent>
해석 불가능한 상위 POM : 이는 상위 저장소를 해석 할 수 없음을 의미합니다.
디버그 모드에서 자르기 :
[DEBUG] Reading global settings from **/usr/local/Cellar/maven/3.5.4/libexec/conf/settings.xml**
[DEBUG] **Reading user settings from /Users/username/.m2/settings.xml**
[DEBUG] Reading global toolchains from /usr/local/Cellar/maven/3.5.4/libexec/conf/toolchains.xml
[DEBUG] Reading user toolchains from /Users/username/.m2/toolchains.xml
[DEBUG] Using local repository at /Users/username/.m2/repository
[DEBUG] Using manager EnhancedLocalRepositoryManager with priority 10.0 for /Users/username/.m2/repository
[INFO] Scanning for projects...
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
부모 저장소는 maven 중앙의 일부가 아니기 때문입니다. 해결책은 ~ m2 /에 setting.xml을 지정하여 상위 POM을 생성하는 데 도움이됩니다. /Users/username/.m2/settings.xml
해당 XML에서 저장소 정보를 지정해야 할 수 있습니다.
하위 POM에 올바른 값이 있는지 확인
GroupId
ArtefactId
Version
예를 들어 Eclipse에서 다음을 검색 할 수 있습니다.
1.0_A0을 $ {project.version}으로 바꿉니다.
mvn을 한 번 실행하십시오. 그러면 필요한 모든 저장소가 다운로드됩니다. 이 단계 후에 1.0_A0으로 다시 전환 할 수 있습니다.
<relativePath>
하위 프로젝트에서 빌드하는 경우 <relativePath>
상위 pom을 해결하는 데 도움이 될 수 있습니다.
부모 pom 설치
그러나 폴더에서 하위 프로젝트를 빌드하면 <relativePath>
작동하지 않습니다. install
먼저 부모 pom을 로컬 저장소에 넣은 다음 자식 프로젝트를 빌드 할 수 있습니다 .
나는 내 작업에서 비슷한 문제가 있었다.
종속성없이 상위 프로젝트를 빌드하면 .m2 폴더에 parent_project.pom 파일이 생성되었습니다.
그런 다음 상위 POM에 하위 모듈을 추가하고 Maven 빌드를 실행합니다.
<modules>
<module>module1</module>
<module>module2</module>
<module>module3</module>
<module>module4</module>
</modules>
종속성 추가
pom.xml :
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.8.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.4.3</version>
</dependency>
두 개의 반응기 빌드 pom.xml 파일에 동일한 artefactId가 있다는 문제가 있습니다.
참고 URL : https://stackoverflow.com/questions/7612309/maven-non-resolvable-parent-pom
'IT박스' 카테고리의 다른 글
정렬되지 않은 배열보다 정렬 된 배열을 * 느리게 * 처리하는 이유는 무엇입니까? (0) | 2020.10.08 |
---|---|
인증서는 PC에서 신뢰하지만 Android에서는 신뢰하지 않습니다. (0) | 2020.10.08 |
TSQL 변수를 상수로 만드는 방법이 있습니까? (0) | 2020.10.08 |
가장 좋아하는 프로파일 링 도구는 무엇입니까 (C ++ 용) (0) | 2020.10.08 |
자바 메소드 인수를 최종으로 만들기 (0) | 2020.10.07 |