简体   繁体   English

解决NetBeans Maven项目中依赖项的问题

[英]Solving issues with dependencies in a NetBeans Maven Project

I have a project in NetBeans that uses Maven to download additional dependencies I might need. 我在NetBeans中有一个项目,该项目使用Maven下载我可能需要的其他依赖项。 Yesterday I started getting red underlines on imports that had already existed for months. 昨天,我开始对已经存在了几个月的进口商品加红色强调。 I made a couple of mistakes that made the problem worse in trying to fix it, I misunderstood how "install local artifact" is used and I think ended up placing some JARs inside other packages. 我犯了一些错误,使该问题在尝试修复时变得更糟,我误解了“安装本地工件”的使用方式,并且我认为最终在其他软件包中放置了一些JAR。

The long story short of it is that now I have an indeterminate number of packages that have the correct name, but incorrect contents. 长话短说,现在我有不确定数量的软件包,它们的名称正确,但内容不正确。 I tried deleting the project cloning an earlier version, and switching to other branches of the project I have never touched, but the imports still appear to be messed up, so I can only conclude there is a local problem with my computer. 我尝试删除克隆早期版本的项目,并切换到我从未接触过的项目的其他分支,但是导入仍然看起来很混乱,所以我只能得出结论,我的计算机存在本地问题。

Is there any way to wipe out all the locally installed versions of these packages and re-download them fresh? 是否有办法清除这些软件包的所有本地安装版本,然后重新下载它们? Its to the point where trying to solve it one problem at a time would eat up multiple days, and since I have a saved copy of the correctly formatted pom.xml for my project, I'd rather just rebuild from there, but I have no idea how to do that, or even if it is possible. 一次尝试解决一个问题会耗费数天的时间,并且由于我已经为我的项目保存了格式正确的pom.xml的副本,所以我只想从那里重建,不知道该怎么做,甚至是可能的。

You could try to delete all maven artifacts from your local maven repository: $USER_HOME/.m2 And then refresh the project so it will re-download all dependencies. 您可以尝试从本地Maven存储库中删除所有Maven工件:$ USER_HOME / .m2,然后刷新项目,以便它将重新下载所有依赖项。 You could also just delete those dependencies that are causing problems 您也可以删除那些导致问题的依赖项

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

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