将kotlinx-html-js添加到intellij

时间:2017-11-30 21:35:59

标签: maven intellij-idea kotlin kotlin-html-builder

我需要将kotlinx-html-js库添加到使用Intellij创建的kotlin / js项目中。我尝试添加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>com.cillario</groupId>
    <artifactId>Demo</artifactId>
    <version>1.0-SNAPSHOT</version>

    <repositories>
        <repository>
            <id>jcenter</id>
            <name>jcenter</name>
            <url>https://jcenter.bintray.com</url>
        </repository>
    </repositories>

    <dependencies>
        <dependency>
            <groupId>org.jetbrains.kotlinx</groupId>
            <artifactId>kotlinx-html-js</artifactId>
            <version>${kotlinx.html.version}</version>
        </dependency>
    </dependencies>


</project>

正如here所述,但它不起作用。

有人能帮助我吗?非常感谢。

1 个答案:

答案 0 :(得分:1)

至于Gradle,我可以与您分享以下工作项目: https://github.com/s1monw1/so_styling_webext/blob/master/build.gradle

如果应用了'kotlin-platform-js'插件,则dependecy集如下所示:

dependencies {
    compile "org.jetbrains.kotlin:kotlin-stdlib-js:$kotlin_version"
    compile 'org.jetbrains.kotlinx:kotlinx-html-js:0.6.8'
}