maven - 将 kotlinx-html-js 添加到 intellij 中的 kotlin/js 项目

标签 maven intellij-idea kotlin

我需要将 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 ,但它不起作用。

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

最佳答案

至于Gradle,我可以和你分享以下工作项目:https://github.com/s1monw1/so_styling_webext/blob/master/build.gradle
依赖集看起来如下 'kotlin-platform-js'应用的插件:

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

关于maven - 将 kotlinx-html-js 添加到 intellij 中的 kotlin/js 项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47583001/

相关文章:

java - 您推荐哪种适用于 Apache Maven 的软件安装程序插件?

java - 为什么 Maven 找不到这个 jar

java - 将 .jar 库与我的 .jar 结合

java - 在 IntelliJ 中使用 cargo 在 tomcat 上启动本地调试应用程序

java - 我如何获取android中其他应用程序的屏幕时间?

java - 如何在 Spring Boot 中获取 log4j2.properties 文件以从 pom.xml 读取文件名

java - 使用 Maven 执行主类并保存输出

java - 问题 JDK 在 Intellij 中创建 scala 项目

android - 如何在 Kotlin Android 中处理特殊字符

java - ViewPager2 堆栈 PageTransform