包存在于.m2文件夹中,但构建错误 - Intellij IDEA

时间:2017-03-30 15:26:02

标签: java maven intellij-idea

我在我的计算机上启动了一个项目,而且我把它放入一个回购中,过了一段时间我将使用该代码。我从gitlab克隆我的文件,没有问题。我的项目使用了Maven。但克隆后我试图运行项目我得到了错误。 Error:(22, 23) java: package org.json.simple does not exist 还有很多相同的错误,表示未添加库,即使我在外部库中都有它们。

这里我的外部库: external libraries

这是我的maven 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>groupId</groupId>
    <artifactId>LawnMower-Odroid</artifactId>
    <version>0.4.6-SNAPSHOT</version>
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <dependencies>
        <!-- https://mvnrepository.com/artifact/eu.hansolo/Medusa -->
        <dependency>
            <groupId>eu.hansolo</groupId>
            <artifactId>Medusa</artifactId>
            <version>7.6</version>
        </dependency>

        <!-- https://mvnrepository.com/artifact/eu.hansolo/tilesfx -->
        <!--<dependency>-->
            <!--<groupId>eu.hansolo</groupId>-->
            <!--<artifactId>tilesfx</artifactId>-->
            <!--<version>1.4.0</version>-->
        <!--</dependency>-->

        <!--<dependency>-->
            <!--<groupId>com.jfoenix</groupId>-->
            <!--<artifactId>jfoenix</artifactId>-->
            <!--<version>1.2.0</version>-->
        <!--</dependency>-->

        <!-- https://mvnrepository.com/artifact/org.kordamp.ikonli/ikonli-weathericons-pack -->
        <dependency>
            <groupId>org.kordamp.ikonli</groupId>
            <artifactId>ikonli-weathericons-pack</artifactId>
            <version>1.9.0</version>
        </dependency>

        <!-- https://mvnrepository.com/artifact/org.kordamp.ikonli/ikonli-material-pack -->
        <dependency>
            <groupId>org.kordamp.ikonli</groupId>
            <artifactId>ikonli-material-pack</artifactId>
            <version>1.9.0</version>
        </dependency>

        <!-- https://mvnrepository.com/artifact/org.kordamp.ikonli/ikonli-core -->
        <dependency>
            <groupId>org.kordamp.ikonli</groupId>
            <artifactId>ikonli-core</artifactId>
            <version>1.9.0</version>
        </dependency>

        <!-- https://mvnrepository.com/artifact/org.kordamp.ikonli/ikonli-materialdesign-pack -->
        <dependency>
            <groupId>org.kordamp.ikonli</groupId>
            <artifactId>ikonli-materialdesign-pack</artifactId>
            <version>1.9.0</version>
        </dependency>

        <!-- https://mvnrepository.com/artifact/org.kordamp.ikonli/ikonli-javafx -->
        <dependency>
            <groupId>org.kordamp.ikonli</groupId>
            <artifactId>ikonli-javafx</artifactId>
            <version>1.9.0</version>
        </dependency>

        <!-- https://mvnrepository.com/artifact/com.lynden/GMapsFX -->
        <!--<dependency>-->
            <!--<groupId>com.lynden</groupId>-->
            <!--<artifactId>GMapsFX</artifactId>-->
            <!--<version>2.10.0</version>-->
        <!--</dependency>-->

        <!-- https://mvnrepository.com/artifact/io.datafx/flow -->
        <dependency>
            <groupId>io.datafx</groupId>
            <artifactId>flow</artifactId>
            <version>8.0b8</version>
        </dependency>

        <!-- https://mvnrepository.com/artifact/io.datafx/core -->
        <dependency>
            <groupId>io.datafx</groupId>
            <artifactId>core</artifactId>
            <version>8.0b8</version>
        </dependency>

        <dependency>
            <groupId>com.googlecode.json-simple</groupId>
            <artifactId>json-simple</artifactId>
            <version>1.1.1</version>
        </dependency>

        <!-- https://mvnrepository.com/artifact/org.rxtx/rxtx -->
        <dependency>
            <groupId>org.rxtx</groupId>
            <artifactId>rxtx</artifactId>
            <version>2.1.7</version>
        </dependency>

        <!--<dependency>-->
            <!--<groupId>org.json</groupId>-->
            <!--<artifactId>json</artifactId>-->
            <!--<version>20160810</version>-->
        <!--</dependency>-->


    </dependencies>
</project>

编辑:

我应该解释一下我的IDE代码编辑器中没有错误。只是当我构建我的项目时,错误将显示为如下图所示:

no error in IDE's Code Editor

如果我手动将库jar文件添加到项目中,错误就会消失!!!

0 个答案:

没有答案