문제

멀티 모듈 Maven 프로젝트가 있으며 디렉토리 구조는 계층 적입니다. 일부 모듈은 다른 모듈에 의존성이 있습니다. 프로젝트 POM의 종속성 섹션에 종속 모듈을 추가했습니다. 그러나 이러한 종속성을 해결하려면 부모 프로젝트를 가져 와서 프로젝트 속성> Maven을 선택하고 "활성화 된 모듈"을 선택해야합니다. 이것은 정상입니까? 프로젝트가 작업 영역에서 종속 프로젝트를 해결하지 않는 이유는 무엇입니까?

감사합니다, 제프

도움이 되었습니까?

해결책

However, in order to resolve those dependencies, I need to import the parent project, and select Project Properties > Maven and select "Enabled Modules." Is this normal?

No. When you import your projects, unfold the Advanced part and make sure that Resolve Workspace projects is checked (that should be the default though). You can also change this setting at the project level. Just right-click on a project, select Properties > Maven and verify that Resolve dependencies from Workspace projects is checked.

UPDATE: Answering a question asked in a comment by the OP. From https://docs.sonatype.org/display/M2ECLIPSE/Dependency+Management about Include modules:

When enabled, dependencies from all nested modules are added to the "Maven Dependencies" container and source folders from nested modules are added to the current project build path when running "Update Sources" action. This option is enabled when you import multiple Maven projects as single Eclipse project, e.g. when "Separate projects for modules" option is turned off in the project import wizards.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top