简体   繁体   中英

Maven project java unable to import dependencies

在此处输入图片说明

在此处输入图片说明

I am unable to import the dependencies as shown in the screenshots. What am i doing wrong here. Please help thank you.

Above your <dependencies> section, add the following:

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

And then right click on your project -> Maven -> Reimport . This will reconfigure the compiler for language level (instead of default 1.5 which is much too low), and more importantly import the libraries in your dependencies.

尝试右键单击项目1.配置->转换为Maven项目2.Maven --->更新Maven项目->强制更新快照和发行版

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM