Alan
Alan

Reputation: 126

Maven error: package com.google.common.collect does not exist

In my pom.xml file, I have added

<dependency>
  <groupId>com.google.guava</groupId>
  <artifactId>guava</artifactId>
  <version>11.0.2</version>
</dependency>

and I have downloaded the jar file from https://github.com/google/guava/releases/tag/v31.0.1 and added it to my build path.

Eclipse recognizes the import, as it does not give an error on the import line which is import com.google.common.collect.Lists;.

However, when I run mvn package, I get package com.google.common.collect does not exist even after cleaning the project.

Is there something else I am missing?

Upvotes: 1

Views: 15490

Answers (1)

SecretAgent
SecretAgent

Reputation: 15

I think you forgot to add <scope>system</scope> and <systemPath>path</systemPath>

Upvotes: 0

Related Questions