Problems with maven in IDEA

I decided to take a course at stepic on developing a web server in java, but I ran into a problem-in pom.xml each plugin is highlighted in red in the list compiled by the teacher (which should work). Because of these problems, jetty and freemarker do not connect. The project uses this library and the template engine, but since they are not connected, IDEA does not understand where to get them in the source code when accessing them. Please tell me how to solve this problem problem?

Screen enter a description of the image here

enter a description of the image here

Pom.xml

<?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>L1.1</groupId>
  <artifactId>L1.1</artifactId>
  <version>1.0</version>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.3</version>
        <configuration>
          <source>1.8</source>
          <target>1.8</target>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-assembly-plugin</artifactId>

        <configuration>
          <descriptorRefs>
            <descriptorRef>jar-with-dependencies</descriptorRef>
          </descriptorRefs>
          <outputDirectory>${basedir}</outputDirectory>
          <finalName>server</finalName>
          <appendAssemblyId>false</appendAssemblyId>
          <archive>
            <manifest>
              <mainClass>main.Main</mainClass>
            </manifest>
          </archive>
        </configuration>
      </plugin>
    </plugins>
  </build>

  <dependencies>
    <dependency>
      <groupId>org.freemarker</groupId>
      <artifactId>freemarker</artifactId>
      <version>2.3.20</version>
    </dependency>

    <dependency>
      <groupId>org.eclipse.jetty</groupId>
      <artifactId>jetty-server</artifactId>
      <version>9.3.0.M0</version>
    </dependency>

    <dependency>
      <groupId>org.eclipse.jetty</groupId>
      <artifactId>jetty-webapp</artifactId>
      <version>9.3.0.M0</version>
    </dependency>

  </dependencies>

</project>
Author: batman, 2017-04-05

3 answers

Ask your teacher to show you the maven repository settings. They can be found in the following places: 1) Home-user's directory -> .m2/settings.xml 2) In The Settings Intellij IDEA: "Build, Execution, Deployment" - > "Build Tools" - > "Maven" - > " Repositories" 3) In themselves pom.xml falah. Example: https://maven.apache.org/guides/mini/guide-multiple-repositories.html

 1
Author: Anver Bogatov, 2017-04-07 04:31:14

It is possible that the local Maven data does not contain information about the artifacts and their versions stored in the main repository. I had such a situation, decided in the IDEA Update Maven Indices (by Alt+Enter on any red dependency), although the process is not fast

 1
Author: ActivX, 2017-11-28 07:27:17

There in the lower right corner floats a sign about import, it is necessary to include the possibility of auto-import.

 0
Author: Валентин, 2019-07-30 18:14:46