Git Product home page Git Product logo

vertx-gradle-starter's Introduction

Vert.x Gradle Starter

This project is a template to start your own Vert.x project using Gradle.

Prerequisites

  • JDK 8+

Getting started

Create your project with:

git clone https://github.com/vert-x3/vertx-gradle-starter.git PROJECT_NAME

Replace PROJECT_NAME with the name of your project.

On Linux and MacOSx (or Windows with bash), if you want to go faster and generate an already configured project run:

curl http://vertx.io/assets/starter-scripts/create-vertx-project-gradle.sh -o vertx-create-gradle-project.sh; bash vertx-create-gradle-project.sh

Running the project

Once you have retrieved the project, you can check that everything works with:

./gradlew test run

The command compiles the project and runs the tests, then it launches the application, so you can check by yourself. Open your browser to http://localhost:8080. You should see a Hello World message.

Anatomy of the project

The project contains:

  • the Gradle project using the Kotlin DSL (see build.gradle.kts) with auto-reloading and fat-jar building

  • a main verticle file (src/main/java/io/vertx/starter/MainVerticle.java)

  • a unit test (src/main/test/io/vertx/starter/MainVerticleTest.java)

Start to hack

  1. Delete the .git directory

  2. Open the build.gradle.kts file and customize vertxVersion. You can also change the mainVerticleName variable to use your own package name and verticle class.

  3. Run ./gradlew run.

This last command relaunches Gradle and the application as soon as you change something under src/main.

Building the project

To build the project, just use:

./gradlew build

It generates a fat-jar in the build/libs directory.

vertx-gradle-starter's People

Contributors

cescoffier avatar jponge avatar pmlopes avatar tsegismont avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vertx-gradle-starter's Issues

./gradlew run FAILURE: Build failed with an exception.

hello, I have tried to get started with this template.

after

$ git clone <repo link> && cd <repo> && ./gradlew run

I've got an error like:
image

Actually, I've got the same message after running

curl http://vertx.io/assets/starter-scripts/create-vertx-project-gradle.sh -o vertx-create-gradle-project.sh; bash vertx-create-gradle-project.sh

any suggestions?

feel free to help me and ask any questions :)))

WARNING running the app

I'm getting the following warning after run the project, is it something the I need to care?

BUILD SUCCESSFUL in 0s
1 actionable task: 1 executed
Apr 04, 2018 1:21:02 PM io.vertx.core.impl.launcher.commands.Watcher
INFO: User command terminated with status 0
Starting vert.x application...
2fc40f89-15dd-4d92-82b9-3fcdc0124fd4-redeploy
Apr 04, 2018 1:21:02 PM io.vertx.core.impl.launcher.commands.Watcher
INFO: Redeployment done in 1479 ms.
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by io.netty.util.internal.ReflectionUtil (file:/Users/erik/.gradle/caches/modules-2/files-2.1/io.netty/netty-common/4.1.19.Final/b281916c11d3eeec5e839677ec4f2eb9d7586928/netty-common-4.1.19.Final.jar) to constructor java.nio.DirectByteBuffer(long,int)
WARNING: Please consider reporting this to the maintainers of io.netty.util.internal.ReflectionUtil
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Apr 04, 2018 1:21:03 PM io.vertx.core.impl.launcher.commands.VertxIsolatedDeployer
INFO: Succeeded in deploying verticle

Regards.

Application doesn't properly finish

After running the application from the command line with ./gradlew run, it replies to requests to localhost:8080, but then there are a couple of problems:

  1. If a change the text in MainVerticle, the console shows that it's being redeployed INFO: Succeeded in deploying verticle, but subsequent requests to localhost:8080 still show the old text.
  2. After killing it with Ctrl+C, it still replies to requests to localhost:8080, and starting it again with ./gradlew run, it shows Starting a Gradle Daemon, 1 busy Daemons could not be reused, use --status for details, and the port is still in use SEVERE: java.net.BindException: Address already in use: bind.

So I go and manually kill the process using the port 8080. Now I can start the application successfully (the port is no longer used), but it shows that there are now 2 running daemons.

PS: I'm using Windows 10.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.