简体   繁体   中英

How can I run a Kotlin's maven project which using IDEA and don't using .m2 repository?

guys. I want to using IDEA to create a Kotlin's maven project.My maven repository is not the default location which is.m2. When I maven import,it using the location which I set, but when I build the project, the IDEA want to using /home/$USER/.m2/repository to search the jar.How can I fixed it?

Warning:Kotlin: Classpath entry points to a non-existent location: /home/wfb/.m2/repository/org/apache/commons/commons-lang3/3.4/commons-lang3-3.4.jar
Error:(3, 16) Kotlin: Cannot access built-in declaration 'kotlin.Array'. Ensure that you have a dependency on the Kotlin standard library

I try to using terminal to run it and It doesn't have problems. When Using IDEA to run it, the tips like above

1) Preferences > Build,Execution,Deployment > Build Tools > Maven

2) Check "Override" near "Local Repository" and input the path to your Maven local repository

PS I'm using IDEA 2018.3, so on other versions the path to this setting might slightly differ

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM