I'm trying to start playing around with using Kotlin together with Spring 5.0 however I am having issues with the Kotlin compiler not recognising any reference to Spring:
[ERROR] Failed to execute goal org.jetbrains.kotlin:kotlin-maven-plugin:1.1.1:compile (compile) on project kotlin-mvc-project: Compilation failure: Compilation failure:
[ERROR] (file location):[7,12] Unresolved reference: springframework
I'm using the spring milestone version Spring 5.0.0.M5 and Kotlin version 1.1.1 (on both my kotlin-compiler and IntelliJ Kotlin plugin). There are no compile errors highlighted by the IDE in any of my Kotlin files but running the kotlin-compiler it seems to not see Spring 5.0 at all.
Does anyone have any ideas how to fix this? I'm using Maven for this project, I've attached my POM for reference:
<?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>kotlin-mvc-project</groupId>
<artifactId>kotlin-mvc-project</artifactId>
<version>1.0-SNAPSHOT</version>
<properties>
<kotlin.version>1.1.1</kotlin.version>
<spring.version>5.0.0.M5</spring.version>
</properties>
<repositories>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/libs-milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib</artifactId>
<version>${kotlin.version}</version>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-compiler</artifactId>
<version>${kotlin.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<sourceDirectory>${project.basedir}/src/main/kotlin</sourceDirectory>
<testSourceDirectory>${project.basedir}/src/test/kotlin</testSourceDirectory>
<plugins>
<plugin>
<artifactId>kotlin-maven-plugin</artifactId>
<groupId>org.jetbrains.kotlin</groupId>
<version>${kotlin.version}</version>
<executions>
<execution>
<id>compile</id>
<goals> <goal>compile</goal> </goals>
</execution>
<execution>
<id>test-compile</id>
<goals> <goal>test-compile</goal> </goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
[ERROR] (file location):[7,12] Unresolved reference: springframeworkThis error I meant -- what's on the line where this occurs? - skalarproduktraum