0

There is a maven project with several modules. All modules have the same version 1.2.0-SNAPSHOT.

While building the project specifying a module name in the CLI parameters (e.g. running some tests for a module) I see warnings in the log for each module

Command

mvn verify -pl module-with-integr-tests -D it.test=MyIntegrationTest

Part of the log

[WARNING] The POM for com.some:my-module-a:jar:1.2.0-SNAPSHOT is missing,
          no dependency information available
Downloading from central:
  https://common.repositories.some.com:443/build-releases/com/some/my-module-a/1.2.0-SNAPSHOT/maven-metadata.xml
Downloading from snapshots:
  https://common.repositories.some.com:443/build-snapshots/com/some/my-module-a/1.2.0-SNAPSHOT/maven-metadata.xml

I would like to avoid these attempts to download artifacts for own project modules, because most of them are not artifacts being deployed and never appear in the artifactory. Instead these modules are supposed to be built locally and used as dependencies by other modules of the same project.

How to prevent Maven from downloading own project modules?

diziaq
  • 6,881
  • 16
  • 54
  • 96
  • Usually, this should not happen. Are you building the whole project from the root POM? – J Fabian Meier Mar 29 '23 at 11:42
  • @JFabianMeier Yes, when I build from the root POM this problem does not appear. This happens only when I run tests for a specific modules (`mvn verify -pl module-with-integr-tests -D it.test=MyIntegrationTest`). Is it unavoidable? – diziaq Apr 01 '23 at 17:10
  • @diziaq I was need to develop [maven extension](https://stackoverflow.com/a/73355168/3426309) to overcome that. – Andrey B. Panfilov Apr 01 '23 at 19:02

0 Answers0