我需要将 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/