使用Kotlin的Maven依赖不引入Kotlin类

我有两个项目,一个是依赖于另一个。 我已经将依赖项目转换为Kotlin,但是现在当maven从本地maven仓库获取发布的依赖关系时,父项目并没有依赖于Kotlin内部库。

大纲:

Main Project ↳ Now-Kotlin Project ↳ Kotlin Std-lib 

运行主项目时,会导致java.lang.ClassNotFoundException: kotlin.jvm.internal.Intrinsics异常。

现在Kotlin项目有kotlin-maven-plugin插件和在它的pom.xml中定义的kotlin-stdlib

父项目有被列为依赖项的现在的Kotlin项目,它被正确地导入,它的类被找到和使用,等等…在IntelliJ中就好了。

编译和启动tomcat上主应用程序的应用程序,直到第一次从现在的Kotlin项目中调用代码,

 org.apache.catalina.core.ApplicationContext log SEVERE: StandardWrapper.Throwable java.lang.NoClassDefFoundError: kotlin/jvm/internal/Intrinsics .... java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) Caused by: java.lang.ClassNotFoundException: kotlin.jvm.internal.Intrinsics 

我的假设是,Kotlin库将遵循Maven的正常依赖关系规则,并且来自kotlin-stdliborg.jetbrains.kotlin包将被包含在任何传递依赖关系中。

主要项目中包含这些依赖关系的正确方法是什么?

更新

主项目mvn dependency:tree相关部分:

 [INFO] --- maven-dependency-plugin:2.10:tree (default-cli) @ example-core --- [INFO] com.example:example-core:jar:1.17.0-SNAPSHOT [INFO] +- com.example.service.search:search-client:jar:kotlin:2.0.3-SNAPSHOT:compile 

主要项目POM

 ... <dependency> <groupId>com.example.service.search</groupId> <artifactId>search-client</artifactId> <version>2.0.3-SNAPSHOT</version> <scope>compile</scope> </dependency> ... 

新的Kotlin项目POM

 ... <properties> <kotlin.version>1.1.2-2</kotlin.version> </properties> ... <dependencyManagement> <dependencies> <dependency> <groupId>org.jetbrains.kotlin</groupId> <artifactId>kotlin-stdlib</artifactId> <version>${kotlin.version}</version> </dependency> <dependency> <groupId>org.jetbrains.kotlin</groupId> <artifactId>kotlin-test</artifactId> <version>${kotlin.version}</version> <scope>test</scope> </dependency> </dependencies> </dependencyManagement> ... <build> <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>