KidWithAComputer
KidWithAComputer

Reputation: 331

How to run spring project offline mode?

I am trying to run a Spring Project, with several dependencies, that I have already downloaded into my local repository, and have also done followings :

  1. Added local repository path in setting.xml in localRepository tag.
  2. Running the project using mvn install -nsu -llr -o , for offline mode.

And I am getting following error :

[ERROR] Failed to execute goal on project file2Json: Could not resolve dependencies for project com.nse.file2Json:file2Json:jar:0.0.1-SNAPSHOT: Cannot access central (http://repo1.maven.org/maven2) in offline mode and the artifact com.fasterxml.jackson.dataformat:jackson-dataformat-csv:jar:2.8.4 has not been downloaded from it before. -> [Help 1]

I have the dependency installed, take a look :( enter image description here

I have following questions :

  1. Why is the project is trying to look into http://repo1.maven.org/maven2 when I am using offline mode ?
  2. How can I run the project offline, by providing the required dependencies at required paths ? Please help ! thanks in advance.

Upvotes: 0

Views: 1086

Answers (1)

dunni
dunni

Reputation: 44545

It says it cannot access Maven Central because you are in offline mode. And it tries to look there, because ´jackson-dataformat-csv` is not in your local repository, so Maven needs to get it from somewhere (and Maven Central is the default repository).

What you need to do is to execute mvn dependency:go-offline before you switch to the offline mode. This will download everything that you need (dependencies, transitive dependencies as well as plugins).

Upvotes: 1

Related Questions