Ask Your Question
4

How to stop Maven from obtaining project modules as artifacts from remote repository during downloading?

asked 2022-04-11 11:00:00 +0000

david gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2021-09-12 01:00:00 +0000

djk gravatar image

To prevent Maven from downloading project modules as artifacts from a remote repository, you can use the <skip>true</skip> option in the <dependency> configuration of your project.

For example:

<dependency>
  <groupId>com.example</groupId>
  <artifactId>my-module</artifactId>
  <version>1.0.0</version>
  <type>jar</type>
  <scope>compile</scope>
  <skip>true</skip>
</dependency>

This will tell Maven to skip downloading the artifact for this dependency. You can also use the -o option when running Maven to force it to work offline, which will prevent it from downloading any new artifacts.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2022-04-11 11:00:00 +0000

Seen: 10 times

Last updated: Sep 12 '21