intellij idea 下载的Maven索引更新状态始终是error,无法更新:看下图。

IntelliJ IDEA中Maven插件无法更新索引之解决办法
Maven的仓库、索引中央仓库:目前来说, 是真正的Maven中央仓库的地址,该地址内置在Maven的源码中,其它地址包括著名的,都是镜像。
索引:中央仓库带有索引文件以方便用户对其进行搜索,完整的索引文件至日大小约为1.11G,索引每周更新一次。
本地仓库:是建立在本地机器上的Maven仓库,本地仓库是中央仓库(或者说远程仓库)的一个缓冲和子集,当你构建Maven项目的时候,首先会从本地仓库查找资源,如果没有,那么Maven会从远程仓库下载到你本地仓库。这样在你下次使用的时候就不需要从远程下载了。如果你所需要的Jar包版本在本地仓库没有,而且也不存在于远程仓库,Maven在构建的时候会报错,这种情况可能发生在有些Jar包的新版本没有在Maven仓库中及时更新。Maven缺省的本地仓库地址为${user.home}/.m2/repository。也就是说,一个用户会对应的拥有一个本地仓库。当然你可以通过修改${user.home}/.m2/settings.xml配置这个地址:12345&settings&
&localRepository& D:/java/repository&/localRepository&
...&/settings&
提交内容:只要你的项目是开源的,而且你能提供完备的POM等信息,你就可以提交项目文件至中央仓库,这可以通过Sonatype提供的实现。
IntelliJ IDEA利用索引实现自动补全众所周知,由于伟大的中国防火墙,所以在使用IDEA下载Maven仓库索引的时候,要么无法访问,要么就是速度极慢,这对开发人员带来了极大的不便,所以一般公司都用Nexus搭建一个公司内部的私服。同时利用私服更有利于对公司内部开发人员依赖的Jar包版本进行控制。
也许你会问,中央仓库带有索引,为什么本地的IDEA也需要下载索引呢?那么直接看下图你就明白了,如果本地没有下载索引的话,在pom.xml文件中添加依赖是得不到任何提示的。
IntelliJ IDEA中Maven插件配置IntelliJ已经内置了对Maven插件的支持,当然你也可以配置自己的Maven,只需要进入Settings-&Maven-&Maven home directory|User settings file|Local repository配置即可。注意如果使用自己配置的Maven,那么一定要勾选Override,否则配置不生效。
IntelliJ14.1更新索引失败原因在使用14.1.X版本的IntelliJ时,更新Maven索引出现如下错误,根据该链接内所述原因为:这是IntelliJ14.1.X版本中的一个BUG,并且会在下一个发布版本中进行修复,推荐将IntelliJ升级到版本15。
使用国内Maven仓库的镜像鉴于伟大的防火墙,所以推荐使用国内的镜像资源作为Maven中央仓库。推荐使用,配置很简单就不详述了,有两种方式,其一打开settings.xml文件,加入12345678&mirrors&
&id&nexus-osc&/id&
&mirrorOf&*&/mirrorOf&&!--用一个简单的*号会把所有的仓库地址屏蔽掉--&
&name&Nexus osc&/name&
&url&http://maven.oschina.net/content/groups/public/&/url&
&/mirror&&/mirrors&
当然还有第二种方式,就是屏蔽指定的中央仓库,并且还可以加入OSChina的第三方镜像仓库或者多个仓库,配置如下1234567891011121314&mirrors&
&id&nexus-osc&/id&
&mirrorOf&central&/mirrorOf&&!--这里指定只屏蔽central仓库--&
&name&Nexus osc&/name&
&url&http://maven.oschina.net/content/groups/public/&/url&
&id&nexus-osc-thirdparty&/id&
&mirrorOf&thirdparty&/mirrorOf&
&name&Nexus osc thirdparty&/name&
&url&http://maven.oschina.net/content/repositories/thirdparty/&/url&
&/mirror&&/mirrors&
最后,在执行Maven命令的时候,Maven还需要安装一些插件包,这些插件包的下载地址也让其指向OSChina的Maven地址。修改如下所示1234567891011121314151617181920212223242526272829303132&profile&
&id&jdk-1.8&/id&
&activation&
&jdk&1.8&/jdk&&!--指定JDK版本是1.8时自动激活--&
&/activation&
&repositories&
&repository&
&id&nexus&/id&
&name&local private nexus&/name&
&url&http://maven.oschina.net/content/groups/public/&/url&
&releases&
&enabled&true&/enabled&
&/releases&
&snapshots&
&enabled&false&/enabled&
&/snapshots&
&/repository&
&/repositories&
&pluginRepositories&
&pluginRepository&
&id&nexus&/id&
&name&local private nexus&/name&
&url&http://maven.oschina.net/content/groups/public/&/url&
&releases&
&enabled&true&/enabled&
&/releases&
&snapshots&
&enabled&false&/enabled&
&/snapshots&
&/pluginRepository&
&/pluginRepositories&&/profile&
另外你也可以下载开源中国提供的官方纯净版文件。
下载Maven仓库的索引在配置完成之后就可以下载仓库索引了,注意这是一个非常耗时的过程,建议利用晚上或者出去午饭时间下载。下载过程及下载完成之后状态如下图所示。本次下载整体耗时在一个小时左右。另外我在思考既然下载一次这么麻烦,那么下载下来的索引存放在哪里呢?我能否将其拷贝到其他机器重复利用呢?于是经过一番搜索我发现了索引的存放位置,并且将其打包拷贝到其他机器的同样位置,但未做测试,不知能否重复利用,如有网友测试完毕,可以告诉我,感谢之。
利用本地Tomcat作为索引下载服务器首先下载如下两个文件:
启动一个Apache Tomcat服务器,在其根目录下建立一个/maven2/.index的虚拟目录(注意:如果你使用的是Windows系统,可能无法建立.index件夹,必须使用DOS命令:mkdir .index),把上述两个文件拷贝至该虚拟目录下
编辑C:/WINDOWS/system32/drivers/etc/hosts文件,在文件中加入:127.0.0.1
repo1.maven.org注意:127.0.0.1为步骤2的Apache Tomcat服务器IP地址。
在IDEA的maven插件中更新索引
移除步骤3中在hosts文件中添加的内容
备注:其实该解决办法的总体思路就是先将索引文件整体下载,然后利用本地的Tomcat作为服务器,再从Tomcat上更新索引。
最后如果你想自己配置一个私服,可以参考。
开源中国镜像存在的问题开源中国镜像不是很稳定,有时候很快下载完成有时候一直处于Resolving dependencies of ...状态而无法下载
在配置了开源中国第三方库镜像之后,发现一个问题,该库内容更新不及时,很多第三方库中的Jar包版本都非常陈旧。
开源中国的中央仓库与第三方库中存在很多交叉的情况,也就是说中央仓库包括了第三方库中的内容,而且在下载jar文件的时候,默认就是直接从开源中国的中央仓库镜像下载,而不是开源中国的第三方仓库镜像下载。
我给出的建议是,如无必要,移除开源中国的第三方库镜像地址,移除的内容如下
123456&mirror&
&id&nexus-osc-thirdparty&/id&
&mirrorOf&thirdparty&/mirrorOf&
&name&Nexus osc thirdparty&/name&
&url&http://maven.oschina.net/content/repositories/thirdparty/&/url&&/mirror&
针对以上问题,有时候还是需要从国外Maven官方的仓库下载,方法是只需要修改settings.xml文件为官方默认版本即可。现将Maven默认settings.xml贴出
123456789101112131415&?xml version="1.0" encoding="UTF-8"?&&settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd"&
&localRepository&D:/apache-maven-3.3.1/repository&/localRepository&
&/pluginGroups&
&/proxies&
&/servers&
&/mirrors&
&profiles&
&/profiles&&/settings&
转载请注明出处:
若发现bug或建议,欢迎IntelliJ IDEA 13 is Released! Work Miracles in Java and Beyond | IntelliJ IDEA Blog
Tips & tricks, news, how-to’s about the most intelligent Java IDE
Today we are thrilled to announce that IntelliJ IDEA 13, the next version of our award-winning Java IDE, is finally .
This year the IntelliJ IDEA team worked on building stronger ties with the companies behind many leading development technologies like Android, Spring, Scala and Gradle. As a result, we are able to stay ahead of the curve and bring you the best possible tools to work with these cutting-edge technologies.
Committed to providing the best and earliest support for new technologies to all Java developers, IntelliJ IDEA 13 adopts Java EE 7, the latest version of Oracle’s enterprise Java platform, along with code assistance for CDI 1.1, JSF 2.2, JAX-RS 2.0, Batch Processing and other new specs. There’s also support for the new versions of enterprise application servers such as Glassfish 4, Wildfly 8, Tomcat 8, and others. For a more detailed overview, watch our short .
Spring developers will find the new version more helpful than ever, with the new Spring tool window which helps to easily navigate through the contexts, configured in the project and its beans. With the new tool window you can also browse the MVC controllers and see their URL mappings. IntelliJ IDEA 13 also offers better performance and simplified Spring projects configuration.
One of the most exciting announcements at this year’s Google I/O was the , a new development environment for Android, built on top of IntelliJ IDEA Community Edition. This influx of passionate Android developers using IntelliJ Platform helps greatly to improve and enrich it with great new features. IntelliJ IDEA 13 is the first major release that reaps the benefits of this collaboration: better code editor and UI designer, easier SQLite database access, and many others.
Another key enhancement in IntelliJ IDEA 13 is refined Gradle support, including improved project synchronization, code completion for dependencies and plugins, quick documentation, and code generation. IntelliJ IDEA 13 is even able to configure Web facet and WAR artifacts automatically based on Gradle files. You can take a look at the Gradle support in this .
User interface
The last year brought IntelliJ IDEA users a darker, s today we have been working hard to make the overall user experience more straightforward and functional: the new Search everywhere action, Presentation and Lens modes, all help finding way around IDE much faster. Plus, the Toolbar and Tool window buttons are hidden by default conserving the valuable screen space. Of course, there’s more: the new light look and feel on Linux (default in Community Edition) and Windows, and Fullscreen mode made available for Linux users.
Accessing data stored in various databases is important part of application development, so IntelliJ IDEA 13 addresses it with improved data handling tools. Simplified configuration of data sources in the Database tools, the new Structure view, handy view and navigate actions for primary and foreign keys in the Table editor, smart code completion for SQL, the new Query filter controls and many more.
What else is noteworthy:
Improved Git, Mercurial and Subversion tools (including support for Subversion 1.8)
Enhanced debugger
Better performance
Groovy support improvements
Better Scala support with built-in SBT integration
New tools for web development, including JavaScript code coverage, Stylus and Compass support
The new built-in Terminal tool window
CloudFoundry 2.0, OpenShift and Heroku deployment tools
To see the complete list of what’s new in IntelliJ IDEA 13, and to download the edition of your choice, please visit the official .
Both personal and commercial licenses now include 1-year upgrade subscription. For more information on the new pricing and licensing options for IntelliJ IDEA, please visit .
Enjoy the brand new IntelliJ IDEA!
About Andrey Cheptsov
Part-time dreamer. JVM/JavaScript geek. IntelliJIDEA Marketing Manager at JetBrains.
This entry was posted in
and tagged . Bookmark the .
Categories
JetBrains blogsIntelliJ IDEA 12.0.3 更新版发布 - 推酷
IntelliJ IDEA 12.0.3 更新版发布
IntelliJ IDEA 12.0.3 更新版发布了,该版本更多还是 bug 的修复,详情请看
&(Usability Problem)
Export signed APK keyboard usability issue
Android preview does not understand views having custom attributes in selector
Cannot resolve symbol string (in R.string.* reference)
Android app artifact is not zipaligned
Very slow (sluggish) in the XML designer
Code Analysis. Inspection
&(Usability Problem)
Analyze | Inspect Code on a module should make the selected module scope the default choice
&Missing @Deprecated annotation& inspection does not recognize removing @deprecated javadoc tag
Replace constructor with factory method inspection shall have an option so can be ignored on abstract classes
Class extends utility class does not ignore on empty child classes
Unnecessary fully qualified name inspection reports wrongly. again in 12.0.2
`package.html` may be converted to `package-info.java` inspection doesn't produce any results
Show intention actions (alt-enter) doesn't work (ClassNotFoundException in Inspection-JS)
Compiling Project
Eclipse compiler cannot handle UTF-8 chars
Cannot build artifact for big project - IU 12 Preview
IntelliJ does not respect module jdk/language-level if it is based on eclipse dependencies storage format
Idea can't compile project with JDK8
Creating a Cucumber step definition in Groovy results in AssertionError
Dart: when creating Dart project by template, don't use Tab characters for indentation in generated pubspec.yaml
&(Usability Problem)
Changing of data source level
DB Console skips columns when copying to clipboard
Data Source Properties window, JDBC property descriptions don't match
Wrong task cancel warning on closing different window
IDEA shows incorrect file during Flash/Flex debugging (Flex SDK 4.9)
'Prefer ActionScript Compiler 2.0' options and project-level compiler options are not respected in external compiler mode if the project is stored in *.ipr file format
FlexUnit 0.9 not supported anymore
&arguments& object is not recognized as Array
SWC dependency with 'test' scope overrides dependency with 'compile' scope.
ActionScript: 'Find Usages' doesn't show usages of implementing/overridden methods
Grails 2.1 and Maven Debugging problem
Groovy: Invalid warning &'valueOf' in 'java.lang.Enum
' cannot be applied to '(java.lang.String)'&
Spock: double pipe in table header
Groovy code style: 'next line' for class class declaration bakes anonymous classes
Intention &Convert [] Form to index method& (Before-&After should be swapped)
Incorrect Groovy stubs generated by IDEA in case of varargs and default named arguments
WebStorm puts machine-specific path to application directory to misc.xml
QL: code completion suggests nothing in the injection fragment
IntelliJ does not include Maven transitive dependencies in classpath during rebuild
Output filename mismatch when using in-project dependency with maven classifier
Property precedence is not the same when filtering resources with Maven or with IntelliJ
If Maven project has two resources-folders, neither is copied.
&(Feature)
Database connection over SSH tunnel
Before Launch task shows console in &reserved& tab
Freeze by deadlock
Can't report an exception in plugin UI Designer (Core)
'Create Constant Field ...' make not a new line
&Create Constant Field& does not create the correct type.
Project Configuration
&(Usability Problem)
&New Module& does not remember last selected module type
SQL: HSQLDB: CALL is red
Oracle SQL Dialect: Good code is reported as red
EAP: Code Formatting: table name interpreted as keyword
Open Task - Mark as 'In Progress' not persistent
Task/Jira Connection: All Jira Tasks are marked as resolved
&(Usability Problem)
An option to set regular font size on editor's tab titles
No icons for toolwindows in recent files and switcher
Rendering of Deployment -& Sync screen is broken
User Interface.Darcula
Too light color in application and web deployment editor
Version Control. Git
Force checkout as new local branch — a branch already exists
RelaxNG Compact &as you type validator& may render IntelliJ instance unusable
下载地址:
已发表评论数()
已收藏到推刊!
请填写推刊名
描述不能大于100个字符!
权限设置: 公开
仅自己可见
正文不准确
标题不准确
排版有问题
没有分页内容
图片无法显示
视频无法显示
与原文不一致

我要回帖

更多关于 intellij idea 15 的文章

 

随机推荐