Do you mean running ` mvn build` ?
# ktor
k
Do you mean running
mvn build
?
c
yes,
mvn package
or
./gradlew build
k
build failure, Application.kt: (3, 16) Unresolved reference: application, etc
Something missing in pom.xml file?
c
looks like there are no dependencies
// cc @Deactivated User
k
Hmmm, followed the ktor plugin step for step but no go ... wondering what I might have missed
Intellij 2018.2.5 and ktor plugin 0.3.1
Copy code
$ mvn -v
Apache Maven 3.5.2 (138edd61fd100ec658bfa2d307c43b76940a5d7d; 2017-10-18T09:58:13+02:00)
Maven home: /opt/apache-maven-3.5.2
Java version: 1.8.0_181, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-8-oracle/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "4.15.0-36-generic", arch: "amd64", family: "unix"
c
Are there any dependencies in pom.xml ?
k
Copy code
<dependencies>
        <dependency>
            <groupId>org.jetbrains.kotlin</groupId>
            <artifactId>kotlin-stdlib-jdk8</artifactId>
            <version>${kotlin_version}</version>
        </dependency>
        <dependency>
            <groupId>io.ktor</groupId>
            <artifactId>ktor-server-netty</artifactId>
            <version>${ktor_version}</version>
        </dependency>
        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-classic</artifactId>
            <version>${logback_version}</version>
        </dependency>
        <dependency>
            <groupId>io.ktor</groupId>
            <artifactId>ktor-server-core</artifactId>
            <version>${ktor_version}</version>
        </dependency>
        <dependency>
            <groupId>io.ktor</groupId>
            <artifactId>ktor-auth</artifactId>
            <version>${ktor_version}</version>
        </dependency>
        <dependency>
            <groupId>io.ktor</groupId>
            <artifactId>ktor-auth-jwt</artifactId>
            <version>${ktor_version}</version>
        </dependency>
        <dependency>
            <groupId>io.ktor</groupId>
            <artifactId>ktor-jackson</artifactId>
            <version>${ktor_version}</version>
        </dependency>
        <dependency>
            <groupId>io.ktor</groupId>
            <artifactId>ktor-server-tests</artifactId>
            <version>${ktor_version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.ktor</groupId>
            <artifactId>ktor-server-core</artifactId>
            <version>${ktor_version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.ktor</groupId>
            <artifactId>ktor-auth</artifactId>
            <version>${ktor_version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.ktor</groupId>
            <artifactId>ktor-auth-jwt</artifactId>
            <version>${ktor_version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.ktor</groupId>
            <artifactId>ktor-jackson</artifactId>
            <version>${ktor_version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>
Generated by the ktor plugin ^^^
Copy code
<properties>
        <ktor_version>0.9.5</ktor_version>
        <kotlin.code.style>official</kotlin.code.style>
        <kotlin_version>1.2.70</kotlin_version>
        <logback_version>1.2.1</logback_version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <kotlin.compiler.incremental>true</kotlin.compiler.incremental>
        <main.class>io.ktor.server.netty.DevelopmentEngine</main.class>
    </properties>
c
Are you sure that unresolved reference comes from Maven?
for missing dependencies it should fail at resolution, before compilation
Or maybe it's because you have JRE, not JDK
or broken jars
it should be something in your environment
k
Don't think so, kotlin and java projects work just fine, only kotlin not.
May someone with intellij can try it out and see if they get the same errors?
How shall I proceed?
Can someone help me with this please?
d
Have you included the required repositories?
Try to open https://github.com/ktorio/ktor-samples/tree/master/other/maven-netty this project with IntelliJ and if it works for you compare your
pom.xml
with that one
k
Thanks, will give it a try
👍 1