首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Maven安装Klaxon

Maven安装Klaxon
EN

Stack Overflow用户
提问于 2019-03-17 21:07:35
回答 2查看 683关注 0票数 0

我刚开始学习Kotlin,我不能在我的Maven项目中安装Klaxon库。GitHub:https://github.com/cbeust/klaxon

我将设置从https://bintray.com/cbeust/maven/klaxon复制到我的pom.xml,但它不起作用。我尝试将其复制并粘贴到pom.xml

代码语言:javascript
复制
<!-- https://mvnrepository.com/artifact/com.beust/klaxon -->
<dependency>
    <groupId>com.beust</groupId>
    <artifactId>klaxon</artifactId>
    <version>4.0.2</version>
</dependency>

但它不起作用。

有人能帮我安装这个库吗?或者只是给我一个链接,了解如何在我的Maven项目中安装任何库?我找不到这些信息,也许我不能写正确的谷歌搜索。

pom.xml:

代码语言:javascript
复制
<?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>

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2019-03-21 19:31:30

谢谢你的帮忙!我的战友们帮助了我:由于pom.xml的政治原因,我不得不登录set me up,点击settings.xml并将settings.xml下载到pom.xml目录中的项目中

票数 0
EN

Stack Overflow用户

发布于 2019-03-17 21:09:40

依赖项必须在<dependencies>标记内。查看Maven POM的结构以了解更多信息。

https://maven.apache.org/pom.html

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/55207390

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档