我刚开始学习Kotlin,我不能在我的Maven项目中安装Klaxon库。GitHub:https://github.com/cbeust/klaxon
我将设置从https://bintray.com/cbeust/maven/klaxon复制到我的pom.xml,但它不起作用。我尝试将其复制并粘贴到pom.xml
<!-- https://mvnrepository.com/artifact/com.beust/klaxon -->
<dependency>
<groupId>com.beust</groupId>
<artifactId>klaxon</artifactId>
<version>4.0.2</version>
</dependency>但它不起作用。
有人能帮我安装这个库吗?或者只是给我一个链接,了解如何在我的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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>FORMS</groupId>
<artifactId>FORMS</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>Stemmer Stemmer</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<kotlin.version>1.3.21</kotlin.version>
<kotlin.code.style>official</kotlin.code.style>
<junit.version>4.12</junit.version>
</properties>
<profiles>
<profile>
<repositories>
<repository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>bintray-cbeust-maven</id>
<name>bintray</name>
<url>https://dl.bintray.com/cbeust/maven</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>bintray-cbeust-maven</id>
<name>bintray-plugins</name>
<url>https://dl.bintray.com/cbeust/maven</url>
</pluginRepository>
</pluginRepositories>
<id>bintray</id>
</profile>
</profiles>
<dependencies>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib</artifactId>
<version>${kotlin.version}</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.beust/klaxon -->
<dependency>
<groupId>com.beust</groupId>
<artifactId>klaxon</artifactId>
<version>5.0.5</version>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-test-junit</artifactId>
<version>${kotlin.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<sourceDirectory>src/main/kotlin</sourceDirectory>
<testSourceDirectory>src/test/kotlin</testSourceDirectory>
<plugins>
<plugin>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-maven-plugin</artifactId>
<version>${kotlin.version}</version>
<executions>
<execution>
<id>compile</id>
<phase>compile</phase>
<goals>
<goal>compile</goal>
</goals>
</execution>
<execution>
<id>test-compile</id>
<phase>test-compile</phase>
<goals>
<goal>test-compile</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
发布于 2019-03-21 19:31:30
谢谢你的帮忙!我的战友们帮助了我:由于pom.xml的政治原因,我不得不登录set me up,点击settings.xml并将settings.xml下载到pom.xml目录中的项目中
发布于 2019-03-17 21:09:40
依赖项必须在<dependencies>标记内。查看Maven POM的结构以了解更多信息。
https://stackoverflow.com/questions/55207390
复制相似问题