zoukankan      html  css  js  c++  java
  • eclipse gradle插件(buildship)的安装和使用

    前言:博客园上第一篇被人批评的文章,自己又读了一下,确实有写的不清楚的地方。

    现在想更好的使用gradle,有个更好的办法。

    升级Eclipse至Oxygen版本,已经默认集成这个插件了,强烈推荐。

    一、下载gradle

    https://gradle.org/gradle-download/

    二、手动安装gradle插件

    我选择的是buildship,经过实际使用,体验很好。

    插件的下载地址是:

    http://download.eclipse.org/buildship/updates/e46/milestones/2.x

    运行eclipse,点击Help->Install New Software...

    输入插件的下载地址,选择安装,同意license即可。

    三、eclipse新建项目

    新建选项里多了一个gradle选项。

    点击确定,eclipse会下载gradle-bin-xxx。

    等等,我好想已经安装了gradle啊。

    果断的取消自动下载。

    四、使用本地gradle

    点击Window->Preferences->Gradle

    啊哈,这里有个Gradle Distribution的配置。

    在Local installation directory配置项中选择本地的bin包解压路径即可。

    五、重新新建一个gradle项目

    这次弹出插件的配置选项。

    默认使用步骤四中配置的gradle,直接下一步就好。

    六、默认的build.gradle

     1 /*
     2  * This build file was generated by the Gradle 'init' task.
     3  *
     4  * This generated file contains a sample Java project to get you started.
     5  * For more details take a look at the Java Quickstart chapter in the Gradle
     6  * user guide available at https://docs.gradle.org/3.3/userguide/tutorial_java_projects.html
     7  */
     8 
     9 // Apply the java plugin to add support for Java
    10 apply plugin: 'java'
    11 
    12 // In this section you declare where to find the dependencies of your project
    13 repositories {
    14     // Use jcenter for resolving your dependencies.
    15     // You can declare any Maven/Ivy/file repository here.
    16     jcenter()
    17 }
    18 
    19 dependencies {
    20     // The production code uses Guava
    21     compile 'com.google.guava:guava:20.0'
    22 
    23     // Use JUnit test framework
    24     testCompile 'junit:junit:4.12'
    25 }

    啊哈,开始你的gradle之旅吧。

  • 相关阅读:
    20200804 千锤百炼软工人第三十天
    20200803 千锤百炼软工人第二十九天
    20200802 千锤百炼软工人第二十八天
    小谢第51问:从输入url到浏览器显示页面发生了什么
    小谢第50问:vuex的五个属性-使用-介绍
    小谢第49问:URL都由什么组成
    小谢第48问:js跳转页面与打开新窗口的方法
    小谢第47问:vue项目中,assets和static的区别
    小谢第46问:js事件机制
    小谢第45问:Ajax 是什么? 如何创建一个 Ajax
  • 原文地址:https://www.cnblogs.com/yoyotl/p/6249698.html
Copyright © 2011-2022 走看看