• 第一个gradle工程


    1. 下载gradle,并配置

    2. 配置idea的gradle(不支持,可以下插件)

    3. 创建gradle项目

    4 配置依赖

     1 plugins {
     2     id 'java'
     3 }
     4 
     5 group 'com.xf'
     6 version '1.0'
     7 
     8 //jdk encode
     9 sourceCompatibility = 1.8
    10 targetCompatibility = 1.8
    11 compileJava.options.encoding = 'UTF-8'
    12 compileJava.options.encoding = 'UTF-8'
    13 
    14 //仓库配置
    15 repositories {
    16     mavenLocal()        //使用本地仓库
    17     maven { name "Alibaba"; url "https://maven.aliyun.com/repository/public" }
    18     mavenCentral()      //使用maven中心仓库
    19 }
    20 
    21 //版本控制
    22 project.ext {
    23     hadoopVersion = '2.6.5'
    24     sparkVersion = '2.4.0'
    25     scalaVersion = '2.11.8'
    26     slf4jVersion = '1.7.7'
    27     log4jVersion = '1.2.17'
    28     hbaseVersion = '2.2.0'
    29     esVersion = '7.3.1'
    30     junitVersion = '4.12'
    31 }
    32 //
    33 dependencies {
    34     compile group: 'org.apache.spark', name: 'spark-core_2.11', version: sparkVersion
    35     compile(
    36             'org.apache.hadoop:hadoop-client:' + hadoopVersion,
    37             'org.apache.spark:spark-sql_2.11:' + sparkVersion,
    38             'org.scala-lang:scala-library:' + scalaVersion,
    39             'org.elasticsearch.client:elasticsearch-rest-high-level-client:' + esVersion,
    40             'org.apache.hbase:hbase-client:' + hbaseVersion
    41     )
    42     runtime(
    43             'org.slf4j:slf4j-log4j12:' + slf4jVersion,
    44             'log4j:log4j:' + log4jVersion
    45     )
    46     testCompile group: 'junit', name: 'junit', version: junitVersion
    47 }
    View Code

    5 并测试运行

  • 相关阅读:
    你真的了解HTML吗?–雅虎面试题
    移动端meta 解释
    PLSQL导入导出表的正确步骤
    Linux命令学习之xargs命令
    python搭建简易Web Server
    python小项目练习之转换像素图片为字符图
    向量空间搜索引擎基本理论
    Elasticsearch 常用基本查询
    Elasticsearch配置参数介绍
    JavaWeb温习之防止表单重复提交
  • 原文地址:https://www.cnblogs.com/xiefeichn/p/13185480.html
Copyright © 2020-2023  润新知