Search code examples
mavenkotlininstallationklaxon

Maven install Klaxon


I'm just learning Kotlin and I can't install library Klaxon on my Maven project. GitHub: https://github.com/cbeust/klaxon

I copy settings from https://bintray.com/cbeust/maven/klaxon to my pom.xml, but it doesn't work. I try to copy and paste this to pom.xml:

<!-- https://mvnrepository.com/artifact/com.beust/klaxon -->
<dependency>
    <groupId>com.beust</groupId>
    <artifactId>klaxon</artifactId>
    <version>4.0.2</version>
</dependency>

But it doesn't work.

Could somebody help me to install this library? Or just give me a link to find out learn how to install any library to my Maven project? I can't find this information, maybe I can't write correct a google search.

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>


Solution

  • Thanks for your help! My comrades helped me: I had to sign in for bintray.com and clicked to set me up and download settings.xml to my project in catalog with pom.xml because of politics of bintray.com