Home > Software engineering >  How to set up Netty dependency into intellij IDE
How to set up Netty dependency into intellij IDE

Time:09-30

I've been trying to set up Netty as a dependency in my IDE, even though I'm using Maven pom.xml file:

<?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>org.example</groupId>
    <artifactId>BasicServer</artifactId>
    <version>1.0-SNAPSHOT</version>

    <properties>
        <maven.compiler.source>11</maven.compiler.source>
        <maven.compiler.target>11</maven.compiler.target>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <dependencies>
        <dependency>
            <groupId>io.netty</groupId>
            <artifactId>netty-all</artifactId>
            <version>4.1.82.Final</version>
        </dependency>
    </dependencies>



</project>

however, this part of the file will show in red:

    <dependency>
        <groupId>io.netty</groupId>
        <artifactId>netty-all</artifactId>
        <version>4.1.82.Final</version>
    </dependency>

meaning it doesn't recognize it.

Also when I go to my class and import netty e.i: import io.netty.channel.ChannelInboundHandlerAdapter; this will show in red as well.

I even bought the book Netty in Action Book by Marvin Wolfthal and Norman Maurer but somehow they left out the most important factor on how to import netty step-by-step.

I've searched everywhere but no luck, please help...

CodePudding user response:

Change your IDEA config of project. Settings -> Build, Execution, Deployment -> BuildTools -> Maven. Check maven home path, user settings file and local repository. After that, reload your project.

  • Related