Gradle Install---
Http://www.itnose.net/detail/6500082.html
Http://stackoverflow.com/questions/5102571/how-to-install-maven-artifact-with-sources-from-command-line
----------
MVN Source:jar Install to install the Maven artifacts.
It's quite easy with Eclipse, right click on the Project Explorer view, click Maven menu item, then click Downlo Ad Sources:
------------
There's a tricky problem with Maven:
is to add dependencies because there is no download and associated source code, resulting in automatic prompt cannot appear the correct method name, and do not install the anti-compiler in the case can not enter the method to see the implementation of the internal.
In fact, the Eclipse Maven plugin provides this functionality, but there may be many developers do not pay attention to this feature, so this share to those who are not very clear about this feature, the configuration is simple, only need to tick windows-preferences-maven- Download Artifact Sources This option is available.
Gradle Modifying the Maven warehouse address
Recently migrating some projects to Android Studio, using the Gradle build is really a lot easier than the original ant. However, it is really painful to download the dependent speed at compile time.
If you can switch to a domestic MAVEN image warehouse, such as open source China's Maven library, or replace it with a self-built MAVEN, it must be excellent.
An easy way to modify the Build.gradle in the project root directory is to replace it with the following jcenter()
mavenCentral()
:
123)45 |
allprojects { repositories { maven{ url ‘http://maven.oschina.net/content/groups/public/‘} }}
|
But Jiabuzhu project more, difficult not to change each?
Naturally there is a convenient way, the following copy to the name of the init.gradle
file, and save to the USER_HOME/.gradle/
folder.
123456789 |
Allprojects{ Repositories{ DefRepository_url=' Http://maven.oschina.net/content/groups/public ' All{ArtifactrepositoryRepo- If(RepoinstanceofMavenartifactrepository){ DefUrl=Repo.Url.Tostring() If(Url.StartsWith(' Https://repo1.maven.org/maven2 ')||Urlstartswith ( ' https://jcenter.bintray.com/' { project. Logger. "Repository ${repo.url} replaced by $REPOSITORY _url." remove repo } }} maven { url repository_url } }}
|
init.gradle
The file is actually Gradle 初始化脚本
(initialization Scripts) and is the global configuration of the runtime.
For more detailed information, see http://gradle.org/docs/current/userguide/init_scripts.html
Gradle Modifying the Maven warehouse address