Developing Vert.x Modules with Gradle
- =========
- https://www.techempower.com/benchmarks/#section=data-r12&hw=peak&test=json
- =========
- Developing Vert.x modules with Gradle
- Clone the template project
- Outputs
- Configuring the project
- Overriding default Vert.x configuration
- Other useful Gradle tasks
- Setup your IDE
- Changing the dependencies of your project
- Installing your module in Maven local
- Pushing your module to Maven
- Registering your module in the Module Registry
- Next steps
Developing Vert.x modules with Gradle
In this guide we'll show you how to develop a Vert.x project using Gradle.
Clone the template project
We provide a template Gradle project which you can clone to get you started.
Clone it locally
git clone https://github.com/vert-x/vertx-gradle-template.git my-vertx-module
Where my-vertx-module is the name you want to give your project.
Remove the origin
git remote rm origin
And add your new origin
git remote add origin <path to your repo>
Let's run the tests to make sure everything is working
cd my-vertx-module
./gradlew test
You should use the Gradle Wrapper (./gradlew) to run all Gradle tasks. You do not need to install Gradle manually. Take a look atbuild.gradle for a list of the available tasks.
Outputs
The outputs of the project are:
- The Vert.x module zip file.
- A jar that corresponds to the module will also be produced. This is useful when you have another project which depends on the classes from your module, as it allows you to add it as a standard Gradle build dependency in your other project.
The outputs are created in the build directory as per normal.
Configuring the project
You configure many things in gradle.properties:
modowner,modnameandversiondetermine the name of the module as described in the modules manualpullInDepsdetermines whether all module dependencies should be packaged into the module as nested modules.
It also contains various properties used to configure versions of various dependencies.
Overriding default Vert.x configuration
If you want to override any Vert.x platform configuration, e.g. langs.properties, cluster.xml or logging configuration, you can add those files to the directory src/main/platform_lib - these will then be added to the Vert.x platform classpath when you run the module with ./gradlew runMod
Other useful Gradle tasks
Open build.gradle and take a look at the comments there for a list of useful tasks supported by the build script.
Setup your IDE
You can use the idea and eclipse Gradle plugins to create the project files for your IDE
./gradlew idea
Or
./gradlew eclipse
Once the IDE files have been created you can open the project files in your IDE.
Note: You can run the idea or eclipse tasks again if you change your project dependencies - in this way the IDE project files will be brought up-to-date.
You may have to tell your IDE to use Java source compatibility level of Java 7, as Gradle seems to default to Java 6 (!)
Changing the dependencies of your project
If your project needs a third party jar to build and you want to include it in the lib directory of your module you can add the dependency in the dependencies section of build.gradle with a type of compile.
If you don't want it to be included in the lib directory you should add it as provided.
Once you've changed your dependencies just run ./gradlew idea or ./gradlew eclipse again to update your IDE project files with the new dependencies.
Installing your module in Maven local
Use ./gradlew install to install your module in your local Maven repository.
Pushing your module to Maven
Use ./gradlew uploadArchives as normal to push your module to a Maven repository.
Registering your module in the Module Registry
If you've pushed your module to a public Maven or Bintray repository you can register it in the Module Registry so others can search for and discover it.
Next steps
Now you've got the project all set-up and running, it's time to explore the standard project layout itself.
摘自:http://vertx.io/vertx2/gradle_dev.html#developing-vertx-modules-with-gradle
Developing Vert.x Modules with Gradle的更多相关文章
- Developing Vert.x Modules using the Standard Project
The module The tests Unit tests Integration tests Java integration tests JavaScript integration test ...
- Gradle Cheat Sheet
加快编译速度 使用 gradle 2.4 及以上版本 ~/.gradle/gradle.properties 加入如下配置 org.gradle.daemon=true org.gradle.jvma ...
- Python:渗透测试开源项目
Python:渗透测试开源项目[源码值得精读] sql注入工具:sqlmap DNS安全监测:DNSRecon 暴力破解测试工具:patator XSS漏洞利用工具:XSSer Web服务器压力测试工 ...
- Python:渗透测试开源项目【源码值得精读】
sql注入工具:sqlmap DNS安全监测:DNSRecon 暴力破解测试工具:patator XSS漏洞利用工具:XSSer Web服务器压力测试工具:HULK SSL安全扫描器:SSLyze 网 ...
- 使用Maven命令行快速创建项目骨架(archetype)
> mvn archetype:generate 接下来就会输出一些列带索引变化的archetype项可供我们选择,然后提示我们选择一个编号,可以直接回车选择默认的编号(392),然后就跟着 ...
- AndroidStudio遇到过的问题
尊重原创 1.uses-sdk:minSdkVersion 1 cannot be smaller than version 4 declared in library [com.android.su ...
- 这里有123个黑客必备的Python工具!
123个Python渗透测试工具,当然不仅于渗透~ 如果你想参与漏洞研究.逆向工程和渗透,我建议你时候用Python语言.Python已经有很多完善可用的库,我将在这里把他们列出来. 这个清单里的工具 ...
- odoo开发笔记 -- 借助模块queue_job实现异步方法调用
场景描述: 对比了几个定时调度的框架,发现各有优缺点: celery 很强,异步定时调度,异步周期调度,也有延时调度的功能,但是延时调度的案例比较少,遂暂时不使用. queue_job,一个odoo第 ...
- Java SE 9 模块化示例
Java SE 9 模块化示例 作者:Grey 原文地址:Java SE 9 模块化示例 说明 Java SE 9引入了模块系统,模块就是代码和数据的封装体.模块的代码被组织成多个包,每个包中包含Ja ...
随机推荐
- 让 Python 的1、数据库查询返回字典记录--- 2、利用zip函数将两个列表(list)组成字典(dict)
让 Python 的数据库查询返回字典记录: https://yanbin.blog/python-database-query-return-dictionary-result/#more-9179 ...
- 使用 Canal 实现数据异构
小结: 1. https://mp.weixin.qq.com/s/z-5aoGVuk7JzIGrJJWgeJw 使用 Canal 实现数据异构 原创: 杜亦舒 性能与架构 3月4日
- 线性表->顺序存储
文字描述: 用一组地址连续的存储单元依次存储线性表的数据元素,只要确定了存储线性表的起始位置,线性表中任一数据元素都可随机存取,所以线性表的顺序存储结构是一种随机存取的存储结构. 即是,线性表的顺序存 ...
- ReactJS antd 环境中项目上传图片后压缩(lrz的使用)
lrz说明 ( github地址 :https://github.com/think2011/localResizeIMG ) 用于:在客户端压缩好要上传的图片可以节省带宽更快的发送给后端,特别适合在 ...
- react将字符串转义成html语句
在使用reactjs库的时候,会遇到将一段html的字符串,然后要将它插入页面中以html的形式展现,然而直接插入的话页面显示的就是这段字符串,而不会进行转义,可以用以下方法插入,便可以html的形式 ...
- POI导出excel列宽自适应
让单元格宽度随着列和单元格值的宽度自适应: //存储最大列宽 Map<Integer, Integer> maxWidth = new HashMap<>(); // 将列头设 ...
- 红黑树与AVL特性
红黑树:比较平衡的二叉树,没有一条路径会比其他路径长2倍,因而是近似平衡的.所以相对于严格要求平衡的AVL树来说,它的旋转保持平衡次数较少.插入删除次数多的情况下我们就用红黑树来取代AVL. 红黑树规 ...
- jQuery通过ajax请求php遍历json数组到table中的代码
html代码(test.html),js在html底部 具体代码如下所示: <!DOCTYPE html> <html lang="en"> <hea ...
- 使用@Autowired时,取值为null
如果取不到,可以考虑其他方式 场景: @Autowired private StringRedisTemplate redisTemplate; 想使用redisTemplate,但是使用时为null ...
- C#设计模式(13)——代理模式(Proxy Pattern)(转)
一.引言 在软件开发过程中,有些对象有时候会由于网络或其他的障碍,以至于不能够或者不能直接访问到这些对象,如果直接访问对象给系统带来不必要的复杂性,这时候可以在客户端和目标对象之间增加一层中间层,让代 ...