patricio2626
patricio2626

Reputation: 153

Intellij pom.xml dependency could not be resolved

My project is unable to resolve the com.twitter:hbc-core:2.2.0 dependency. You can see the pom.xml file below. I've tried reimporting all Maven projects, and I see that the dependency is in the repository at https://search.maven.org/artifact/com.twitter/hbc-core/2.2.0/jar . The central repository used is https://repo.maven.apache.org/maven2 . The classes are not able to be imported, and alt + enter does not offer a meaningful import.

Minimal, complete, verifiable example:

import com.twitter.hbc.core.endpoint.StatusesFilterEndpoint;

public class TwitterProducer {


    public static  void main(String[] args){
        StatusesFilterEndpoint hosebirdEndpoint = new StatusesFilterEndpoint();
    }
}

What might I be missing here?

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.github.simplestep</groupId>
    <artifactId>kafka-beginners-course</artifactId>
    <version>1.0</version>
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>8</source>
                    <target>8</target>
                </configuration>
            </plugin>
        </plugins>
    </build>
    <dependencies>
        <dependency>
            <groupId>org.apache.kafka</groupId>
            <artifactId>kafka-clients</artifactId>
            <version>2.5.0</version>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-simple</artifactId>
            <version>1.7.30</version>
        </dependency>
        <dependency>
            <groupId>com.twitter</groupId>
            <artifactId>hbc-core</artifactId>
            <version>2.2.0</version>
        </dependency>
    </dependencies>

</project>

Upvotes: 0

Views: 566

Answers (1)

CrazyCoder
CrazyCoder

Reputation: 401897

Based on the communication in the comments, it appears that some dependencies downloaded by Maven into the local .m2 folder were corrupted.

Forcing Maven to download them again by removing/renaming this folder has solved the problem.

Upvotes: 1

Related Questions