IntelliJ IDEA和Maven:无法完成教程,Maven Artifact Search不返回任何类 [英] IntelliJ IDEA and Maven: Can't complete tutorial, Maven Artifact Search returns no classes

查看:1524
本文介绍了IntelliJ IDEA和Maven:无法完成教程,Maven Artifact Search不返回任何类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在这里完成在IntelliJ下使用Maven的教程: http://wiki.jetbrains.net/intellij/Creating_and_importing_Maven_projects

I'm working through the tutorial here for using Maven under IntelliJ: http://wiki.jetbrains.net/intellij/Creating_and_importing_Maven_projects

我要处理使用依赖项"部分.我尝试使用Maven Artifact Search添加Maven依赖关系.在搜索班级"标签中,无论我在搜索框中键入什么内容,都不会显示任何内容.在搜索工件"下,一开始会显示大约二十个依赖项.

I'm up to the 'working with dependencies' section. I try to add a Maven Dependency using Maven Artifact Search. In the 'search for class' tab, nothing shows up, no matter what I type in the search box. Under 'search for artifact', about two dozen dependencies show up at the start.

有关此类问题的大多数讨论都表明IntelliJ中的Maven设置存在问题.我确认Maven主目录设置正确.在存储库"下, http://repo1.maven.org/maven2 URL存在,我当时在能够更新它.

Most of the discussions about this type of issue suggest a problem with Maven settings in IntelliJ. I confirmed that the Maven home directory is set properly. Under 'Repositories', the http://repo1.maven.org/maven2 URL is there and I was able to update it.

我使用search.maven.org仔细检查了按类名搜索是否确实产生了我搜索的值"TestCase"的结果.我正在使用Maven 3.1.1,Windows 7 x64,JDK 1.7 64bit.

I used search.maven.org to double check that searching by class name does produce a result for the value I search for, "TestCase". I am using Maven 3.1.1, Windows 7 x64, JDK 1.7 64bit.

更新: 如果我手动编辑pom.xml,Maven可以工作,即可以运行目标,并且它们将下载依赖项并构建项目.但是,工件搜索永远找不到任何类别.我提供了一个屏幕快照,其中显示了当我使用Artifact Search搜索工件时显示的内容. (即使我直接上传到SO,也似乎未显示指向我的图像的链接,不确定为什么... imgur在我的位置被阻止了)

Update: Maven works, i.e. goals can be run and they will download dependencies and build the project, if I edit pom.xml manually. However the Artifact Search cannot find any class, ever. I included a screenshot of what shows up when I use Artifact Search to search for artifacts. (Link to my image does not seem to appear even though I uploaded right to SO, not sure why... maybe imgur is blocked at my location)

推荐答案

请在设置"中导航到项目设置"->"Maven"->存储库" 然后在您的列表中找到repo1并单击更新"-这将重建您的存储库索引并搜索类将起作用

Please navigate in Settings to Project settings -> Maven -> Repositories Then find repo1 on your list and click "Update" - that will rebuild your repositories indexes and search for class will work

这篇关于IntelliJ IDEA和Maven:无法完成教程,Maven Artifact Search不返回任何类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆