# Java dependencies "not a valid Kotlin Javascript library"

**URL:** <https://discuss.kotlinlang.org/t/java-dependencies-not-a-valid-kotlin-javascript-library/270>\
**Category:** Uncategorized\
**Created:** [April 27, 2015, 8:28pm UTC](https://discuss.kotlinlang.org/t/java-dependencies-not-a-valid-kotlin-javascript-library/270 "2015-04-27T20:28:46Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![jvskriubakken](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/jvskriubakken/32/1430_2.png) [@jvskriubakken](https://discuss.kotlinlang.org/u/jvskriubakken)\
**Post date:** [April 27, 2015, 8:28pm UTC](https://discuss.kotlinlang.org/t/java-dependencies-not-a-valid-kotlin-javascript-library/270/1 "2015-04-27T20:28:46Z")

</div>

I had an existing web module which I added support for Kotlin (Javascript). I choose copy libraries and I got this: ![/uploads/kotlinlang/original/1X/2bfc44650ad7d2647afec9a9b4554af06192c258.png](upload://6h70GPkddqvuU6qqHYY94XKkSxy.png)

However when I compile I get this error:  
Error:Kotlin: ‘/Users/joerunds/.m2/repository/org/apache/commons/commons-lang3/3.4/commons-lang3-3.4.jar’ is not a valid Kotlin Javascript library

commons-lang is the first 3rd-party dependency in the list of dependencies.

What am I doing wrong?

---

<div class="post-metadata">

**Author:** ![Michael.Nedzelsky](https://avatars.discourse-cdn.com/v4/letter/m/e19b73/32.png) [@Michael.Nedzelsky](https://discuss.kotlinlang.org/u/Michael.Nedzelsky)\
**Post date:** [April 27, 2015, 10:32pm UTC](https://discuss.kotlinlang.org/t/java-dependencies-not-a-valid-kotlin-javascript-library/270/2 "2015-04-27T22:32:06Z")

</div>

For now, each dependency for kotlin/javascript module should be a valid Kotlin Javascript library, e.g., contains some js-files with metadata (like kotlin-jslib.jar).

There is an example with different submodules for js and jvm in one project, see [https://github.com/cy6erGn0m/html4k](https://github.com/cy6erGn0m/html4k).

---

<div class="post-metadata">

**Author:** ![jvskriubakken](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/jvskriubakken/32/1430_2.png) [@jvskriubakken](https://discuss.kotlinlang.org/u/jvskriubakken)\
**Post date:** [April 28, 2015, 6:49am UTC](https://discuss.kotlinlang.org/t/java-dependencies-not-a-valid-kotlin-javascript-library/270/3 "2015-04-28T06:49:18Z")

</div>

I see, thanks! I will try to imitate your setup.

But why do you have these lines in the topmost pom?

\<build\>  
&nbsp;&nbsp;\<sourceDirectory\>${project.basedir}/src/main/kotlin\</sourceDirectory\>  
&nbsp;&nbsp;\<testSourceDirectory\>${project.basedir}/src/test/kotlin\</testSourceDirectory\>  
\</build\>

---

<div class="post-metadata">

**Author:** ![Michael.Nedzelsky](https://avatars.discourse-cdn.com/v4/letter/m/e19b73/32.png) [@Michael.Nedzelsky](https://discuss.kotlinlang.org/u/Michael.Nedzelsky)\
**Post date:** [April 28, 2015, 9:20am UTC](https://discuss.kotlinlang.org/t/java-dependencies-not-a-valid-kotlin-javascript-library/270/4 "2015-04-28T09:20:33Z")

</div>

It is really not my project (author: [https://github.com/cy6erGn0m](https://github.com/cy6erGn0m)).

About the mentioned lines in the topmost pom: it seems you can set these values independently in every sub-project, and the result will be the same.

---

<div class="post-metadata">

**Author:** ![jvskriubakken](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/jvskriubakken/32/1430_2.png) [@jvskriubakken](https://discuss.kotlinlang.org/u/jvskriubakken)\
**Post date:** [April 28, 2015, 10:38am UTC](https://discuss.kotlinlang.org/t/java-dependencies-not-a-valid-kotlin-javascript-library/270/5 "2015-04-28T10:38:39Z")

</div>

OK. I see. It would be helpful if JetBrains could provide more project examples on using maven (especially for Kotlin javascript). It would then be easier for newcomers to get something running.

For example, I’m struggling to know what’s actually required to be included in the final war.

---

<div class="post-metadata">

**Author:** ![jvskriubakken](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/jvskriubakken/32/1430_2.png) [@jvskriubakken](https://discuss.kotlinlang.org/u/jvskriubakken)\
**Post date:** [April 28, 2015, 7:57pm UTC](https://discuss.kotlinlang.org/t/java-dependencies-not-a-valid-kotlin-javascript-library/270/6 "2015-04-28T19:57:25Z")

</div>

I managed to get around this by moving my Kotlin code a separate Maven module and ensure that it has no Java dependencies or inherits any from parent module.
