简体   繁体   English

使用依赖项在 IntelliJ IDEA 中编译工件?

[英]Compile artifact in IntelliJ IDEA with dependencies?

I am trying to compile an artifact with dependecies of commons-io (org.apache.commons.io), IDE included it in maven automatically.我正在尝试使用 commons-io (org.apache.commons.io) 的依赖项编译一个工件,IDE 自动将它包含在 Z402C5D9AF6B43711EA070BEE5170F7D4 中。

Thing is, I prefer compiling artifacts over compiling maven projects.事实是,我更喜欢编译工件而不是编译 maven 项目。 And when I compile artifacts, I get NoClassDefFoundError , but when I compile project with maven, everything works.当我编译工件时,我得到NoClassDefFoundError ,但是当我用 maven 编译项目时,一切正常。 What should I do to make artifacts have those dependencies?我应该怎么做才能使工件具有这些依赖项?

PS: my artifact settings. PS:我的神器设置。

I figured it out myself.我自己想通了。

Just deleted the old artifact and created new one, and it worked.只需删除旧工件并创建新工件,它就可以工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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