简体   繁体   中英

Cannot import json-simple with Maven

I am trying to import json-simple with maven using :

 <?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>JSONtest</groupId>
<artifactId>JSONtest</artifactId>
<version>1.0-SNAPSHOT</version>

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

I tried to use the library, but it does not appear to me. (there should be a package called json)

import picture

Then I found out that I am getting this error : Failed to read artifact descriptor for com.googlecode.json-simple:json-simple:jar:1.1.1

I am pretty new to maven, is there something I am missing ?

mvn install:install-file -Dfile=jarlocation/json-simple.1.1.1.jar -DgroupId=com.googlecode.json-simple -DartifactId=json-simple -Dversion=1.1.1 -Dpackaging=jar

Run this command in Command Prompt(cmd), then it will be available in you local maven repository.

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